--
You received this message because you are subscribed to the Google
Groups group for http://projectlombok.org/
To post to this group, send email to project...@googlegroups.com
To unsubscribe from this group, send email to
project-lombo...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/project-lombok?hl=en
You LazySingleton uses double checked locking, which is broken. Using
volatile would help (under the "new" Java memory model, I think coming
with JDK5). Using something like http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom
is the way I'd recommend (if I would recommend any use of a singleton
at all).
This is all wrong usage. Using singletons is no better than using
global variables.
There's no way to find out the dependencies
and no
way to test properly.
IMHO, any use of a singleton is a sign of a problem. Having more of
them is nearly always wrong.
I'd recommend switching to dependency
injection.
So, no, not really a feature I'd vote for ;)
But Lombok could only help you do something stupid more easily.