This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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>&lt;public|private|protected&gt; abstract static final transient
-   * volatile native synchronized interface strictfp</code>.
+   * <code>&lt;public|protected|private&gt; 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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]