--- old/src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java 2011-09-01 22:05:43.000000000 -0700 +++ new/src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java 2011-09-01 22:05:42.000000000 -0700 @@ -25,9 +25,11 @@ package sun.reflect.generics.reflectiveObjects; +import java.lang.annotation.Annotation; import java.lang.reflect.GenericDeclaration; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; +import java.util.Objects; import sun.reflect.generics.factory.GenericsFactory; import sun.reflect.generics.tree.FieldTypeSignature; @@ -178,4 +180,27 @@ public int hashCode() { return genericDeclaration.hashCode() ^ name.hashCode(); } + + // Currently vacuous implementations of AnnotatedElement methods. + public boolean isAnnotationPresent(Class annotationClass) { + Objects.requireNonNull(annotationClass); + return false; + } + + public T getAnnotation(Class annotationClass) { + Objects.requireNonNull(annotationClass); + return null; + } + + public Annotation[] getAnnotations() { + // Since zero-length, don't need defensive clone + return EMPTY_ANNOTATION_ARRAY; + } + + public Annotation[] getDeclaredAnnotations() { + // Since zero-length, don't need defensive clone + return EMPTY_ANNOTATION_ARRAY; + } + + private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0]; }