Open GoogleCodeExporter opened 9 years ago
fixed in r1504. please review!
Original comment by sberlin
on 21 Feb 2011 at 9:07
This seems to have caused Guice to blow up if a module binds A to B when A
already has an "@ImplementedBy B" annotation. Even though there's no conflict.
Original comment by kevinb@google.com
on 10 Mar 2011 at 9:30
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.
Original comment by sberlin
on 10 Mar 2011 at 10:23
Making a new bug for this since a waterfall of them are appearing while fixing..
Original comment by sberlin
on 10 Mar 2011 at 11:22
Original issue reported on code.google.com by
sberlin
on 21 Feb 2011 at 8:00