Open GoogleCodeExporter opened 9 years ago
Typo: foo body must be:
===
void foo() {
System.out.println(this.c == this.a.c);
System.out.println(System.identityHashCode(this.c));
System.out.println(System.identityHashCode(this.a.c));
}
===
Original comment by stepan.k...@gmail.com
on 11 Mar 2012 at 3:19
C is not declared as Singleton, isn't it?
Original comment by noctariushtc@googlemail.com
on 11 Mar 2012 at 4:07
No. I was sure classes are singleton by default.
After adding @Singleton annotation, code begins to work as I expected, only one
instance of each class is created.
Original comment by stepan.k...@gmail.com
on 11 Mar 2012 at 4:13
Jepp that's a bit tricky, I guess bindings are never singleton by default,
someone please correct me if i'm wrong.
Original comment by noctariushtc@googlemail.com
on 11 Mar 2012 at 4:42
http://code.google.com/p/google-guice/wiki/Scopes
"By default, Guice returns a new instance each time it supplies a value."
Original comment by cgdec...@gmail.com
on 11 Mar 2012 at 4:44
Original comment by cgruber@google.com
on 27 Mar 2012 at 6:12
Original issue reported on code.google.com by
stepan.k...@gmail.com
on 11 Mar 2012 at 3:18