I have a situation where I want to initialize some static, "constant" (ie. not modified after initialization) data structure. I'm doing this in the "static {}" code block. Is it guaranteed that this code block is never eceuted twice? Do I need synchronization in some special case?
Update: the answer is partly given in Are Java static initializers thread safe?
Remains the question: how can a static initializer be executed more than once? And does it matter? I guess it runs more than once for different static "instances", ie. in different webapp contexts and attached to different class loaders such that they don't "see" each other. Correct?