Open GoogleCodeExporter opened 9 years ago
As Bob once pointed out on the mailing list, it could make sense to @Inject
private
finals (e.g. into providers) because you get the same thread safety/visibility
guarantees as you get with constructors:
http://jeremymanson.blogspot.com/2008/07/immutability-in-java-part-3.html
I have currently used this in Warp Persist, here: http://code.google.com/p/warp-
persist/source/browse/trunk/warp-
persist/src/com/wideplay/warp/hibernate/SessionFactoryProvider.java
We can't let Guice create the object, but still want to use a final field. It
seemed
like the only way to do that.
Now, Guice 2.0's getProvider will probably get rid of this use case, so in that
case
I'm not against removing support for this, because it sure does feel hacky.
Original comment by robbie.v...@gmail.com
on 11 Sep 2008 at 8:58
Hmm... we probably won't be able to change this behaviour for
backwards-compatibility reasons. Shucks.
Original comment by limpbizkit
on 11 Sep 2008 at 4:42
Doesn't 2.0 give you the wiggle room to make these kinds of breaks?
Original comment by gili.tza...@gmail.com
on 24 Sep 2008 at 3:20
I'll reopen this if a problem comes up, but so far we haven't seen any bad
behaviour
from this.
Original comment by limpbizkit
on 14 Nov 2008 at 11:09
Original issue reported on code.google.com by
limpbizkit
on 11 Sep 2008 at 6:41