Skip to content

Conversation

zeitlinger
Copy link
Member

No description provided.

@zeitlinger zeitlinger self-assigned this Aug 18, 2025
@zeitlinger zeitlinger requested a review from a team as a code owner August 18, 2025 10:39
@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Aug 18, 2025
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

1 similar comment
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

Comment on lines -36 to +39
private static final Instrumenter<Void, Void> INSTRUMENTER =
Instrumenter.<Void, Void>builder(
private static final Object REQUEST = new Object();

private static final Instrumenter<Object, Void> INSTRUMENTER =
Instrumenter.<Object, Void>builder(
Copy link
Member

Choose a reason for hiding this comment

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

why were these changes needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Nullable String method,
@Nullable String route,
int updatedBySourceOrder,
@Nullable Span span) {
Copy link
Member

Choose a reason for hiding this comment

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

just checking, is null Span ever passed in here?

Copy link
Member Author

Choose a reason for hiding this comment

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

just above: create(method, route, updatedBySourceOrder, null);

@@ -19,6 +19,7 @@
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
* any time.
*/
@SuppressWarnings("NullAway") // setters called in static initializer
Copy link
Member

Choose a reason for hiding this comment

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

I don't see static initializer in this class? or is it called from another class?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's the static methods setInstrumenterAccess and setInstrumenterBuilderAccess

I realized that we could also add an @Initializer annotation to those methods - but we'd need a place to add this annotation.

See https://github.com/uber/NullAway/wiki/Supported-Annotations#initialization

Copy link
Member

Choose a reason for hiding this comment

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

oh, maybe it wants the static fields to be annotated with @Nullable

Copy link
Member Author

Choose a reason for hiding this comment

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

if we'd do that - we'd get an error when the field is accessed: instrumenterAccess.startAndEnd

Copy link
Member Author

Choose a reason for hiding this comment

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

I just added the annotation to see if that looks better

@zeitlinger
Copy link
Member Author

@trask can you check again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test native This label can be applied to PRs to trigger them to run native tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants