Skip to content

Commit

Permalink
Minor code cleanup. (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlativy authored Feb 24, 2018
1 parent 784fd1e commit 46b3e9a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/java/com/google/acai/GuiceberryCompatibilityModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,9 @@ class GuiceberryCompatibilityModule extends AbstractModule {

@Override
protected void configure() {
try {
bindScope(
Class.forName(GUICEBRRY_TEST_SCOPED_ANNOTATION).asSubclass(Annotation.class),
TestScope.INSTANCE);
} catch (ClassNotFoundException | ClassCastException e) {
// TestScoped not on classpath, compatibility not required.
}
classForName(GUICEBRRY_TEST_SCOPED_ANNOTATION)
.map(clazz -> clazz.asSubclass(Annotation.class))
.ifPresent(annotation -> bindScope(annotation, TestScope.INSTANCE));

install(TestingServiceModule.forServices(GuiceBerryService.class));
}
Expand Down

0 comments on commit 46b3e9a

Please sign in to comment.