Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ebeac2 commit d0de025Copy full SHA for d0de025
1 file changed
java/ql/src/semmle/code/java/Annotation.qll
@@ -25,11 +25,11 @@ class Annotation extends @annotation, Expr {
25
26
/** Gets the element being annotated. */
27
Element getAnnotatedElement() {
28
- this.getParent().(Field).getDeclaration().getAField() = result and
29
- this.getCompilationUnit().fromSource()
30
- or
31
- not result.(Field).getCompilationUnit().fromSource() and
32
- this.getParent() = result
+ exists(Element e | e = this.getParent() |
+ if e.(Field).getCompilationUnit().fromSource()
+ then result = e.(Field).getDeclaration().getAField()
+ else result = e
+ )
33
}
34
35
/** Gets the annotation type declaration for this annotation. */
0 commit comments