summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorAaron M. Renn <arenn@urbanophile.com>1998-12-25 03:49:12 +0000
committerAaron M. Renn <arenn@urbanophile.com>1998-12-25 03:49:12 +0000
commit261ac5df23d9ba967a638cf1ee6e0e6afdfe455c (patch)
tree58314dd64393f3ee332d559c3aa268379755152a /vm
parent7b0dd212f8ba68d8c7a3f0b433796590e7a141f3 (diff)
downloadclasspath-261ac5df23d9ba967a638cf1ee6e0e6afdfe455c.tar.gz
Added a private no arg constructor. Also renamed and added some variables
to make this class consistent with Japhar's existing native code.
Diffstat (limited to 'vm')
-rw-r--r--vm/reference/java/lang/reflect/Constructor.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/vm/reference/java/lang/reflect/Constructor.java b/vm/reference/java/lang/reflect/Constructor.java
index e9d0720d2..30600798d 100644
--- a/vm/reference/java/lang/reflect/Constructor.java
+++ b/vm/reference/java/lang/reflect/Constructor.java
@@ -89,15 +89,20 @@ package java.lang.reflect;
**/
public final class Constructor implements Member {
- private Class declaringClass;
+ private Class clazz;
private int slot;
+ private Class[] parameterTypes;
+ private Class[] exceptionTypes;
/* This class is uninstantiable except from native code. */
private Constructor(Class declaringClass,int slot) {
- this.declaringClass = declaringClass;
+ this.clazz = declaringClass;
this.slot = slot;
}
+ private Constructor() {
+ }
+
/** Gets the class that declared this constructor.
** @specnote It is unclear whether this returns the class that
** actually syntactically declared the member, or the
@@ -105,7 +110,7 @@ public final class Constructor implements Member {
** @return the class that declared this member.
**/
public Class getDeclaringClass() {
- return declaringClass;
+ return clazz;
}
/** Gets the modifiers this constructor uses. Use the <code>Modifier</code>
@@ -126,12 +131,20 @@ public final class Constructor implements Member {
/** Get the parameter list for this constructor.
** @return a list of classes representing the names of the constructor's parameters.
**/
- public native Class[] getParameterTypes();
+ public Class[] getParameterTypes() {
+ if (parameterTypes == null)
+ return(new Class[0]);
+ return(parameterTypes);
+ }
/** Get the exception types this constructor says it throws.
** @return a list of classes representing the exception types.
**/
- public native Class[] getExceptionTypes();
+ public Class[] getExceptionTypes() {
+ if (exceptionTypes == null)
+ return(new Class[0]);
+ return(exceptionTypes);
+ }
/** Compare two objects to see if they are semantically equivalent.
** Two Constructors are semantically equivalent if they have the same declaring class and the
@@ -192,7 +205,7 @@ public final class Constructor implements Member {
IllegalAccessException,
IllegalArgumentException,
InvocationTargetException {
- return constructNative(args, declaringClass, slot);
+ return constructNative(args, clazz, slot);
}
private native Object constructNative(Object[] args, Class declaringClass, int slot);