From e782c57d74000722f9db4c9426317410520670c6 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Thu, 18 Sep 2014 11:43:07 -0700 Subject: Snapshot idea/138.2210 from git://git.jetbrains.org/idea/community.git Change-Id: I8f0204d7887ee78cf1fd8c09f936c5afff0edd2f --- .../igfixes/threading/make_field_volatile/Simple.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.java (limited to 'plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.java') 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(s_instance == null) + { + synchronized(Simple.class) + { + if(s_instance == null) + { + s_instance = new Object(); + } + } + } + return s_instance; + } +} -- cgit v1.2.3