Patch: the sad story of Method.toString
Tom Tromey
tromey@cygnus.com
Wed Sep 6 14:47:00 GMT 2000
I found yet another Method.toString bug today. Sigh. This one
revealed by Mauve testing. This also includes a parallel(-ish) fix to
Constructor.toString.
2000-09-06 Tom Tromey <tromey@cygnus.com>
* java/lang/reflect/Constructor.java (toString): Use `getName' for
parameter types.
* java/lang/reflect/Method.java (toString): Use `getName' for
return type.
Tom
Index: java/lang/reflect/Constructor.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/reflect/Constructor.java,v
retrieving revision 1.4
diff -u -r1.4 Constructor.java
--- Constructor.java 2000/03/07 19:55:27 1.4
+++ Constructor.java 2000/09/06 21:39:44
@@ -1,6 +1,6 @@
// Constructor.java - Represents a constructor for a class.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
@@ -79,7 +79,7 @@
b.append("(");
for (int i = 0; i < parameter_types.length; ++i)
{
- b.append(parameter_types[i].toString());
+ b.append(parameter_types[i].getName());
if (i < parameter_types.length - 1)
b.append(",");
}
Index: java/lang/reflect/Method.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/reflect/Method.java,v
retrieving revision 1.9
diff -u -r1.9 Method.java
--- Method.java 2000/08/08 03:34:51 1.9
+++ Method.java 2000/09/06 21:39:44
@@ -80,7 +80,7 @@
StringBuffer b = new StringBuffer ();
Modifier.toString(getModifiers(), b);
b.append(" ");
- b.append(return_type.toString());
+ b.append(return_type.getName());
b.append(" ");
b.append(declaringClass.getName());
b.append(".");
More information about the Java-patches
mailing list