diff options
Diffstat (limited to 'libjava/classpath/java/lang/reflect')
6 files changed, 14 insertions, 22 deletions
diff --git a/libjava/classpath/java/lang/reflect/AccessibleObject.java b/libjava/classpath/java/lang/reflect/AccessibleObject.java index 8f09eac1b0b..fd46a53dc8c 100644 --- a/libjava/classpath/java/lang/reflect/AccessibleObject.java +++ b/libjava/classpath/java/lang/reflect/AccessibleObject.java @@ -160,8 +160,7 @@ public class AccessibleObject this.flag = flag; } - /* FIXME[GENERICS]: <T extends Annotation> T getAnnotation(Class <T>) */ - public Annotation getAnnotation(Class annotationClass) + public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { throw new AssertionError("Subclass must override this method"); } @@ -176,8 +175,7 @@ public class AccessibleObject throw new AssertionError("Subclass must override this method"); } - /* FIXME[GENERICS]: Signature is Class<? extends Annotation> */ - public boolean isAnnotationPresent(Class annotationClass) + public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) { return getAnnotation(annotationClass) != null; } diff --git a/libjava/classpath/java/lang/reflect/AnnotatedElement.java b/libjava/classpath/java/lang/reflect/AnnotatedElement.java index 69a64a02827..8f2a8b6f5c8 100644 --- a/libjava/classpath/java/lang/reflect/AnnotatedElement.java +++ b/libjava/classpath/java/lang/reflect/AnnotatedElement.java @@ -74,8 +74,7 @@ public interface AnnotatedElement * <code>null</code> if no such annotation exists. * @throws NullPointerException if the annotation class is <code>null</code>. */ - /* FIXME[GENERICS]: <T extends Annotation> T getAnnotation(Class <T>) */ - Annotation getAnnotation(Class annotationClass); + <T extends Annotation> T getAnnotation(Class<T> annotationClass); /** * Returns all annotations associated with the element. If there are @@ -111,7 +110,6 @@ public interface AnnotatedElement * @return true if an annotation exists for the specified type. * @since 1.5 */ - /* FIXME[GENERICS]: Signature is Class<? extends Annotation> */ - boolean isAnnotationPresent(Class annotationClass); + boolean isAnnotationPresent(Class<? extends Annotation> annotationClass); } diff --git a/libjava/classpath/java/lang/reflect/Array.java b/libjava/classpath/java/lang/reflect/Array.java index ae65ffbf240..373bf204c8e 100644 --- a/libjava/classpath/java/lang/reflect/Array.java +++ b/libjava/classpath/java/lang/reflect/Array.java @@ -95,7 +95,7 @@ public final class Array * @throws NegativeArraySizeException when length is less than 0 * @throws OutOfMemoryError if memory allocation fails */ - public static Object newInstance(Class componentType, int length) + public static Object newInstance(Class<?> componentType, int length) { if (! componentType.isPrimitive()) return VMArray.createObjectArray(componentType, length); @@ -143,7 +143,7 @@ public final class Array * than 0 * @throws OutOfMemoryError if memory allocation fails */ - public static Object newInstance(Class componentType, int[] dimensions) + public static Object newInstance(Class<?> componentType, int[] dimensions) { if (dimensions.length <= 0) throw new IllegalArgumentException ("Empty dimensions array."); diff --git a/libjava/classpath/java/lang/reflect/GenericDeclaration.java b/libjava/classpath/java/lang/reflect/GenericDeclaration.java index 14f5ba8326b..244befd8810 100644 --- a/libjava/classpath/java/lang/reflect/GenericDeclaration.java +++ b/libjava/classpath/java/lang/reflect/GenericDeclaration.java @@ -58,6 +58,5 @@ public interface GenericDeclaration * class file does not conform to that specified in the 3rd edition * of the Java Virtual Machine Specification. */ - /* FIXME[GENERICS]: Should be TypeVariable<?>[] */ - TypeVariable[] getTypeParameters(); + TypeVariable<?>[] getTypeParameters(); } diff --git a/libjava/classpath/java/lang/reflect/Proxy.java b/libjava/classpath/java/lang/reflect/Proxy.java index 94aa0bbb2a0..ef743f6bcb0 100644 --- a/libjava/classpath/java/lang/reflect/Proxy.java +++ b/libjava/classpath/java/lang/reflect/Proxy.java @@ -156,7 +156,7 @@ import java.util.Set; * @see Class * @author Eric Blake (ebb9@email.byu.edu) * @since 1.3 - * @status updated to 1.4, except for the use of ProtectionDomain + * @status updated to 1.5, except for the use of ProtectionDomain */ public class Proxy implements Serializable { @@ -255,8 +255,8 @@ public class Proxy implements Serializable */ // synchronized so that we aren't trying to build the same class // simultaneously in two threads - public static synchronized Class getProxyClass(ClassLoader loader, - Class[] interfaces) + public static synchronized Class<?> getProxyClass(ClassLoader loader, + Class<?>... interfaces) { interfaces = (Class[]) interfaces.clone(); ProxyType pt = new ProxyType(loader, interfaces); @@ -310,7 +310,7 @@ public class Proxy implements Serializable * @see Constructor#newInstance(Object[]) */ public static Object newProxyInstance(ClassLoader loader, - Class[] interfaces, + Class<?>[] interfaces, InvocationHandler handler) { try @@ -358,7 +358,7 @@ public class Proxy implements Serializable */ // This is synchronized on the off chance that another thread is // trying to add a class to the map at the same time we read it. - public static synchronized boolean isProxyClass(Class clazz) + public static synchronized boolean isProxyClass(Class<?> clazz) { if (! Proxy.class.isAssignableFrom(clazz)) return false; diff --git a/libjava/classpath/java/lang/reflect/TypeVariable.java b/libjava/classpath/java/lang/reflect/TypeVariable.java index 4ecc20c9d9e..ec6af69db4f 100644 --- a/libjava/classpath/java/lang/reflect/TypeVariable.java +++ b/libjava/classpath/java/lang/reflect/TypeVariable.java @@ -58,9 +58,7 @@ package java.lang.reflect; * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ -/* FIXME[GENERICS]: Should be TypeVariable<T extends GenericDeclaration> */ -public interface TypeVariable - extends Type +public interface TypeVariable<T extends GenericDeclaration> extends Type { /** @@ -86,8 +84,7 @@ public interface TypeVariable * @return the <code>GenericDeclaration</code> object for this type * variable. */ - /* FIXME[GENERICS]: Should return type T */ - GenericDeclaration getGenericDeclaration(); + T getGenericDeclaration(); /** * Returns the name of the type variable, as written in the source |