Update span-stacktrace module to follow style guide#181
Closed
Update span-stacktrace module to follow style guide#181
Conversation
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update span-stacktrace module to follow style guide
Update span-stacktrace module to follow style guide
Aug 24, 2025
trask
reviewed
Aug 24, 2025
| */ | ||
| public StackTraceSpanProcessor( | ||
| long minSpanDurationNanos, Predicate<ReadableSpan> filterPredicate) { | ||
| long minSpanDurationNanos, @Nullable Predicate<ReadableSpan> filterPredicate) { |
Author
There was a problem hiding this comment.
The @Nullable annotation was added because the API already accepts null for the filterPredicate parameter. The tests explicitly pass null (line 41 in test file) and the auto-configuration can pass null when no filter is configured. The original code had a bug where passing null would cause a NullPointerException at filterPredicate.test(span). My changes fixed this by adding the proper null check: if (filterPredicate != null && !filterPredicate.test(span)). The @Nullable annotation documents this existing API behavior and follows the style guide requirement to annotate nullable parameters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the span-stacktrace module to comply with the project's style guide requirements in
docs/style-guide.md. The changes are minimal and focused on code style consistency without altering functionality.Changes Made
StackTraceSpanProcessor.java:
finalkeyword to the public API class declarationCODE_STACKTRACEfromio.opentelemetry.semconv.**@Nullableannotations to thefilterPredicateparameter and fieldfilterPredicatein theonEndingmethodStackTraceAutoConfig.java:
finalkeyword to the public API class declarationFINEandSEVEREfromjava.util.logging.Level.*StackTraceAutoConfigTest.java:
publicto package-protected (no explicit modifier)All tests continue to pass and the module builds successfully. The changes follow the style guide conventions for:
@Nullableannotation usageFixes #179.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.