From kvaster on December 25, 2011 05:39:32
-
Singletons should be not recreated many times if there was error whil constructing it. i.e.:
class T1, class T2 depends on T1 and class T3 depends on T1.
All of them singletons. Guice will try to create T1 three times: when creating itself, when creating T2 and T3.
-
Injected member may be null in case of dependent bean creation error. i.e.:
T1 class, T2 class have member of T1.
T1 failed to create due to exception, but T2 will not fail, rather it will have T1 fieled equal to null.
Attached patch to fix issues.
Attachment: gist
guice-singleton-recreation.patch
Original issue: http://code.google.com/p/google-guice/issues/detail?id=676