small additional patch for Constructor.java

Aaron Place beavis at ihug.co.nz
Tue Feb 9 16:09:24 PST 1999


These are a couple of patches to fix the things that i missed the first
time.

Basically, Class.getPrettyName() should be used when the class could be
an array type and Class.getName() should be used when it is a plain
name.

BTW, Class.getPrettyName() is not mentioned in the jdk docs. Perhaps it
could be put into Kaffe.lang.Class as a static method i.e.
static java.lang.String getPrettyName(java.lang.Class)

Aaron.

-------------- next part --------------
--- libraries/javalib/java/lang/reflect/Constructor.java.orig	Wed Feb 10 12:28:10 1999
+++ libraries/javalib/java/lang/reflect/Constructor.java	Wed Feb 10 12:28:54 1999
@@ -106,7 +106,7 @@
 
 	// Signature
 	for (int i = 0; i < parameterTypes.length; i++) {
-		str.append(parameterTypes[i].getName());
+		str.append(parameterTypes[i].getPrettyName());
 		if (i+1 < parameterTypes.length) {
 			str.append(",");
 		}
-------------- next part --------------
--- libraries/javalib/java/lang/reflect/Method.java.orig	Wed Feb 10 12:32:11 1999
+++ libraries/javalib/java/lang/reflect/Method.java	Wed Feb 10 12:33:01 1999
@@ -126,7 +126,7 @@
 	str.append(" ");
 
 	// Class name
-	str.append(clazz.getPrettyName());
+	str.append(clazz.getName());
 	str.append(".");
 
 	// Method name
@@ -145,7 +145,7 @@
         if (exceptionTypes.length > 0) {
                 str.append(" throws ");
                 for (int i = 0; i < exceptionTypes.length; i++) {
-                        str.append(exceptionTypes[i].getPrettyName());
+                        str.append(exceptionTypes[i].getName());
                         if (i+1 < exceptionTypes.length) {
                                 str.append(",");
                         }


More information about the kaffe mailing list