diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/vm/reference/java/lang/reflect/Constructor.java | |
parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
download | ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.zip |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/vm/reference/java/lang/reflect/Constructor.java')
-rw-r--r-- | libjava/classpath/vm/reference/java/lang/reflect/Constructor.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/libjava/classpath/vm/reference/java/lang/reflect/Constructor.java b/libjava/classpath/vm/reference/java/lang/reflect/Constructor.java index 521190b6656..eebee5f5d2a 100644 --- a/libjava/classpath/vm/reference/java/lang/reflect/Constructor.java +++ b/libjava/classpath/vm/reference/java/lang/reflect/Constructor.java @@ -77,11 +77,11 @@ import java.util.Arrays; * @since 1.1 * @status updated to 1.4 */ -public final class Constructor +public final class Constructor<T> extends AccessibleObject implements GenericDeclaration, Member { - private Class clazz; + private Class<T> clazz; private int slot; private static final int CONSTRUCTOR_MODIFIERS @@ -104,7 +104,7 @@ public final class Constructor * Gets the class that declared this constructor. * @return the class that declared this member */ - public Class getDeclaringClass() + public Class<T> getDeclaringClass() { return clazz; } @@ -166,7 +166,7 @@ public final class Constructor * * @return a list of the types of the constructor's parameters */ - public native Class[] getParameterTypes(); + public native Class<?>[] getParameterTypes(); /** * Get the exception types this constructor says it throws, in no particular @@ -175,7 +175,7 @@ public final class Constructor * * @return a list of the types in the constructor's throws clause */ - public native Class[] getExceptionTypes(); + public native Class<?>[] getExceptionTypes(); /** * Compare two objects to see if they are semantically equivalent. @@ -244,8 +244,8 @@ public final class Constructor return sb.toString(); } - /* FIXME[GENERICS]: Add X extends GenericDeclaration and TypeVariable<X> */ - static void addTypeParameters(StringBuilder sb, TypeVariable[] typeArgs) + static <X extends GenericDeclaration> + void addTypeParameters(StringBuilder sb, TypeVariable<X>[] typeArgs) { if (typeArgs.length == 0) return; @@ -313,15 +313,15 @@ public final class Constructor * @throws ExceptionInInitializerError if construction triggered class * initialization, which then failed */ - public Object newInstance(Object args[]) + public T newInstance(Object... args) throws InstantiationException, IllegalAccessException, InvocationTargetException { return constructNative(args, clazz, slot); } - private native Object constructNative(Object[] args, Class declaringClass, - int slot) + private native T constructNative(Object[] args, Class declaringClass, + int slot) throws InstantiationException, IllegalAccessException, InvocationTargetException; @@ -337,8 +337,7 @@ public final class Constructor * specification, version 3. * @since 1.5 */ - /* FIXME[GENERICS]: Add <Constructor<T>> */ - public TypeVariable[] getTypeParameters() + public TypeVariable<Constructor<T>>[] getTypeParameters() { String sig = getSignature(); if (sig == null) @@ -395,4 +394,3 @@ public final class Constructor return p.getGenericParameterTypes(); } } - |