publicclass Main { publicstaticvoid main(String[] args) { try { // Check if we're running dalvik or RI. Class<?> class_loader_class = Class.forName("dalvik.system.PathClassLoader");
System.loadLibrary(args[0]);
} catch (ClassNotFoundException e) {
usingRI = true; // Add expected JNI_OnLoad log line to match expected-stdout.txt.
System.out.println("JNI_OnLoad called");
} try { // Initialize all classes needed for old java.lang.Void.TYPE initialization.
Runnable.class.getMethod("run", EmptyArray.CLASS).getReturnType();
} catch (Exception e) { thrownew Error(e);
} // Clear the resolved types of the ojluni dex file to make sure there is no entry // for "V", i.e. void.
clearResolvedTypes(Integer.class); // With java.lang.Void being compile-time verified but uninitialized, initialize // it now. Previously, this would indirectly initialize TYPE with the current, // i.e. zero-initialized, value of TYPE. The only thing that could prevent the // series of calls leading to this was a cache hit in Class.getDexCacheType() // which we have prevented by clearing the cache above. Class<?> voidClass = void.class;
System.out.println("void.class = " + voidClass);
}
publicstaticvoid clearResolvedTypes(Class<?> c) { if (!usingRI) {
nativeClearResolvedTypes(c);
}
}
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.