Updates:
        Status: New

Comment #3 on issue 608 by sberlin: Child can rebind a binding that's in parent's JIT binding set
http://code.google.com/p/google-guice/issues/detail?id=608

So... #2 isn't actually the failure scenario. If a module binds A to B when A already has @ImplementedBy, things work fine. It also (correctly) fails if a module just has bind(A.class) and then later has bind(A.class).to(B.class). Where it fails is:

  1) Module binds Foo.
  2) Foo is @ImplementedBy(FooImpl.class)
  3) FooImpl class has a dependency on Bar
  4) Bar is @ImplementedBy(AutoBar.class)
  5) Module binds Bar to ExplicitBar.class

When figuring out the @ImplementedBy for FooImpl, it's creating a JIT binding for AutoBar too, and the getExistingBinding check when doing ExplicitBar sees AutoBar and fails. For some reason, it *does not* fail 1) is changed to bind(FooImpl.class) -- that is, there's something happening specifically with @ImplementedBy that autowires the further dependencies.

This worked before r1504, but it created a scenario where you'd actually have two different bindings for Bar (one in explicit state, another in JIT), which Guice tries pretty hard to avoid.

--
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