File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
java/ql/lib/semmle/code/java Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -217,13 +217,15 @@ class Annotatable extends Element {
217
217
)
218
218
}
219
219
220
- private Annotation getAnAssociatedAnnotation ( AnnotationType t ) {
221
- result .getType ( ) = t and
220
+ private Annotation getADeclaredAssociatedAnnotation ( AnnotationType t ) {
222
221
// Direct or indirect annotation
223
- if getADeclaredAnnotation ( ) .getType ( ) = t or getAnIndirectAnnotation ( ) .getType ( ) = t
224
- then (
225
- result = getADeclaredAnnotation ( ) or result = getAnIndirectAnnotation ( )
226
- ) else (
222
+ result .getType ( ) = t and result = [ getADeclaredAnnotation ( ) , getAnIndirectAnnotation ( ) ]
223
+ }
224
+
225
+ private Annotation getAnAssociatedAnnotation ( AnnotationType t ) {
226
+ if exists ( getADeclaredAssociatedAnnotation ( t ) )
227
+ then result = getADeclaredAssociatedAnnotation ( t )
228
+ else (
227
229
// Only if neither a direct nor an indirect annotation is present look for an inherited one
228
230
t .isInherited ( ) and
229
231
// @Inherited only works for classes; cast to Annotatable is necessary because predicate is private
You can’t perform that action at this time.
0 commit comments