summaryrefslogtreecommitdiff
path: root/java/lang/reflect
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2006-12-10 20:25:39 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2006-12-10 20:25:39 +0000
commitda66af5951b18b6f5e8752cbbe11f5f842332a33 (patch)
treea28e126d1415e3689be6c7b2c2d061ae51194195 /java/lang/reflect
parentab90923ee693a17e2e0e37b6ba5a84794c9236de (diff)
downloadclasspath-da66af5951b18b6f5e8752cbbe11f5f842332a33.tar.gz
2006-12-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of generics-branch to HEAD (woohoo!)
Diffstat (limited to 'java/lang/reflect')
-rw-r--r--java/lang/reflect/AccessibleObject.java6
-rw-r--r--java/lang/reflect/AnnotatedElement.java6
-rw-r--r--java/lang/reflect/Array.java4
-rw-r--r--java/lang/reflect/GenericDeclaration.java3
-rw-r--r--java/lang/reflect/Proxy.java10
-rw-r--r--java/lang/reflect/TypeVariable.java7
6 files changed, 14 insertions, 22 deletions
diff --git a/java/lang/reflect/AccessibleObject.java b/java/lang/reflect/AccessibleObject.java
index 8f09eac1b..fd46a53dc 100644
--- a/java/lang/reflect/AccessibleObject.java
+++ b/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/java/lang/reflect/AnnotatedElement.java b/java/lang/reflect/AnnotatedElement.java
index 69a64a028..8f2a8b6f5 100644
--- a/java/lang/reflect/AnnotatedElement.java
+++ b/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/java/lang/reflect/Array.java b/java/lang/reflect/Array.java
index ae65ffbf2..373bf204c 100644
--- a/java/lang/reflect/Array.java
+++ b/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/java/lang/reflect/GenericDeclaration.java b/java/lang/reflect/GenericDeclaration.java
index 14f5ba832..244befd88 100644
--- a/java/lang/reflect/GenericDeclaration.java
+++ b/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/java/lang/reflect/Proxy.java b/java/lang/reflect/Proxy.java
index 94aa0bbb2..ef743f6bc 100644
--- a/java/lang/reflect/Proxy.java
+++ b/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/java/lang/reflect/TypeVariable.java b/java/lang/reflect/TypeVariable.java
index 4ecc20c9d..ec6af69db 100644
--- a/java/lang/reflect/TypeVariable.java
+++ b/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