--- old/src/java.base/share/classes/java/lang/Class.java 2020-03-02 23:35:15.792513999 -0800 +++ new/src/java.base/share/classes/java/lang/Class.java 2020-03-02 23:35:15.508655999 -0800 @@ -3772,9 +3772,14 @@ } /** + * {@inheritDoc} + *

Note that any annotation returned by this method is a + * declaration annotation. + * * @throws NullPointerException {@inheritDoc} * @since 1.5 */ + @Override @SuppressWarnings("unchecked") public A getAnnotation(Class annotationClass) { Objects.requireNonNull(annotationClass); @@ -3793,6 +3798,10 @@ } /** + * {@inheritDoc} + *

Note that any annotations returned by this method are + * declaration annotations. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @@ -3807,13 +3816,22 @@ } /** + * {@inheritDoc} + *

Note that any annotations returned by this method are + * declaration annotations. + * * @since 1.5 */ + @Override public Annotation[] getAnnotations() { return AnnotationParser.toArray(annotationData().annotations); } /** + * {@inheritDoc} + *

Note that any annotation returned by this method is a + * declaration annotation. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @@ -3826,6 +3844,10 @@ } /** + * {@inheritDoc} + *

Note that any annotations returned by this method are a + * declaration annotations. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @@ -3838,8 +3860,13 @@ } /** + * {@inheritDoc} + *

Note that any annotations returned by this method are + * declaration annotations. + * * @since 1.5 */ + @Override public Annotation[] getDeclaredAnnotations() { return AnnotationParser.toArray(annotationData().declaredAnnotations); } --- old/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java 2020-03-02 23:35:16.284267999 -0800 +++ new/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java 2020-03-02 23:35:16.052383999 -0800 @@ -509,9 +509,14 @@ new ReflectionFactory.GetReflectionFactoryAction()); /** + * {@inheritDoc} + *

Note that any annotation returned by this method is a + * declaration annotation. + * * @throws NullPointerException {@inheritDoc} * @since 1.5 */ + @Override public T getAnnotation(Class annotationClass) { throw new AssertionError("All subclasses should override this method"); } @@ -527,6 +532,10 @@ } /** + * {@inheritDoc} + *

Note that any annotations returned by this method are + * declaration annotations. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @@ -536,13 +545,22 @@ } /** + * {@inheritDoc} + *

Note that any annotations returned by this method are + * declaration annotations. + * * @since 1.5 */ + @Override public Annotation[] getAnnotations() { return getDeclaredAnnotations(); } /** + * {@inheritDoc} + *

Note that any annotation returned by this method is a + * declaration annotation. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @@ -555,6 +573,10 @@ } /** + * {@inheritDoc} + *

Note that any annotations returned by this method are a + * declaration annotations. + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @@ -567,8 +589,13 @@ } /** + * {@inheritDoc} + *

Note that any annotations returned by this method are + * declaration annotations. + * * @since 1.5 */ + @Override public Annotation[] getDeclaredAnnotations() { throw new AssertionError("All subclasses should override this method"); } --- old/src/java.base/share/classes/java/lang/reflect/AnnotatedType.java 2020-03-02 23:35:16.744037999 -0800 +++ new/src/java.base/share/classes/java/lang/reflect/AnnotatedType.java 2020-03-02 23:35:16.508155999 -0800 @@ -25,6 +25,8 @@ package java.lang.reflect; +import java.lang.annotation.Annotation; + /** * {@code AnnotatedType} represents the potentially annotated use of a type in * the program currently running in this VM. The use may be of any type in the @@ -72,4 +74,16 @@ * @return the type this annotated type represents */ public Type getType(); + + /** + * {@inheritDoc} + *

Note that any annotation returned by this method is a type + * annotation. + * + * @throws NullPointerException {@inheritDoc} + * @since 1.8 + */ + @Override + T getAnnotation(Class annotationClass); + } --- old/src/java.base/share/classes/java/lang/reflect/Constructor.java 2020-03-02 23:35:17.203807999 -0800 +++ new/src/java.base/share/classes/java/lang/reflect/Constructor.java 2020-03-02 23:35:16.967925999 -0800 @@ -576,9 +576,11 @@ /** * {@inheritDoc} + * * @throws NullPointerException {@inheritDoc} * @since 1.5 */ + @Override public T getAnnotation(Class annotationClass) { return super.getAnnotation(annotationClass); } @@ -587,6 +589,7 @@ * {@inheritDoc} * @since 1.5 */ + @Override public Annotation[] getDeclaredAnnotations() { return super.getDeclaredAnnotations(); } --- old/src/java.base/share/classes/java/lang/reflect/Executable.java 2020-03-02 23:35:17.707556000 -0800 +++ new/src/java.base/share/classes/java/lang/reflect/Executable.java 2020-03-02 23:35:17.467676000 -0800 @@ -544,6 +544,9 @@ * ("synthetic") to the parameter list for a method. See {@link * java.lang.reflect.Parameter} for more information. * + *

Note that any annotations returned by this method are + * declaration annotations. + * * @see java.lang.reflect.Parameter * @see java.lang.reflect.Parameter#getAnnotations * @return an array of arrays that represent the annotations on @@ -577,6 +580,7 @@ * {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ + @Override public T getAnnotation(Class annotationClass) { Objects.requireNonNull(annotationClass); return annotationClass.cast(declaredAnnotations().get(annotationClass)); @@ -584,6 +588,7 @@ /** * {@inheritDoc} + * * @throws NullPointerException {@inheritDoc} */ @Override @@ -596,6 +601,7 @@ /** * {@inheritDoc} */ + @Override public Annotation[] getDeclaredAnnotations() { return AnnotationParser.toArray(declaredAnnotations()); } --- old/src/java.base/share/classes/java/lang/reflect/Field.java 2020-03-02 23:35:18.167326000 -0800 +++ new/src/java.base/share/classes/java/lang/reflect/Field.java 2020-03-02 23:35:17.935441999 -0800 @@ -1132,9 +1132,12 @@ } /** + * {@inheritDoc} + * * @throws NullPointerException {@inheritDoc} * @since 1.5 */ + @Override public T getAnnotation(Class annotationClass) { Objects.requireNonNull(annotationClass); return annotationClass.cast(declaredAnnotations().get(annotationClass)); @@ -1142,6 +1145,7 @@ /** * {@inheritDoc} + * * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @@ -1155,6 +1159,7 @@ /** * {@inheritDoc} */ + @Override public Annotation[] getDeclaredAnnotations() { return AnnotationParser.toArray(declaredAnnotations()); }