mirror of
https://github.com/github/codeql.git
synced 2026-02-28 21:03:50 +01:00
Java: Check compilation unit of the same element in both disjuncts.
This commit is contained in:
@@ -25,11 +25,11 @@ class Annotation extends @annotation, Expr {
|
||||
|
||||
/** Gets the element being annotated. */
|
||||
Element getAnnotatedElement() {
|
||||
this.getParent().(Field).getDeclaration().getAField() = result and
|
||||
this.getCompilationUnit().fromSource()
|
||||
or
|
||||
not result.(Field).getCompilationUnit().fromSource() and
|
||||
this.getParent() = result
|
||||
exists(Element e | e = this.getParent() |
|
||||
if e.(Field).getCompilationUnit().fromSource()
|
||||
then result = e.(Field).getDeclaration().getAField()
|
||||
else result = e
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets the annotation type declaration for this annotation. */
|
||||
|
||||
Reference in New Issue
Block a user