Status: New
Owner: limpbizkit
Labels: Type-Defect

New issue 297 by phopkins: NPE in #getDependencies() of  
ProviderInstanceBinding for Multibinder in Stage.TOOL
http://code.google.com/p/google-guice/issues/detail?id=297

private static class Multimodule extends AbstractModule {
   @Override
   protected void configure() {
     Multibinder<String> setBinder = Multibinder.newSetBinder(binder(),  
String.class);
     setBinder.addBinding().toInstance("One");
     setBinder.addBinding().toInstance("Two");
     setBinder.addBinding().toInstance("Three");
   }
}

Injector injector = Guice.createInjector(Stage.TOOL, new Multimodule());
ProviderInstanceBinding<?> binding =
     (ProviderInstanceBinding<?>) injector.getBinding(Key.get(new  
TypeLiteral<Set<String>>() {}));
// throws NullPointerException
binding.getDependencies();


It seems that in TOOL mode, the RealMultibinder#initialize() method is not  
called, so the
Dependency Set is never created.

Primary expectation is for this to not cause an exception, but secondary  
expectation is for the
Dependencies to be available even in TOOL mode.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to