summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-01-13 13:25:56 +0000
committerMark Wielaard <mark@klomp.org>2006-01-13 13:25:56 +0000
commit94c08abc9ed0b63519e123a46161f6a7d7e8cb5b (patch)
treecd920580cf518186fac7eb2c398a00e32020419b
parentf1d78899f535230bad6d05ba8ef4761495b1349e (diff)
downloadclasspath-94c08abc9ed0b63519e123a46161f6a7d7e8cb5b.tar.gz
* java/lang/reflect/Modifier.java (toString(int, StringBuffer)):generics-0_20-release
Duplicate of toString(int, StringBuilder).
-rw-r--r--ChangeLog5
-rw-r--r--java/lang/reflect/Modifier.java44
2 files changed, 48 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d901febd..c1fcbb6c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-01-13 Mark Wielaard <mark@klomp.org>
+ * java/lang/reflect/Modifier.java (toString(int, StringBuffer)):
+ Duplicate of toString(int, StringBuilder).
+
+2005-01-13 Mark Wielaard <mark@klomp.org>
+
* configure.ac: Set version to 0.20.
* NEWS: Add entries for all the new work done.
diff --git a/java/lang/reflect/Modifier.java b/java/lang/reflect/Modifier.java
index ff4d72e3d..aec488370 100644
--- a/java/lang/reflect/Modifier.java
+++ b/java/lang/reflect/Modifier.java
@@ -292,12 +292,54 @@ public class Modifier
}
/**
+ * Package helper method that can take a StringBuilder.
+ * @param mod the modifier
+ * @param r the StringBuilder to which the String representation is appended
+ * @return r, with information appended
+ */
+ static StringBuilder toString(int mod, StringBuilder r)
+ {
+ if (isPublic(mod))
+ r.append("public ");
+ if (isProtected(mod))
+ r.append("protected ");
+ if (isPrivate(mod))
+ r.append("private ");
+ if (isAbstract(mod))
+ r.append("abstract ");
+ if (isStatic(mod))
+ r.append("static ");
+ if (isFinal(mod))
+ r.append("final ");
+ if (isTransient(mod))
+ r.append("transient ");
+ if (isVolatile(mod))
+ r.append("volatile ");
+ if (isSynchronized(mod))
+ r.append("synchronized ");
+ 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)
+ r.setLength(r.length() - 1);
+ return r;
+ }
+
+ /**
* Package helper method that can take a StringBuffer.
+ * This is indeed a duplicate of the method that takes a StringBuilder
+ * since some runtimes override the given Method, Constructor and Field
+ * classes that and use a StringBuffer.
* @param mod the modifier
* @param r the StringBuffer to which the String representation is appended
* @return r, with information appended
*/
- static StringBuilder toString(int mod, StringBuilder r)
+ static StringBuffer toString(int mod, StringBuffer r)
{
if (isPublic(mod))
r.append("public ");