MCPcopy Create free account
hub / github.com/google/guice / create

Method create

core/src/com/google/inject/internal/ProxyFactory.java:142–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140 }
141
142 @Override
143 public ConstructionProxy<T> create() throws ErrorsException {
144 if (interceptors.isEmpty()) {
145 return new DefaultConstructionProxyFactory<T>(injectionPoint).create();
146 }
147
148 // Create the proxied class. We're careful to ensure that interceptor state is not-specific
149 // to this injector. Otherwise, the proxies for each injector will waste PermGen memory
150 try {
151 return new ProxyConstructor<>(injectionPoint, enhancer, interceptors, callbacks);
152 } catch (Throwable e) {
153 throw new Errors()
154 .errorEnhancingClass(injectionPoint.getMember().getDeclaringClass(), e)
155 .toException();
156 }
157 }
158
159 /** Constructs instances that participate in AOP. */
160 private static class ProxyConstructor<T> implements ConstructionProxy<T> {

Callers 4

testSimpleCaseMethod · 0.95
testNotProxiedMethod · 0.95

Calls 5

toExceptionMethod · 0.80
errorEnhancingClassMethod · 0.80
getMemberMethod · 0.80
createMethod · 0.65
isEmptyMethod · 0.45

Tested by 4

testSimpleCaseMethod · 0.76
testNotProxiedMethod · 0.76