File tree 1 file changed +9
-4
lines changed
java/ql/lib/semmle/code/java
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -383,8 +383,8 @@ class AnnotationType extends Interface {
383
383
384
384
/**
385
385
* Gets the retention policy of this annotation type, that is, the name of one of the
386
- * enum constants of `java.lang.annotation.RetentionPolicy`. If no explicit retention
387
- * policy is specified the result is `CLASS`.
386
+ * enum constants of `java.lang.annotation.RetentionPolicy`. If this annotation type
387
+ * has no `@Retention` annotation, the result is `CLASS`.
388
388
*/
389
389
string getRetentionPolicy ( ) {
390
390
if this .getADeclaredAnnotation ( ) instanceof RetentionAnnotation
@@ -397,8 +397,13 @@ class AnnotationType extends Interface {
397
397
/**
398
398
* Holds if the element type is a possible target for this annotation type.
399
399
* The `elementType` is the name of one of the `java.lang.annotation.ElementType`
400
- * enum constants. If no explicit target is specified for this annotation type
401
- * it is considered to be applicable in all declaration contexts.
400
+ * enum constants.
401
+ *
402
+ * If this annotation type has no `@Target` annotation, it is considered to be applicable
403
+ * in all declaration contexts. This matches the behavior of the latest Java versions
404
+ * but differs from the behavior of older Java versions. This predicate must only be
405
+ * called with names of `ElementType` enum constants; for other values it might hold
406
+ * erroneously.
402
407
*/
403
408
bindingset [ elementType]
404
409
predicate isATargetType ( string elementType ) {
You can’t perform that action at this time.
0 commit comments