diff options
author | Mark Wielaard <mark@klomp.org> | 2006-01-13 13:25:56 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2006-01-13 13:25:56 +0000 |
commit | 94c08abc9ed0b63519e123a46161f6a7d7e8cb5b (patch) | |
tree | cd920580cf518186fac7eb2c398a00e32020419b /java | |
parent | f1d78899f535230bad6d05ba8ef4761495b1349e (diff) | |
download | classpath-94c08abc9ed0b63519e123a46161f6a7d7e8cb5b.tar.gz |
* java/lang/reflect/Modifier.java (toString(int, StringBuffer)):generics-0_20-release
Duplicate of toString(int, StringBuilder).
Diffstat (limited to 'java')
-rw-r--r-- | java/lang/reflect/Modifier.java | 44 |
1 files changed, 43 insertions, 1 deletions
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 "); |