This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Fix for Modifier toString() ordering
- From: Mark Wielaard <mark at klomp dot org>
- To: java-patches at gcc dot gnu dot org
- Date: 03 Apr 2002 23:32:16 +0200
- Subject: Fix for Modifier toString() ordering
Hi,
This fixes a test that I just added to Mauve for the ordering of the
Modifiers as described in the latest public spec.
2002-04-03 Mark Wielaard <mark@klomp.org>
* java/lang/reflect/Modifier.java (toString(int,StringBuffer)): Fix
ordering.
Cheers,
Mark
Index: libjava/java/lang/reflect/Modifier.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/reflect/Modifier.java,v
retrieving revision 1.9
diff -u -r1.9 Modifier.java
--- Modifier.java 2002/01/22 22:40:20 1.9
+++ Modifier.java 2002/04/03 21:27:06
@@ -280,8 +280,8 @@
/**
* Get a string representation of all the modifiers represented by the
* given int. The keywords are printed in this order:
- * <code><public|private|protected> abstract static final transient
- * volatile native synchronized interface strictfp</code>.
+ * <code><public|protected|private> abstract static final transient
+ * volatile synchronized native strictfp interface</code>.
*
* @param mod the modifier.
* @return the String representing the modifiers.
@@ -301,10 +301,10 @@
{
if (isPublic(mod))
r.append("public ");
- if (isPrivate(mod))
- r.append("private ");
if (isProtected(mod))
r.append("protected ");
+ if (isPrivate(mod))
+ r.append("private ");
if (isAbstract(mod))
r.append("abstract ");
if (isStatic(mod))
@@ -315,14 +315,14 @@
r.append("transient ");
if (isVolatile(mod))
r.append("volatile ");
- if (isNative(mod))
- r.append("native ");
if (isSynchronized(mod))
r.append("synchronized ");
- if (isInterface(mod))
- r.append("interface ");
+ if (isNative(mod))
+ r.append("native ");
if (isStrict(mod))
r.append("strictfp ");
+ if (isInterface(mod))
+ r.append("interface ");
// Trim trailing space.
if ((mod & ALL_FLAGS) != 0)