summaryrefslogtreecommitdiff
path: root/plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/make_field_volatile/Simple.after.java
blob: f33e303316230939eda9fdcd3b9f28d6cbbcd3fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public class Simple
{
  private static volatile 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;
  }
}