Permalink
Browse files

Remove empty overrides of AbstractModule.configure() from guice modules

In 41f307e this AbstractModule.configure() became non-abstract in the base class, so it is now allowed for subclasses to not override the method at all when they don’t need to access the binding dsl.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148043119
  • Loading branch information...
lukesandberg authored and ronshapiro committed Feb 20, 2017
1 parent 41f307e commit 4c2c276cdc17cdfc87e99d2ceef764aa00b8131f
@@ -58,8 +58,6 @@ public void testCircularlyDependentConstructorsWithProviderMethods() throws Crea
Injector injector =
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
@Provides
@Singleton
@@ -248,8 +246,6 @@ public void testUnresolvableCircularDependenciesWithProviderInstances() {
try {
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
@Provides
C c(D d) {
@@ -483,8 +483,6 @@ Foo foo() {
}
private static class FailingProviderModule extends AbstractModule {
@Override
protected void configure() {}
@Provides
Foo foo() {
@@ -493,8 +491,6 @@ Foo foo() {
}
private static class SimpleProviderModule extends AbstractModule {
@Override
protected void configure() {}
@Provides
@Named("providerMethod")
@@ -147,8 +147,6 @@ protected void configure() {
public void assertParameterizedDepsInjected(Key<?> key, Module bindingModule) {
Module bindDataModule =
new AbstractModule() {
@Override
protected void configure() {}
@Provides
Map<String, Integer> provideMap() {
@@ -103,8 +103,6 @@ public void testMisplacedExposedAnnotation() {
try {
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
@Provides
@Exposed
@@ -420,8 +418,6 @@ String provideAbc(@Named("ab") String ab) {
}
},
new AbstractModule() {
@Override
protected void configure() {}
@Provides
@Named("ab")
@@ -499,8 +495,6 @@ public void testDependenciesBetweenPrivateAndPublicWithPrivateEagerSingleton() {
Injector injector =
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
@Provides
@Named("ab")
@@ -321,8 +321,6 @@ public void testDuplicateCausesCollapsed() {
Injector injector =
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
@Provides
Integer i() {
@@ -353,8 +351,6 @@ public void testMultipleDuplicates() {
Injector injector =
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
@Provides
Integer i() {
@@ -413,8 +409,6 @@ public void testDuplicatesDifferentInstances() {
Injector injector =
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
@Provides
Integer i() {
@@ -438,8 +432,6 @@ public void testMultipleDuplicatesDifferentInstaces() {
Injector injector =
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
@Provides
Integer i() {
@@ -452,8 +452,6 @@ public void testNullScopedAsASingleton() {
Injector injector =
Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {}
final Iterator<String> values = Arrays.asList(null, "A").iterator();
@@ -32,8 +32,6 @@ public void testAbstractModuleIsSerializable() throws IOException {
}
static class MyAbstractModule extends AbstractModule implements Serializable {
@Override
protected void configure() {}
}
public void testCreationExceptionIsSerializable() throws IOException {
@@ -49,8 +49,6 @@ public void testAnnotation() throws Exception {
Guice.createInjector(
MultibindingsScanner.asModule(),
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoSet
@Named("foo")
@@ -243,8 +241,6 @@ public void testDoubleScannerIsIgnored() {
MultibindingsScanner.asModule(),
MultibindingsScanner.asModule(),
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoSet
String provideFoo() {
@@ -263,8 +259,6 @@ String provideFoo() {
public void testArrayKeys_unwrapValuesTrue() {
Module m =
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoMap
@ArrayUnwrappedKey({1, 2})
@@ -317,8 +311,6 @@ ArrayWrappedKey arrayWrappedKeyFor(int number) throws Exception {
public void testArrayKeys_unwrapValuesFalse() throws Exception {
Module m =
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoMap
@ArrayWrappedKey(number = {1, 2})
@@ -345,8 +337,6 @@ String provideBar() {
public void testProvidesIntoSetWithMapKey() {
Module m =
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoSet
@TestEnumKey(TestEnum.A)
@@ -370,8 +360,6 @@ String provideFoo() {
public void testProvidesIntoOptionalWithMapKey() {
Module m =
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoOptional(Type.ACTUAL)
@TestEnumKey(TestEnum.A)
@@ -395,8 +383,6 @@ String provideFoo() {
public void testProvidesIntoMapWithoutMapKey() {
Module m =
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoMap
String provideFoo() {
@@ -423,8 +409,6 @@ String provideFoo() {
public void testMoreThanOneMapKeyAnnotation() {
Module m =
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoMap
@TestEnumKey(TestEnum.A)
@@ -451,8 +435,6 @@ String provideFoo() {
public void testMapKeyMissingValueMethod() {
Module m =
new AbstractModule() {
@Override
protected void configure() {}
@ProvidesIntoMap
@MissingValueMethod
@@ -166,8 +166,6 @@ private static void assertInjected(GuiceNamedClient guiceClient, Jsr330NamedClie
private static Module getJsr330BindingProviderMethodModule() {
return new AbstractModule() {
@Override
protected void configure() {}
@SuppressWarnings("unused")
@Provides
@@ -180,8 +178,6 @@ String provideFoo() {
private static Module getGuiceBindingProviderMethodModule() {
return new AbstractModule() {
@Override
protected void configure() {}
@SuppressWarnings("unused")
@Provides
@@ -49,8 +49,6 @@
public void testScanning() throws Exception {
Module module =
new AbstractModule() {
@Override
protected void configure() {}
@TestProvides
@Named("foo")
@@ -88,8 +86,6 @@ protected void configure() {
.skipSources(getClass())
.install(
new AbstractModule() {
@Override
protected void configure() {}
@TestProvides
@Named("foo")
@@ -112,8 +108,6 @@ protected void configure() {
.withSource("source")
.install(
new AbstractModule() {
@Override
protected void configure() {}
@TestProvides
@Named("foo")
@@ -130,8 +124,6 @@ String foo() {
public void testMoreThanOneClaimedAnnotationFails() throws Exception {
Module module =
new AbstractModule() {
@Override
protected void configure() {}
@TestProvides
@TestProvides2
@@ -252,17 +244,13 @@ String aString() {
return "Foo";
}
@Override
protected void configure() {}
}
public void testChildInjectorInheritsScanner() {
Injector parent = Guice.createInjector(NamedMunger.module());
Injector child =
parent.createChildInjector(
new AbstractModule() {
@Override
protected void configure() {}
@TestProvides
@Named("foo")
@@ -276,8 +264,6 @@ String foo() {
public void testChildInjectorScannersDontImpactSiblings() {
Module module =
new AbstractModule() {
@Override
protected void configure() {}
@TestProvides
@Named("foo")
@@ -324,8 +310,6 @@ protected void configure() {
.skipSources(getClass())
.install(
new AbstractModule() {
@Override
protected void configure() {}
@Exposed
@TestProvides
@@ -376,8 +360,6 @@ protected void configure() {
.newPrivateBinder()
.install(
new AbstractModule() {
@Override
protected void configure() {}
@Exposed
@TestProvides
@@ -403,8 +385,6 @@ protected void configure() {
.skipSources(getClass())
.install(
new AbstractModule() {
@Override
protected void configure() {}
@Exposed
@TestProvides
@@ -430,8 +410,6 @@ protected void configure() {
.newPrivateBinder()
.install(
new AbstractModule() {
@Override
protected void configure() {}
@Exposed
@TestProvides
@@ -507,8 +485,6 @@ protected void configure() {
.newPrivateBinder()
.install(
new AbstractModule() {
@Override
protected void configure() {}
// ignored! (because the scanner doesn't run over this module)
@Exposed
@@ -121,7 +121,5 @@ public void configure(Binder binder) {
}
private static class C extends AbstractModule {
@Override
public void configure() {}
}
}
Oops, something went wrong.

0 comments on commit 4c2c276

Please sign in to comment.