MCPcopy Index your code
hub / github.com/antlr/codebuff / getJLA

Method getJLA

output/java_guava/1.4.17/Throwables.java:434–454  ·  view source on GitHub ↗

Returns the JavaLangAccess class that is present in all Sun JDKs. It is not whitelisted for AppEngine, and not present in non-Sun JDKs.

()

Source from the content-addressed store, hash-verified

432 */
433
434 @GwtIncompatible // java.lang.reflect
435 @Nullable
436 private static Object getJLA() {
437 try {
438 /*
439 * We load sun.misc.* classes using reflection since Android doesn't support these classes and
440 * would result in compilation failure if we directly refer to these classes.
441 */
442 Class<?> sharedSecrets = Class.forName(SHARED_SECRETS_CLASSNAME, false, null);
443 Method langAccess = sharedSecrets.getMethod("getJavaLangAccess");
444 return langAccess.invoke(null);
445 } catch (ThreadDeath death) {
446 throw death;
447 } catch (Throwable t) {
448 /*
449 * This is not one of AppEngine's whitelisted classes, so even in Sun JDKs, this can fail with
450 * a NoClassDefFoundError. Other apps might deny access to sun.misc packages.
451 */
452 return null;
453 }
454 }
455
456 /**
457 * Returns the Method that can be used to resolve an individual StackTraceElement, or null if that

Callers 1

ThrowablesClass · 0.95

Calls 1

invokeMethod · 0.45

Tested by

no test coverage detected