Merge pull request #14232 from jaymode/class_set_binding

properly bind ClassSet extensions as singletons
This commit is contained in:
Simon Willnauer 2015-10-21 22:58:25 +02:00
commit 8f490f527a
1 changed files with 2 additions and 1 deletions

View File

@ -191,7 +191,8 @@ public abstract class ExtensionPoint {
protected final void bindExtensions(Binder binder) {
Multibinder<T> allocationMultibinder = Multibinder.newSetBinder(binder, extensionClass);
for (Class<? extends T> clazz : extensions) {
allocationMultibinder.addBinding().to(clazz).asEagerSingleton();
binder.bind(clazz).asEagerSingleton();
allocationMultibinder.addBinding().to(clazz);
}
}
}