publicvoid runTest() throws Exception { Class<?> proxyClass = Proxy.getProxyClass(
getClass().getClassLoader(), newClass<?>[] { Runnable.class }
);
Constructor<?> constructor = proxyClass.getConstructor(InvocationHandler.class);
System.out.println("Found constructor."); // We used to crash when asking the exception types of the constructor, because the runtime was // not using the non-proxy ArtMethod
Object[] exceptions = constructor.getExceptionTypes();
System.out.println("Found constructors with " + exceptions.length + " exceptions");
}
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.