Skip to content

Commit 953ff9f

Browse files
committed
PatternAnnotation.getString() should only be field reads
1 parent 106254b commit 953ff9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class PatternAnnotation extends Annotation, RegexExecutionExpr::Range {
182182

183183
override Expr getString() {
184184
// Annotation on field accessed by direct read - value of field will match regexp
185-
result = this.getAnnotatedElement().(Field).getAnAccess()
185+
result.(FieldRead).getField() = this.getAnnotatedElement()
186186
or
187187
// Annotation on field accessed by getter - value of field will match regexp
188188
result.(MethodCall).getMethod().(GetterMethod).getField() = this.getAnnotatedElement()

0 commit comments

Comments
 (0)