--- old/src/share/classes/java/lang/reflect/AnnotatedElement.java 2013-02-01 13:27:22.000000000 -0800 +++ new/src/share/classes/java/lang/reflect/AnnotatedElement.java 2013-02-01 13:27:22.000000000 -0800 @@ -91,6 +91,9 @@ *

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. + * * @param annotationClass the Class object corresponding to the * annotation type * @return true if an annotation for the specified annotation @@ -98,7 +101,9 @@ * @throws NullPointerException if the given annotation class is null * @since 1.5 */ - boolean isAnnotationPresent(Class annotationClass); + default boolean isAnnotationPresent(Class annotationClass) { + return getAnnotation(annotationClass) != null; + } /** * Returns this element's annotation for the specified type if