summaryrefslogtreecommitdiff
path: root/plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.java')
-rw-r--r--plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.java
new file mode 100644
index 000000000000..b514dc20378a
--- /dev/null
+++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.java
@@ -0,0 +1,19 @@
+public class Simple
+{
+ private static Object s_instance;
+
+ public static Object foo()
+ {
+ if<caret>(s_instance == null)
+ {
+ synchronized(Simple.class)
+ {
+ if(s_instance == null)
+ {
+ s_instance = new Object();
+ }
+ }
+ }
+ return s_instance;
+ }
+}