910-methods: don't print modifiers by default
Tool chain differences mean that sometimes we have static synthetic
method that is also marked as a bridge method and other times it
isn't.
Fix: 215524097
Test: atest CtsJvmtiRunTest910HostTestCases
Test: art/test/run-test --host 910
Change-Id: Ib8fddb514565b55e7fe9d0f611998ef7ef755530
diff --git a/test/910-methods/expected-stdout.txt b/test/910-methods/expected-stdout.txt
index 6672dc0..0c932be 100644
--- a/test/910-methods/expected-stdout.txt
+++ b/test/910-methods/expected-stdout.txt
@@ -49,7 +49,6 @@
Is obsolete: false
Is synthetic: false
class art.Test910$NestedSynthetic
-4104
Max locals: 1
Argument size: 0
Location start: 0
diff --git a/test/910-methods/src/art/Test910.java b/test/910-methods/src/art/Test910.java
index 4338448..5d54a45 100644
--- a/test/910-methods/src/art/Test910.java
+++ b/test/910-methods/src/art/Test910.java
@@ -35,6 +35,9 @@
// Find a synthetic method in the placeholder inner class. Do not print the name. Javac and Jack
// disagree on the naming of synthetic accessors.
+ //
+ // Also don't print modifiers as synthetic methods may (or may not) be marked as bridged
+ // methods depending on Java source level (b/215524097).
testMethod(findSyntheticMethod(), NestedSynthetic.class, false);
}
@@ -50,12 +53,12 @@
testMethod(m, base, true);
}
- private static void testMethod(Method m, Class<?> base, boolean printName) {
+ private static void testMethod(Method m, Class<?> base, boolean printAll) {
String[] result = getMethodName(m);
if (!result[0].equals(m.getName())) {
throw new RuntimeException("Name not equal: " + m.getName() + " vs " + result[0]);
}
- if (printName) {
+ if (printAll) {
System.out.println(Arrays.toString(result));
}
@@ -69,7 +72,9 @@
if (modifiers != m.getModifiers()) {
throw new RuntimeException("Modifiers not equal: " + m.getModifiers() + " vs " + modifiers);
}
- System.out.println(modifiers);
+ if (printAll) {
+ System.out.println(modifiers);
+ }
System.out.print("Max locals: ");
try {