Yes, there was a bug in 3.0 that was since fixed. sam
On Sat, Nov 22, 2014, 4:21 AM therealluigi <[email protected]> wrote: > The following test fails on Guice 3.0 with multibindings > > public class TestMultibinding { > /** * Create a module with a map binder that permits duplicates and a > set * binder (on the same class as the map binder's values) Add bindings > to the * map binder on the same key but do not add any to the set binder > Retrieve * an instance of the set from the injector. The set should be > empty */ > @Test > public void testMapBinderSetBinder() { > Injector injector = Guice.createInjector(new Module() { > @Override > public void configure(Binder binder) { > MapBinder<String, String> mapBinder = MapBinder.newMapBinder( > binder, String.class, > String.class).permitDuplicates(); > mapBinder.addBinding("Foo").toInstance("aValue"); > mapBinder.addBinding("Foo").toInstance("anotherValue"); > Multibinder.newSetBinder(binder, String.class); > } > }); > Set<String> stringBindings = injector.getInstance(Key > .get(new TypeLiteral<Set<String>>() { > })); > assertTrue("No bindings expected for set of strings, but got " > + stringBindings, stringBindings.isEmpty()); > } > } > > It passes with with Guice 4.0-beta5 (and 4.0-beta). Which one is the > expected behaviour? Was there a bug on 3.0? > > — > Reply to this email directly or view it on GitHub > <https://github.com/google/guice/issues/882>. > > -- > You received this message because you are subscribed to the Google Groups > "google-guice-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/google-guice-dev. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "google-guice-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
