MCPcopy Create free account
hub / github.com/antlr/codebuff / isAppEngine

Method isAppEngine

output/java_guava/1.4.16/MoreExecutors.java:760–781  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

758 }
759
760 @GwtIncompatible // TODO
761 private static boolean isAppEngine() {
762 if (System.getProperty("com.google.appengine.runtime.environment") == null) {
763 return false;
764 }
765 try {
766 // If the current environment is null, we're not inside AppEngine.
767 return Class.forName("com.google.apphosting.api.ApiProxy").getMethod("getCurrentEnvironment").invoke(null) != null;
768 } catch (ClassNotFoundException e) {
769 // If ApiProxy doesn't exist, we're not on AppEngine at all.
770 return false;
771 } catch (InvocationTargetException e) {
772 // If ApiProxy throws an exception, we're not in a proper AppEngine environment.
773 return false;
774 } catch (IllegalAccessException e) {
775 // If the method isn't accessible, we're not on a supported version of AppEngine;
776 return false;
777 } catch (NoSuchMethodException e) {
778 // If the method doesn't exist, we're not on a supported version of AppEngine;
779 return false;
780 }
781 }
782
783 /**
784 * Creates a thread using {@link #platformThreadFactory}, and sets its name to {@code name} unless

Callers 2

platformThreadFactoryMethod · 0.95
renamingDecoratorMethod · 0.95

Calls 2

getPropertyMethod · 0.65
invokeMethod · 0.45

Tested by

no test coverage detected