Looks like you've found a bug! Behind the scenes Guice is using a set
binder for the map's elements; unfortunately it isn't guarding this
from collision with similar sets.
I'll look into getting this fixed for our next release. In the
interim, you can workaround by using an annotation on your map binder.
Then bind the key you want (the unannotated map) to the key that you
have:
Injector injector = Guice.createInjector(new AbstractModule() {
@Override protected void configure() {
Multibinder.newSetBinder(binder(), String.class)
.addBinding().toInstance("A");
Named uniqueName = Names.named(UUID.randomUUID().toString());
MapBinder.newMapBinder(binder(), String.class, String.class,
uniqueName)
.addBinding("B").toInstance("b");
bind(new Key<Map<String, String>>() {}).to(new Key<Map<String,
String>>(uniqueName) {});
}
});
Cheers,
Jesse
--
You received this message because you are subscribed to the Google Groups
"google-guice" 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?hl=en.