-
Notifications
You must be signed in to change notification settings - Fork 903
Remove component provider generic type #7606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Remove component provider generic type #7606
Conversation
696ddc4
to
03ea864
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7606 +/- ##
============================================
- Coverage 89.99% 89.99% -0.01%
+ Complexity 7079 7078 -1
============================================
Files 803 803
Lines 21419 21410 -9
Branches 2086 2086
============================================
- Hits 19276 19267 -9
Misses 1479 1479
Partials 664 664 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
391e7a6
to
d25ee3c
Compare
@@ -106,14 +75,10 @@ void create_OtlpHttpDefaults() { | |||
|
|||
assertThat(exporter.toString()).isEqualTo(expectedExporter.toString()); | |||
|
|||
assertThat(exporter.toString()).isEqualTo(expectedExporter.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just removing an existing duplicative line
@@ -216,14 +179,10 @@ void create_OtlpGrpcDefaults() { | |||
|
|||
assertThat(exporter.toString()).isEqualTo(expectedExporter.toString()); | |||
|
|||
assertThat(exporter.toString()).isEqualTo(expectedExporter.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just removing an existing duplicative line
c3590d0
to
6c64fe5
Compare
6c64fe5
to
5a22503
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good to me.
Java generics strike again..... 🙈
OtlpHttpSpanExporter expectedExporter = OtlpHttpSpanExporter.getDefault(); | ||
OtlpHttpSpanExporter expectedExporter = | ||
OtlpHttpSpanExporter.getDefault().toBuilder() | ||
.setComponentLoader(capturingComponentLoader) // needed for the toString() check to pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bummer, but yeah ok.
.../test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/CapturingComponentLoader.java
Show resolved
Hide resolved
I'm fine with it. Don't know if we want to wait for @jack-berg or ask for forgiveness if he hates the change? |
The generic type makes it awkward to use with
@AutoService
, because it requires you to useSuppressWarnings("rawtypes")
(some background at google/auto#870), e.g.https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/c7dd76454f5af080a1c385fdb7fda2c6bace68f5/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/internal/ProcessResourceComponentProvider.java#L19-L20
Plus, it doesn't seem like we lose much by removing the generic type (in fact it ends up being slightly less code).