Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binding order matters when requireExplicitBindings is on #700

Closed
gissuebot opened this issue Jul 7, 2014 · 0 comments
Closed

binding order matters when requireExplicitBindings is on #700

gissuebot opened this issue Jul 7, 2014 · 0 comments
Labels

Comments

@gissuebot
Copy link

From pmoor@google.com on April 11, 2012 19:18:52

See the attached test case, it fails with

  1. Explicit bindings are required and com.google.apps.framework.producers.GuicePocTest$A is not explicitly bound.
      while locating com.google.apps.framework.producers.GuicePocTest$A
        for parameter 0 at com.google.apps.framework.producers.GuicePocTest$BImpl.<init>(GuicePocTest.java:17)
      at com.google.apps.framework.producers.GuicePocTest$1.configure(GuicePocTest.java:25)

When reversing the binding order (first A, then B), it passes.

Attachment: gist
   GuicePocTest.java

Original issue: http://code.google.com/p/google-guice/issues/detail?id=700

nineninesevenfour added a commit to nineninesevenfour/guice that referenced this issue Oct 8, 2022
Ensure the order of calls to Binder.bind(...) in combination with @ does not affect whether classes are bound explicitly or with jIT binding.

Signed-off-by: Harald Fassler <harald.fassler+9974@gmail.com>
nineninesevenfour added a commit to nineninesevenfour/guice that referenced this issue Oct 16, 2022
Ensure the order of calls to Binder.bind(...) in combination with @ does not affect whether classes are bound explicitly or with jIT binding.

Signed-off-by: Harald Fassler <harald.fassler+9974@gmail.com>
copybara-service bot pushed a commit that referenced this issue Apr 25, 2023
…tedBy. Instead, defer it like a normal bind(X.class).to(Y.class) does. This ensures that later bindings of Y are used.

Much thanks goes to @nineninesevenfour for their investigation (in #1650), which made fixing this much easier.

Fixes #700 and fixes #1650.

PiperOrigin-RevId: 527044205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant