Permalink
Browse files

remove unnecessary explicit type parameters now that we are on java7

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145716288
  • Loading branch information...
lukesandberg authored and ronshapiro committed Jan 26, 2017
1 parent 4e0cdc3 commit dcf7bdacc232880b425c07171c49a75be5ddce93
Showing with 149 additions and 152 deletions.
  1. +1 −1 core/src/com/google/inject/internal/AbstractBindingBuilder.java
  2. +3 −3 core/src/com/google/inject/internal/BindingProcessor.java
  3. +2 −2 core/src/com/google/inject/internal/ConstructionContext.java
  4. +2 −2 core/src/com/google/inject/internal/ConstructorBindingImpl.java
  5. +2 −2 core/src/com/google/inject/internal/ConstructorInjectorStore.java
  6. +2 −2 core/src/com/google/inject/internal/DeferredLookups.java
  7. +1 −1 core/src/com/google/inject/internal/Errors.java
  8. +2 −2 core/src/com/google/inject/internal/InjectorImpl.java
  9. +1 −1 core/src/com/google/inject/internal/InternalContext.java
  10. +1 −1 core/src/com/google/inject/internal/InternalInjectorCreator.java
  11. +1 −1 core/src/com/google/inject/internal/MembersInjectorStore.java
  12. +4 −4 core/src/com/google/inject/internal/RealMapBinder.java
  13. +2 −2 core/src/com/google/inject/internal/RealMultibinder.java
  14. +2 −2 core/src/com/google/inject/internal/RealOptionalBinder.java
  15. +1 −1 core/src/com/google/inject/internal/SingletonScope.java
  16. +2 −3 core/src/com/google/inject/internal/util/StackTraceElements.java
  17. +1 −1 core/src/com/google/inject/spi/Elements.java
  18. +4 −5 core/src/com/google/inject/spi/InjectionPoint.java
  19. +1 −1 core/src/com/google/inject/util/Modules.java
  20. +5 −5 core/test/com/google/inject/Asserts.java
  21. +1 −1 core/test/com/google/inject/BindingOrderTest.java
  22. +1 −1 core/test/com/google/inject/BindingTest.java
  23. +1 −1 core/test/com/google/inject/EagerSingletonTest.java
  24. +1 −1 core/test/com/google/inject/InjectorTest.java
  25. +2 −2 core/test/com/google/inject/KeyTest.java
  26. +4 −4 core/test/com/google/inject/MembersInjectorTest.java
  27. +1 −1 core/test/com/google/inject/MethodInterceptionTest.java
  28. +1 −1 core/test/com/google/inject/ProvisionListenerTest.java
  29. +4 −4 core/test/com/google/inject/ScopesTest.java
  30. +2 −3 core/test/com/google/inject/TypeListenerTest.java
  31. +4 −4 core/test/com/google/inject/internal/CycleDetectingLockTest.java
  32. +3 −3 core/test/com/google/inject/internal/MapBinderTest.java
  33. +2 −2 core/test/com/google/inject/internal/MultibinderTest.java
  34. +1 −1 core/test/com/google/inject/internal/OptionalBinderTest.java
  35. +1 −1 core/test/com/google/inject/internal/ProxyFactoryTest.java
  36. +5 −5 core/test/com/google/inject/internal/SpiUtils.java
  37. +25 −25 core/test/com/google/inject/internal/WeakKeySetTest.java
  38. +1 −1 core/test/com/google/inject/spi/ElementsTest.java
  39. +1 −1 core/test/com/google/inject/spi/ProviderMethodsTest.java
  40. +1 −1 core/test/com/google/inject/util/OverrideModuleTest.java
  41. +1 −1 examples/src/example/xml/XmlBeanModule.java
  42. +1 −1 extensions/assistedinject/src/com/google/inject/assistedinject/AssistedConstructor.java
  43. +1 −1 extensions/assistedinject/src/com/google/inject/assistedinject/FactoryModuleBuilder.java
  44. +1 −1 extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java
  45. +1 −1 extensions/assistedinject/src/com/google/inject/assistedinject/ParameterListKey.java
  46. +1 −1 extensions/assistedinject/test/com/google/inject/assistedinject/FactoryModuleBuilderTest.java
  47. +1 −1 extensions/grapher/test/com/google/inject/grapher/AbstractInjectorGrapherTest.java
  48. +6 −6 extensions/mini/src/com/google/inject/mini/MiniGuice.java
  49. +2 −2 extensions/mini/test/com/google/inject/mini/MiniGuiceTest.java
  50. +1 −1 extensions/persist/src/com/google/inject/persist/jpa/JpaLocalTxnInterceptor.java
  51. +1 −1 extensions/persist/src/com/google/inject/persist/jpa/JpaPersistService.java
  52. +1 −1 extensions/persist/test/com/google/inject/persist/jpa/EnsureJpaCanTakeObjectsInPropertiesTest.java
  53. +1 −1 extensions/persist/test/com/google/inject/persist/jpa/JpaParentTestEntity.java
  54. +1 −1 extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java
  55. +1 −1 extensions/servlet/src/com/google/inject/servlet/FiltersModuleBuilder.java
  56. +2 −2 extensions/servlet/src/com/google/inject/servlet/GuiceFilter.java
  57. +1 −1 extensions/servlet/src/com/google/inject/servlet/GuiceServletContextListener.java
  58. +1 −1 extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java
  59. +1 −1 extensions/servlet/src/com/google/inject/servlet/ServletScopes.java
  60. +1 −1 extensions/servlet/src/com/google/inject/servlet/ServletUtils.java
  61. +1 −1 extensions/servlet/src/com/google/inject/servlet/ServletsModuleBuilder.java
  62. +1 −1 extensions/servlet/test/com/google/inject/servlet/FilterDispatchIntegrationTest.java
  63. +1 −1 extensions/servlet/test/com/google/inject/servlet/ServletPipelineRequestDispatcherTest.java
  64. +2 −2 extensions/struts2/src/com/google/inject/struts2/GuiceObjectFactory.java
  65. +2 −2 extensions/struts2/src/com/google/inject/struts2/Struts2Factory.java
  66. +1 −1 extensions/testlib/test/com/google/inject/testing/fieldbinder/BoundFieldModuleTest.java
  67. +5 −5 extensions/throwingproviders/test/com/google/inject/throwingproviders/CheckedProviderTest.java
  68. +2 −2 extensions/throwingproviders/test/com/google/inject/throwingproviders/TestScope.java
  69. +5 −5 extensions/throwingproviders/test/com/google/inject/throwingproviders/ThrowingProviderTest.java
