Skip to content

Conversation

@Gosling-dude
Copy link
Contributor

Adds brief comments explaining why certain warnings are intentionally suppressed in the api common module.

No functional changes.
Fixes #7874.

@Gosling-dude Gosling-dude requested a review from a team as a code owner January 4, 2026 02:33
@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (7b2161c) to head (3634e2d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7951      +/-   ##
============================================
- Coverage     90.14%   90.12%   -0.03%     
+ Complexity     7467     7465       -2     
============================================
  Files           834      834              
  Lines         22586    22586              
  Branches       2240     2240              
============================================
- Hits          20360    20355       -5     
- Misses         1527     1530       +3     
- Partials        699      701       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Override
@SuppressWarnings({"unchecked", "rawtypes"})
// Safe: Attributes guarantees iteration over matching AttributeKey<T> / value pairs.
// Raw types are used here to avoid additional allocations while copying entries.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generic types don't survive into compiled code, so this has nothing to do with allocations that I know of.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generic types don't survive into compiled code, so this has nothing to do with allocations that I know of.

Good catch, thanks for pointing that out. You're right, the allocation comment isn't accurate here. I'll update the comment to focus only on the type-safety guarantee.

@jkwatson jkwatson merged commit 9629bbe into open-telemetry:main Jan 4, 2026
27 checks passed
@otelbot
Copy link
Contributor

otelbot bot commented Jan 4, 2026

Thank you for your contribution @Gosling-dude! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

@zeitlinger
Copy link
Member

It would be good to change the tooling to make sure an entire module is covered, e.g. by adding a property to the build file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comments for suppressed warnings

3 participants