This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: Method.toString() extra whitespace
- From: Bryce McKinlay <bryce at mckinlay dot net dot nz>
- To: GCC libjava patches <java-patches at gcc dot gnu dot org>
- Date: Sat, 25 Oct 2003 19:54:03 +1300
- Subject: FYI: Patch: Method.toString() extra whitespace
Method.toString() inserted an extra " " when printing a package-private
method. This patch fixes it.
Bryce.
2003-10-25 Bryce McKinlay <bryce@mckinlay.net.nz>
* java/lang/reflect/Method.java (toString): Avoid extra whitespace
on method with no modifiers.
--- java/lang/reflect/Method.java 5 Aug 2003 19:50:54 -0000
1.13
+++ java/lang/reflect/Method.java 25 Oct 2003 06:50:21 -0000
@@ -163,8 +163,12 @@
getType ();
StringBuffer b = new StringBuffer ();
- Modifier.toString(getModifiers(), b);
- b.append(" ");
+ int mods = getModifiers();
+ if (mods != 0)
+ {
+ Modifier.toString(mods, b);
+ b.append(" ");
+ }
appendClassName (b, return_type);
b.append(" ");
appendClassName (b, declaringClass);