MCPcopy Index your code
hub / github.com/apache/groovy / getInstance

Method getInstance

src/main/java/groovy/grape/Grape.java:148–160  ·  view source on GitHub ↗

Returns the shared grape engine instance. @return the shared engine, or null if grapes are unavailable

()

Source from the content-addressed store, hash-verified

146 * @return the shared engine, or {@code null} if grapes are unavailable
147 */
148 public static synchronized GrapeEngine getInstance() {
149 if (instance == null) {
150 String configuredImpl = System.getProperty(GRAPE_IMPL_SYSTEM_PROPERTY);
151 ServiceLoader.Provider<GrapeEngine> provider = findProvider(configuredImpl);
152 if (provider != null) {
153 instance = createEngineFromProvider(provider);
154 }
155 if (instance == null) {
156 LOGGER.log(WARNING, "Grapes disabled");
157 }
158 }
159 return instance;
160 }
161
162 private static ServiceLoader.Provider<GrapeEngine> findProvider(final String configuredImpl) {
163 List<ServiceLoader.Provider<GrapeEngine>> providers;

Callers 5

grabMethod · 0.95
enumerateGrapesMethod · 0.95
resolveMethod · 0.95
listDependenciesMethod · 0.95
addResolverMethod · 0.95

Calls 4

findProviderMethod · 0.95
getPropertyMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected