Repository navigation
fix(android): Resolve NullAway findings in sentry-android-core - #6497
Merged
Merged
Conversation
4 of 9 tasks
📲 Install BuildsAndroid
|
runningcode
commented
Nov 10, 2026
runningcode
marked this pull request as ready for review
November 10, 2026 08:09
runningcode
requested review from
0xadam-brown and
romtsn
and removed request for
a team
November 10, 2026 08:09
NullAway never ran on sentry-android-core. Enabling it reports 32 errors. Most are fields and return types that are nullable but not annotated, and fields NullAway cannot see as checked because a check happens in a different scope (a lambda, another method) than the dereference. - Annotate the nullable fields and return types, including ViewHierarchyNode.setType and UiElement.equals in the sentry module. - Read options once in lambdas, and pass scopes and options to createStandaloneAppStartTransaction, whose callers already check them. - Compute the device family once instead of through a LazyEvaluator, whose evaluator must not return null. - Create the system events HandlerThread in the branch that uses it, inside the existing try. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ered The filter was a nullable field, built on the first registration and cleared in close(). It only depends on the final actions array, so build it in the registration task instead. That leaves nothing nullable to track. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/android-core-nullaway
branch
from
November 10, 2026 08:31
984b01c to
4f3e92b
Compare
finishAppStartSpan passed the nullable options field to getAppStartTimeSpanWithFallback, which NullAway reports on main. The end time is only used when performance is enabled, which register() sets together with options, so return early when either is unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/android-core-nullaway
branch
from
November 10, 2026 08:41
4f3e92b to
11f129a
Compare
# Conflicts: # sentry-android-core/src/main/java/io/sentry/android/core/internal/util/AndroidConnectionStatusProvider.java
0xadam-brown
approved these changes
Nov 11, 2026
0xadam-brown
left a comment
Member
There was a problem hiding this comment.
One question on my end worth considering before merging. Otherwise lgtm.
@nullable byte[] annotates the element type for TYPE_USE annotations, so Kotlin saw ByteArray instead of ByteArray?. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 9 tasks
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.
📜 Description
This adds
@Nullableand fixes the NullAway findings insentry-android-core.💡 Motivation and Context
NullAway is set to ERROR for
sentry-android-corebut never ran, because Error Prone didn't run there at all (#6493). This is one of four independent PRs that fix what it reports. It targetsmainbecause it breaks no API (the.apidumps are unchanged); it reaches9.x.xwith the next merge frommain.💚 How did you test it?
Compiled with Error Prone enabled: no NullAway findings remain and none are added. The unit tests of the touched classes pass.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
ViewHierarchyEventProcessor.snapshotViewHierarchyAsDatais now@Nullable. It already returned null when the hierarchy couldn't be captured. Kotlin callers in hybrid SDKs now seeByteArray?and have to handle null.Issues
🤖 Generated with Claude Code
#skip-changelog