// 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);
}
privatestaticvoid testMethod(Method m, Class<?> base, boolean printAll) {
String[] result = getMethodName(m); if (!result[0].equals(m.getName())) { thrownew RuntimeException("Name not equal: " + m.getName() + " vs " + result[0]);
} if (printAll) {
System.out.println(Arrays.toString(result));
}
Class<?> declClass = getMethodDeclaringClass(m); if (base != declClass) { thrownew RuntimeException("Declaring class not equal: " + base + " vs " + declClass);
}
System.out.println(declClass);
int modifiers = getMethodModifiers(m); if (modifiers != m.getModifiers()) { thrownew RuntimeException( "Modifiers not equal: " + m.getModifiers() + " vs " + modifiers);
} if (printAll) {
System.out.println(modifiers);
}
// We need this machinery for a consistent proxy name. Names of proxy classes include a // unique number (derived by counting). This means that a simple call to getProxyClass // depends on the test environment. // // To work around this, we assume that at most twenty proxies have been created before // the test is run, and canonicalize on "$Proxy20". We add infrastructure to create // as many proxy classes but cycling through subsets of the test-provided interfaces // I0...I4. // // // (This is made under the judgment that we do not want to have proxy-specific behavior // for testMethod.)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.