File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
java/ql/lib/semmle/code/java Expand file tree Collapse file tree 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 {
383383
384384 /**
385385 * 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`.
388388 */
389389 string getRetentionPolicy ( ) {
390390 if this .getADeclaredAnnotation ( ) instanceof RetentionAnnotation
@@ -397,8 +397,13 @@ class AnnotationType extends Interface {
397397 /**
398398 * Holds if the element type is a possible target for this annotation type.
399399 * 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.
402407 */
403408 bindingset [ elementType]
404409 predicate isATargetType ( string elementType ) {
You can’t perform that action at this time.
0 commit comments