summaryrefslogtreecommitdiff
path: root/plugins/InspectionGadgets/src/inspectionDescriptions/NonThreadSafeLazyInitialization.html
blob: a1d87f3e9d1b51278ccc1593609f0497cf0e678c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<html>
<body>
Reports <b>static</b> variables being lazily initialized
in an non-thread-safe manner. Lazy initialization of <b>static</b> variables should be done
in an appropriate synchronization construct, to prevent different threads from
performing conflicting initialization.
<p>
If applicable, a quickfix is suggested
which introduces the static holder pattern described in
<a href="http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom">
http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom
</a>
where the JVM guarantees the thread-safety of such initializations.
<!-- tooltip end -->
<p>

</body>
</html>