Skip to content

Commit

Permalink
Fix Lint crash with AGP 8.1.0. See https://github.com/google/dagger/p…
Browse files Browse the repository at this point in the history
…ull/4023/files#r1308159525 for details.

Fixes #3980.

RELNOTES=Fixes #3980.
PiperOrigin-RevId: 564502143
  • Loading branch information
Chang-Eric authored and Dagger Team committed Sep 11, 2023
1 parent 47953aa commit e651294
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion java/dagger/lint/DaggerKotlinIssueDetector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ class DaggerKotlinIssueDetector : Detector(), SourceCodeScanner {
) {
val containingClass = node.containingClass?.toUElement(UClass::class.java) ?: return
if (containingClass.isObject()) {
val annotation = node.findAnnotation(JVM_STATIC_ANNOTATION)!!
val annotation = node.findAnnotation(JVM_STATIC_ANNOTATION)
?: node.javaPsi.modifierList.findAnnotation(JVM_STATIC_ANNOTATION)!!
context.report(
ISSUE_JVM_STATIC_PROVIDES_IN_OBJECT,
context.getLocation(annotation),
Expand Down

0 comments on commit e651294

Please sign in to comment.