Repository navigation
Commit cc83d6b
build(android): Run Error Prone and NullAway on the Android modules (#6493)
* build(android): Run Error Prone and NullAway on the Android modules
net.ltgt.errorprone dropped Android support in 3.0.0, which we have used since 6.7. Since then
it only enables Error Prone and adds it to the processor path for Gradle's JVM source sets. On
sentry-android-core and sentry-uitest-android the errorprone dependencies and the NullAway ERROR
setting had no effect, and the Java compile tasks ran plain javac.
Use the AGP variant API to add the errorprone configuration to each variant's annotation
processor configuration and enable Error Prone on its JavaCompile task. Both APIs exist in AGP
9.0.0, the oldest version in the AGP matrix.
Pass -XDandroidCompatible=true so Error Prone treats these modules as Android code: it skips
checks that don't apply there, such as DefaultCharset, and runs its Android checks.
sentry-uitest-android has no hand-written Java, so exclude the view binding classes AGP
generates, which trip LabelledBreakTarget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): Resolve NullAway findings in AndroidConnectionStatusProvider
NullAway treats AtomicReference.get() as nullable, so the snapshot
reads added in #6537 fail once NullAway runs on sentry-android-core.
The snapshot is never set to null, so read it through one accessor
that suppresses the finding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 16e51ee commit cc83d6b
3 files changed
Lines changed: 43 additions & 17 deletions
File tree
- sentry-android-core
- src/main/java/io/sentry/android/core/internal/util
- sentry-android-integration-tests/sentry-uitest-android
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
| 400 | + | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
485 | 491 | | |
486 | 492 | | |
487 | | - | |
| 493 | + | |
488 | 494 | | |
489 | 495 | | |
490 | 496 | | |
| |||
510 | 516 | | |
511 | 517 | | |
512 | 518 | | |
513 | | - | |
| 519 | + | |
514 | 520 | | |
515 | 521 | | |
516 | 522 | | |
| |||
651 | 657 | | |
652 | 658 | | |
653 | 659 | | |
654 | | - | |
| 660 | + | |
655 | 661 | | |
656 | 662 | | |
657 | 663 | | |
| |||
699 | 705 | | |
700 | 706 | | |
701 | 707 | | |
702 | | - | |
| 708 | + | |
703 | 709 | | |
704 | 710 | | |
705 | 711 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
| |||
0 commit comments