--- old/src/share/classes/java/lang/Class.java 2013-02-01 13:27:21.000000000 -0800 +++ new/src/share/classes/java/lang/Class.java 2013-02-01 13:27:20.000000000 -0800 @@ -3085,16 +3085,6 @@ /** * @throws NullPointerException {@inheritDoc} - * @since 1.5 - */ - public boolean isAnnotationPresent(Class annotationClass) { - Objects.requireNonNull(annotationClass); - - return getAnnotation(annotationClass) != null; - } - - /** - * @throws NullPointerException {@inheritDoc} * @since 1.8 */ public A[] getAnnotations(Class annotationClass) { --- old/src/share/classes/java/lang/Package.java 2013-02-01 13:27:21.000000000 -0800 +++ new/src/share/classes/java/lang/Package.java 2013-02-01 13:27:21.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -386,15 +386,6 @@ } /** - * @throws NullPointerException {@inheritDoc} - * @since 1.5 - */ - public boolean isAnnotationPresent( - Class annotationClass) { - return getPackageInfo().isAnnotationPresent(annotationClass); - } - - /** * @throws NullPointerException {@inheritDoc} * @since 1.8 */ --- old/src/share/classes/java/lang/reflect/AccessibleObject.java 2013-02-01 13:27:22.000000000 -0800 +++ new/src/share/classes/java/lang/reflect/AccessibleObject.java 2013-02-01 13:27:21.000000000 -0800 @@ -182,14 +182,6 @@ /** * @throws NullPointerException {@inheritDoc} - * @since 1.5 - */ - public boolean isAnnotationPresent(Class annotationClass) { - return getAnnotation(annotationClass) != null; - } - - /** - * @throws NullPointerException {@inheritDoc} * @since 1.8 */ public T[] getAnnotations(Class annotationClass) { --- 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 --- 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 annotationClass) { - return getAnnotation(annotationClass) != null; - } - private transient Map, Annotation> declaredAnnotations; private synchronized Map, Annotation> declaredAnnotations() { --- old/src/share/classes/java/util/HashSet.java 2013-02-01 13:27:23.000000000 -0800 +++ new/src/share/classes/java/util/HashSet.java 2013-02-01 13:27:23.000000000 -0800 @@ -307,7 +307,7 @@ // Read in all elements in the proper order. for (int i=0; i annotation) { - return annotations.get(annotation) != null; - } - - @Override public final Annotation[] getAnnotations() { return getDeclaredAnnotations(); } --- old/src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java 2013-02-01 13:27:24.000000000 -0800 +++ new/src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java 2013-02-01 13:27:24.000000000 -0800 @@ -188,11 +188,6 @@ } // Implementations of AnnotatedElement methods. - public boolean isAnnotationPresent(Class annotationClass) { - Objects.requireNonNull(annotationClass); - return false; - } - @SuppressWarnings("unchecked") public T getAnnotation(Class annotationClass) { Objects.requireNonNull(annotationClass);