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 extends Annotation> annotationClass);
+ default boolean isAnnotationPresent(Class extends Annotation> annotationClass) {
+ return getAnnotation(annotationClass) != null;
+ }
/**
* Returns this element's annotation for the specified type if
--- old/src/share/classes/java/lang/reflect/Parameter.java 2013-02-01 13:27:23.000000000 -0800
+++ new/src/share/classes/java/lang/reflect/Parameter.java 2013-02-01 13:27:22.000000000 -0800
@@ -280,14 +280,6 @@
return getDeclaredAnnotations();
}
- /**
- * @throws NullPointerException {@inheritDoc}
- */
- public boolean isAnnotationPresent(
- Class extends Annotation> annotationClass) {
- return getAnnotation(annotationClass) != null;
- }
-
private transient Map