diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | java/lang/reflect/Modifier.java | 44 |
2 files changed, 48 insertions, 1 deletions
@@ -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 "); |