google-code-export / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
2 stars 1 forks source link

Let a child injector inject itself when injecting Injector #285

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If Class A has a @Inject Injector injector
and that class is created by a child injector, then the parent injector
will be injected instead of the child one.

Original issue reported on code.google.com by erik.put...@nrc-cnrc.gc.ca on 24 Dec 2008 at 12:51

GoogleCodeExporter commented 9 years ago
Issue 282 has a detailed writeup of the problems involved. The workaround is to 
explicitly bind the class that 
injects the injector, ie. something like:
  bind(A.class);

As a part of that bug I'll document the behaviour more clearly.

Original comment by limpbizkit on 25 Dec 2008 at 4:53