mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Java: Account for non-source annotation on second field in multi-field declarations.
This commit is contained in:
@@ -27,7 +27,11 @@ class Annotation extends @annotation, Expr {
|
||||
Element getAnnotatedElement() {
|
||||
exists(Element e | e = this.getParent() |
|
||||
if e.(Field).getCompilationUnit().fromSource()
|
||||
then result = e.(Field).getDeclaration().getAField()
|
||||
then
|
||||
exists(FieldDeclaration decl |
|
||||
decl.getField(0) = e and
|
||||
result = decl.getAField()
|
||||
)
|
||||
else result = e
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user