mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Java: Improve AnnotationPresentCheck.ql
This commit is contained in:
@@ -19,9 +19,8 @@ where
|
||||
m.getNumberOfParameters() = 1 and
|
||||
c.getArgument(0).getType() = p and
|
||||
p.getATypeArgument() = t and
|
||||
not exists(Annotation a |
|
||||
not exists(RetentionAnnotation a |
|
||||
t.getAnAnnotation() = a and
|
||||
a.getType().hasQualifiedName("java.lang.annotation", "Retention") and
|
||||
a.getAValue().(VarAccess).getVariable().hasName("RUNTIME")
|
||||
)
|
||||
select c, "Call to isAnnotationPresent where no annotation has the RUNTIME retention policy."
|
||||
|
||||
Reference in New Issue
Block a user