@@ -55,7 +55,7 @@ public AbstractBindingBuilder(Binder binder, List<Element> elements, Object sour
this.binder = binder;
this.elements = elements;
this.position = elements.size();
this.binding = new UntargettedBindingImpl<T>(source, key, Scoping.UNSCOPED);
this.binding = new UntargettedBindingImpl<>(source, key, Scoping.UNSCOPED);
elements.add(position, this.binding);
}
@@ -102,7 +102,7 @@ public Boolean visit(InstanceBinding<? extends T> binding) {
Initializable<T> ref =
initializer.requestInjection(
injector, instance, (Binding<T>) binding, source, injectionPoints);
ConstantFactory<? extends T> factory = new ConstantFactory<T>(ref);
ConstantFactory<? extends T> factory = new ConstantFactory<>(ref);
InternalFactory<? extends T> scopedFactory =
Scoping.scope(key, injector, factory, source, scoping);
putBinding(
@@ -175,7 +175,7 @@ public Boolean visit(LinkedKeyBinding<? extends T> binding) {
errors.recursiveBinding();
}
FactoryProxy<T> factory = new FactoryProxy<T>(injector, key, linkedKey, source);
FactoryProxy<T> factory = new FactoryProxy<>(injector, key, linkedKey, source);
bindingData.addCreationListener(factory);
InternalFactory<? extends T> scopedFactory =
Scoping.scope(key, injector, factory, source, scoping);
@@ -245,7 +245,7 @@ public Boolean visit(PrivateElements privateElements) {
}
private <T> void bindExposed(PrivateElements privateElements, Key<T> key) {
ExposedKeyFactory<T> exposedKeyFactory = new ExposedKeyFactory<T>(key, privateElements);
ExposedKeyFactory<T> exposedKeyFactory = new ExposedKeyFactory<>(key, privateElements);
bindingData.addCreationListener(exposedKeyFactory);
putBinding(
new ExposedBindingImpl<T>(
@@ -68,10 +68,10 @@ public Object createProxy(Errors errors, InjectorOptions injectorOptions, Class<
}
if (invocationHandlers == null) {
invocationHandlers = new ArrayList<DelegatingInvocationHandler<T>>();
invocationHandlers = new ArrayList<>();
}
DelegatingInvocationHandler<T> invocationHandler = new DelegatingInvocationHandler<T>();
DelegatingInvocationHandler<T> invocationHandler = new DelegatingInvocationHandler<>();
invocationHandlers.add(invocationHandler);
// TODO: if I create a proxy which implements all the interfaces of
@@ -66,7 +66,7 @@ public ConstructorBindingImpl(
InjectionPoint constructorInjectionPoint,
Set<InjectionPoint> injectionPoints) {
super(source, key, scoping);
this.factory = new Factory<T>(false, key);
this.factory = new Factory<>(false, key);
ConstructionProxy<T> constructionProxy =
new DefaultConstructionProxyFactory<T>(constructorInjectionPoint).create();
this.constructorInjectionPoint = constructorInjectionPoint;
@@ -134,7 +134,7 @@ public ConstructorBindingImpl(
errors.throwIfNewErrors(numErrors);
Factory<T> factoryFactory = new Factory<T>(failIfNotLinked, key);
Factory<T> factoryFactory = new Factory<>(failIfNotLinked, key);
InternalFactory<? extends T> scopedFactory =
Scoping.scope(key, injector, factoryFactory, source, scoping);
@@ -79,10 +79,10 @@ boolean remove(InjectionPoint ip) {
membersInjector.getAddedAspects().isEmpty()
? injectorAspects
: ImmutableList.copyOf(concat(injectorAspects, membersInjector.getAddedAspects()));
ConstructionProxyFactory<T> factory = new ProxyFactory<T>(injectionPoint, methodAspects);
ConstructionProxyFactory<T> factory = new ProxyFactory<>(injectionPoint, methodAspects);
/*end[AOP]*/
/*if[NO_AOP]
ConstructionProxyFactory<T> factory = new DefaultConstructionProxyFactory<T>(injectionPoint);
ConstructionProxyFactory<T> factory = new DefaultConstructionProxyFactory<>(injectionPoint);
end[NO_AOP]*/
errors.throwIfNewErrors(numErrorsBefore);
@@ -48,14 +48,14 @@ void initialize(Errors errors) {
@Override
public <T> Provider<T> getProvider(Key<T> key) {
ProviderLookup<T> lookup = new ProviderLookup<T>(key, key);
ProviderLookup<T> lookup = new ProviderLookup<>(key, key);
lookups.add(lookup);
return lookup.getProvider();
}
@Override
public <T> MembersInjector<T> getMembersInjector(TypeLiteral<T> type) {
MembersInjectorLookup<T> lookup = new MembersInjectorLookup<T>(type, type);
MembersInjectorLookup<T> lookup = new MembersInjectorLookup<>(type, type);
lookups.add(lookup);
return lookup.getMembersInjector();
}
@@ -197,7 +197,7 @@ public Errors missingImplementation(Key key) {
sb.append(format("No implementation for %s was bound.", key));
// Keys which have similar strings as the desired key
List<String> possibleMatches = new ArrayList<String>();
List<String> possibleMatches = new ArrayList<>();
// Check for other keys that may have the same type,
// but not the same annotation
@@ -136,7 +136,7 @@ public String toString() {
// No ThreadLocal.initialValue(), as that would cause classloader leaks. See
// https://github.com/google/guice/issues/288#issuecomment-48216933,
// https://github.com/google/guice/issues/288#issuecomment-48216944
localContext = new ThreadLocal<Object[]>();
localContext = new ThreadLocal<>();
}
}
@@ -805,7 +805,7 @@ private void removeFailedJitBinding(Binding<?> binding, InjectionPoint ip) {
// Look up the target binding.
final Key<? extends T> targetKey = Key.get(subclass);
Object source = rawType;
FactoryProxy<T> factory = new FactoryProxy<T>(this, key, targetKey, source);
FactoryProxy<T> factory = new FactoryProxy<>(this, key, targetKey, source);
factory.notify(errors); // causes the factory to initialize itself internally
return new LinkedBindingImpl<T>(
this,
@@ -61,7 +61,7 @@ InjectorOptions getInjectorOptions() {
ConstructionContext<T> constructionContext =
(ConstructionContext<T>) constructionContexts.get(key);
if (constructionContext == null) {
constructionContext = new ConstructionContext<T>();
constructionContext = new ConstructionContext<>();
constructionContexts.put(key, constructionContext);
}
return constructionContext;
@@ -191,7 +191,7 @@ private void injectDynamically() {
* while we're binding these singletons are not be eager.
*/
void loadEagerSingletons(InjectorImpl injector, Stage stage, final Errors errors) {
List<BindingImpl<?>> candidateBindings = new ArrayList<BindingImpl<?>>();
List<BindingImpl<?>> candidateBindings = new ArrayList<>();
@SuppressWarnings("unchecked") // casting Collection<Binding> to Collection<BindingImpl> is safe
Collection<BindingImpl<?>> bindingsAtThisLevel =
(Collection) injector.state.getExplicitBindingsThisLevel().values();
@@ -93,7 +93,7 @@ boolean remove(TypeLiteral<?> type) {
ImmutableList<SingleMemberInjector> injectors = getInjectors(injectionPoints, errors);
errors.throwIfNewErrors(numErrorsBefore);
EncounterImpl<T> encounter = new EncounterImpl<T>(errors, injector.lookups);
EncounterImpl<T> encounter = new EncounterImpl<>(errors, injector.lookups);
Set<TypeListener> alreadySeenListeners = Sets.newHashSet();
for (TypeListenerBinding binding : typeListenerBindings) {
TypeListener typeListener = binding.getListener();
@@ -257,7 +257,7 @@ private RealMapBinder(
TypeLiteral<V> valueType,
Key<Map<K, V>> mapKey,
RealMultibinder<Map.Entry<K, Provider<V>>> entrySetBinder) {
this.bindingSelection = new BindingSelection<K, V>(keyType, valueType, mapKey, entrySetBinder);
this.bindingSelection = new BindingSelection<>(keyType, valueType, mapKey, entrySetBinder);
this.binder = binder;
this.entrySetBinder = entrySetBinder;
}
@@ -309,7 +309,7 @@ public void configure(Binder binder) {
(Provider) providerMapProvider;
binder.bind(bindingSelection.getJavaxProviderMapKey()).toProvider(javaxProviderMapProvider);
RealMapProvider<K, V> mapProvider = new RealMapProvider<K, V>(bindingSelection);
RealMapProvider<K, V> mapProvider = new RealMapProvider<>(bindingSelection);
binder.bind(bindingSelection.getMapKey()).toProvider(mapProvider);
// The Map.Entries are all ProviderMapEntry instances which do not allow setValue, so it is
@@ -420,7 +420,7 @@ private boolean tryInitialize(InjectorImpl injector, Errors errors) {
// we have those, it's easy to iterate through them to organize them by K.
Map<K, ImmutableSet.Builder<Binding<V>>> bindingMultimapMutable =
new LinkedHashMap<K, ImmutableSet.Builder<Binding<V>>>();
Map<K, Binding<V>> bindingMapMutable = new LinkedHashMap<K, Binding<V>>();
Map<K, Binding<V>> bindingMapMutable = new LinkedHashMap<>();
Multimap<K, Indexer.IndexedBinding> index = HashMultimap.create();
Indexer indexer = new Indexer(injector);
Multimap<K, Binding<V>> duplicates = null;
@@ -1134,7 +1134,7 @@ protected void doInitialize(InjectorImpl injector, Errors errors) throws ErrorsE
(SingleParameterInjector<V>[])
injector.getParametersInjectors(dependenciesForKey, errors);
perKeyDatas[i] = new PerKeyData<K, V>(entry.getKey(), bindingsArray, injectors);
perKeyDatas[i] = new PerKeyData<>(entry.getKey(), bindingsArray, injectors);
i++;
}
@@ -53,7 +53,7 @@
/** Implementation of newSetBinder. */
public static <T> RealMultibinder<T> newRealSetBinder(Binder binder, Key<T> key) {
binder = binder.skipSources(RealMultibinder.class);
RealMultibinder<T> result = new RealMultibinder<T>(binder, key);
RealMultibinder<T> result = new RealMultibinder<>(binder, key);
binder.install(result);
return result;
}
@@ -86,7 +86,7 @@
RealMultibinder(Binder binder, Key<T> key) {
this.binder = checkNotNull(binder, "binder");
this.bindingSelection = new BindingSelection<T>(key);
this.bindingSelection = new BindingSelection<>(key);
}
@Override
@@ -59,7 +59,7 @@
public final class RealOptionalBinder<T> implements Module {
public static <T> RealOptionalBinder<T> newRealOptionalBinder(Binder binder, Key<T> type) {
binder = binder.skipSources(RealOptionalBinder.class);
RealOptionalBinder<T> optionalBinder = new RealOptionalBinder<T>(binder, type);
RealOptionalBinder<T> optionalBinder = new RealOptionalBinder<>(binder, type);
binder.install(optionalBinder);
return optionalBinder;
}
@@ -185,7 +185,7 @@ private static Object invokeJavaOptionalOf(Object o) {
private final Binder binder;
private RealOptionalBinder(Binder binder, Key<T> typeKey) {
this.bindingSelection = new BindingSelection<T>(typeKey);
this.bindingSelection = new BindingSelection<>(typeKey);
this.binder = binder;
}
@@ -101,7 +101,7 @@
* Circular proxies are used when potential deadlocks are detected. Guarded by itself.
* ConstructionContext is not thread-safe, so each call should be synchronized.
*/
final ConstructionContext<T> constructionContext = new ConstructionContext<T>();
final ConstructionContext<T> constructionContext = new ConstructionContext<>();
/** For each binding there is a separate lock that we hold during object creation. */
final CycleDetectingLock<Key<?>> creationLock = cycleDetectingLockFactory.create(key);
@@ -55,9 +55,8 @@ public LineNumbers load(Class<?> key) {
/*end[AOP]*/
private static final ConcurrentMap<InMemoryStackTraceElement, InMemoryStackTraceElement>
elementCache = new ConcurrentHashMap<InMemoryStackTraceElement, InMemoryStackTraceElement>();
private static final ConcurrentMap<String, String> stringCache =
new ConcurrentHashMap<String, String>();
elementCache = new ConcurrentHashMap<>();
private static final ConcurrentMap<String, String> stringCache = new ConcurrentHashMap<>();
private static final String UNKNOWN_SOURCE = "Unknown Source";
@@ -408,7 +408,7 @@ public AnnotatedConstantBindingBuilder bindConstant() {
@Override
public <T> Provider<T> getProvider(final Dependency<T> dependency) {
final ProviderLookup<T> element = new ProviderLookup<T>(getElementSource(), dependency);
final ProviderLookup<T> element = new ProviderLookup<>(getElementSource(), dependency);
elements.add(element);
return element.getProvider();
}
@@ -38,7 +38,6 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
@@ -566,14 +565,14 @@ boolean removeIfOverriddenBy(
if (bySignature == null) {
// We encountered a method in a subclass. Time to index the
// methods in the parent class.
bySignature = new HashMap<Signature, List<InjectableMethod>>();
bySignature = new HashMap<>();
for (InjectableMember member = injectableMembers.head;
member != null;
member = member.next) {
if (!(member instanceof InjectableMethod)) continue;
InjectableMethod im = (InjectableMethod) member;
if (im.isFinal()) continue;
List<InjectableMethod> methods = new ArrayList<InjectableMethod>();
List<InjectableMethod> methods = new ArrayList<>();
methods.add(im);
bySignature.put(new Signature(im.method), methods);
}
@@ -624,7 +623,7 @@ void add(InjectableMethod injectableMethod) {
: new Signature(injectableMethod.method);
List<InjectableMethod> methods = bySignature.get(signature);
if (methods == null) {
methods = new ArrayList<InjectableMethod>();
methods = new ArrayList<>();
bySignature.put(signature, methods);
}
methods.add(injectableMethod);
@@ -789,7 +788,7 @@ private static boolean isValidMethod(InjectableMethod injectableMethod, Errors e
}
private static List<TypeLiteral<?>> hierarchyFor(TypeLiteral<?> type) {
List<TypeLiteral<?>> hierarchy = new ArrayList<TypeLiteral<?>>();
List<TypeLiteral<?>> hierarchy = new ArrayList<>();
TypeLiteral<?> current = type;
while (current.getRawType() != Object.class) {
hierarchy.add(current);
@@ -190,7 +190,7 @@ public void configure() {
}
final Binder binder = baseBinder.skipSources(this.getClass());
final LinkedHashSet<Element> elements = new LinkedHashSet<Element>(baseElements);
final LinkedHashSet<Element> elements = new LinkedHashSet<>(baseElements);
final Module scannersModule = extractScanners(elements);
final List<Element> overrideElements =
Elements.getElements(
@@ -16,7 +16,6 @@
package com.google.inject;
import static com.google.inject.internal.InternalFlags.IncludeStackTraceOption;
import static com.google.inject.internal.InternalFlags.getIncludeStackTraceOption;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
@@ -28,6 +27,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.testing.GcFinalization;
import com.google.inject.internal.InternalFlags.IncludeStackTraceOption;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -172,8 +172,8 @@ public static void assertNotSerializable(Object object) throws IOException {
public static void awaitFullGc() {
// GcFinalization *should* do it, but doesn't work well in practice...
// so we put a second latch and wait for a ReferenceQueue to tell us.
ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
WeakReference ref = new WeakReference<Object>(new Object(), queue);
ReferenceQueue<Object> queue = new ReferenceQueue<>();
WeakReference<Object> ref = new WeakReference<>(new Object(), queue);
GcFinalization.awaitFullGc();
try {
assertSame("queue didn't return ref in time", ref, queue.remove(5000));
@@ -191,8 +191,8 @@ public static void awaitClear(WeakReference<?> ref) {
ReferenceQueue<Object> queue = null;
WeakReference extraRef = null;
if (data != null) {
queue = new ReferenceQueue<Object>();
extraRef = new WeakReference<Object>(data, queue);
queue = new ReferenceQueue<>();
extraRef = new WeakReference<>(data, queue);
data = null;
}
GcFinalization.awaitClear(ref);
@@ -61,7 +61,7 @@ protected void configure() {
public void testBindingWithExtraThreads() throws InterruptedException {
final CountDownLatch ready = new CountDownLatch(1);
final CountDownLatch done = new CountDownLatch(1);
final AtomicReference<B> ref = new AtomicReference<B>();
final AtomicReference<B> ref = new AtomicReference<>();
final Object createsAThread =
new Object() {
@@ -634,7 +634,7 @@ public void configure() {
}
}
private static List<Butter> butters = new ArrayList<Butter>();
private static List<Butter> butters = new ArrayList<>();
private static interface Sandwitch {};
@@ -86,7 +86,7 @@ protected void configure() {
public void testJustInTimeEagerSingletons_multipleThreads() throws Exception {
// in order to make the data race more likely we need a lot of jit bindings. The easiest thing
// is just to 'copy' out class for B a bunch of times.
final List<Class<?>> jitBindings = new ArrayList<Class<?>>();
final List<Class<?>> jitBindings = new ArrayList<>();
for (int i = 0; i < 1000; i++) {
jitBindings.add(copyClass(B.class));
}
@@ -424,7 +424,7 @@ public Chicken get() {
public void testJitBindingFromAnotherThreadDuringInjection() {
final ExecutorService executorService = Executors.newSingleThreadExecutor();
final AtomicReference<JustInTime> got = new AtomicReference<JustInTime>();
final AtomicReference<JustInTime> got = new AtomicReference<>();
Guice.createInjector(
new AbstractModule() {
@@ -332,7 +332,7 @@ protected void configure() {
binder().requestInjection(new TypeLiteral<Object>() {}, foo);
}
};
WeakReference<Module> moduleRef = new WeakReference<Module>(module);
WeakReference<Module> moduleRef = new WeakReference<>(module);
final Injector injector = Guice.createInjector(module);
module = null;
awaitClear(moduleRef); // Make sure anonymous keys & typeliterals don't hold the module.
@@ -345,7 +345,7 @@ public void run() {
injector.getInstance(Key.get(new TypeLiteral<Typed<Integer>>() {}));
}
};
WeakReference<Runnable> runnerRef = new WeakReference<Runnable>(runner);
WeakReference<Runnable> runnerRef = new WeakReference<>(runner);
runner.run();
runner = null;
awaitClear(runnerRef); // also make sure anonymous keys & typeliterals don't hold for JITs
Oops, something went wrong.

0 comments on commit dcf7bda

Please sign in to comment.