summaryrefslogtreecommitdiffstats
path: root/libart
diff options
context:
space:
mode:
Diffstat (limited to 'libart')
-rw-r--r--libart/src/main/java/java/lang/reflect/Field.java11
-rw-r--r--libart/src/main/java/java/lang/reflect/Method.java3
2 files changed, 9 insertions, 5 deletions
diff --git a/libart/src/main/java/java/lang/reflect/Field.java b/libart/src/main/java/java/lang/reflect/Field.java
index 11e8a6e..cad876b 100644
--- a/libart/src/main/java/java/lang/reflect/Field.java
+++ b/libart/src/main/java/java/lang/reflect/Field.java
@@ -182,10 +182,12 @@ public final class Field extends AccessibleObject implements Member {
*/
public String toGenericString() {
StringBuilder sb = new StringBuilder(80);
+ // Limit modifier bits to the ones that toStringGeneric should return for fields.
+
+ String modifiers = Modifier.getDeclarationFieldModifiers(getModifiers());
// append modifiers if any
- int modifier = getModifiers();
- if (modifier != 0) {
- sb.append(Modifier.toString(modifier)).append(' ');
+ if (!modifiers.isEmpty()) {
+ sb.append(modifiers).append(' ');
}
// append generic type
Types.appendGenericType(sb, getGenericType());
@@ -861,7 +863,8 @@ public final class Field extends AccessibleObject implements Member {
*/
@Override
public String toString() {
- StringBuilder result = new StringBuilder(Modifier.toString(getModifiers()));
+ StringBuilder result = new StringBuilder(
+ Modifier.getDeclarationFieldModifiers(getModifiers()));
if (result.length() != 0) {
result.append(' ');
}
diff --git a/libart/src/main/java/java/lang/reflect/Method.java b/libart/src/main/java/java/lang/reflect/Method.java
index 058fb96..f0e4f5c 100644
--- a/libart/src/main/java/java/lang/reflect/Method.java
+++ b/libart/src/main/java/java/lang/reflect/Method.java
@@ -398,7 +398,8 @@ public final class Method extends AbstractMethod implements GenericDeclaration,
*/
@Override
public String toString() {
- StringBuilder result = new StringBuilder(Modifier.toString(getModifiers()));
+ StringBuilder result = new StringBuilder(
+ Modifier.getDeclarationMethodModifiers(getModifiers()));
if (result.length() != 0) {
result.append(' ');