diff --git a/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll index b71776ba015..517f55fcc86 100644 --- a/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll +++ b/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll @@ -188,7 +188,7 @@ class PatternAnnotation extends Annotation, RegexMatch::Range { result.(MethodCall).getMethod().(GetterMethod).getField() = this.getAnnotatedElement() or // Annotation on parameter - value of parameter will match regexp - result = this.getAnnotatedElement().(Parameter).getAnAccess().(VarRead) + result.(VarRead).getVariable().(Parameter) = this.getAnnotatedElement() or // Annotation on method - return value of method will match regexp result.(Call).getCallee() = this.getAnnotatedElement()