--- old/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java 2020-04-06 16:20:02.347005001 -0700 +++ new/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java 2020-04-06 16:20:02.091005001 -0700 @@ -38,8 +38,25 @@ import sun.reflect.annotation.AnnotationType; /** - * Represents an annotated element of the program currently running in this - * VM. This interface allows annotations to be read reflectively. All + * Represents an annotated construct of the program currently running in this + * VM. + * + * A construct is either an element or a type. Annotations on an + * element are on a declaration, whereas annotations on a + * type are on a specific use of a type name. + * + * As defined by The Java™ Language Specification + * section {@jls 9.7.4}, an annotation on an element is a + * declaration annotation and an annotation on a type is a + * type annotation. + * + * Note that any annotations returned by methods on the {@link + * AnnotatedType AnnotatedType} interface and its subinterfaces are + * type annotations as the entity being potentially annotated is a + * type. Annotations returned by methods outside of the {@code + * AnnotatedType} hierarchy are declaration annotations. + * + *

This interface allows annotations to be read reflectively. All * annotations returned by methods in this interface are immutable and * serializable. The arrays returned by methods of this interface may be modified * by callers without affecting the arrays returned to other callers. @@ -47,8 +64,8 @@ *

The {@link #getAnnotationsByType(Class)} and {@link * #getDeclaredAnnotationsByType(Class)} methods support multiple * annotations of the same type on an element. If the argument to - * either method is a repeatable annotation type (JLS 9.6), then the - * method will "look through" a container annotation (JLS 9.7), if + * either method is a repeatable annotation type (JLS {@jls 9.6}), then the + * method will "look through" a container annotation (JLS {@jls 9.7}), if * present, and return any annotations inside the container. Container * annotations may be generated at compile-time to wrap multiple * annotations of the argument type. @@ -260,8 +277,8 @@ *

The truth value returned by this method is equivalent to: * {@code getAnnotation(annotationClass) != null} * - *

The body of the default method is specified to be the code - * above. + * @implSpec The body of the default method is specified to be returning the the value of the code + * expression above. * * @param annotationClass the Class object corresponding to the * annotation type @@ -310,7 +327,7 @@ * * The difference between this method and {@link #getAnnotation(Class)} * is that this method detects if its argument is a repeatable - * annotation type (JLS 9.6), and if so, attempts to find one or + * annotation type (JLS {@jls 9.6}), and if so, attempts to find one or * more annotations of that type by "looking through" a container * annotation. * @@ -406,7 +423,7 @@ * * The difference between this method and {@link * #getDeclaredAnnotation(Class)} is that this method detects if its - * argument is a repeatable annotation type (JLS 9.6), and if so, + * argument is a repeatable annotation type (JLS {@jls 9.6}), and if so, * attempts to find one or more annotations of that type by "looking * through" a container annotation if one is present. *