Skip to content

Commit a74d423

Browse files
committed
Java: Improve AnnotationPresentCheck.ql
1 parent 9c9c5c0 commit a74d423

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

java/ql/src/Likely Bugs/Reflection/AnnotationPresentCheck.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ where
1919
m.getNumberOfParameters() = 1 and
2020
c.getArgument(0).getType() = p and
2121
p.getATypeArgument() = t and
22-
not exists(Annotation a |
22+
not exists(RetentionAnnotation a |
2323
t.getAnAnnotation() = a and
24-
a.getType().hasQualifiedName("java.lang.annotation", "Retention") and
2524
a.getAValue().(VarAccess).getVariable().hasName("RUNTIME")
2625
)
2726
select c, "Call to isAnnotationPresent where no annotation has the RUNTIME retention policy."

0 commit comments

Comments
 (0)