summaryrefslogtreecommitdiff
path: root/plugins/InspectionGadgets/test/com/siyeh/igfixes/threading/non_thread_safe_lazy_initialization/InstanceVariableReferenced.java
blob: f72c45f2f3957b2a0a9dd28ae7ac6964fe18b410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public class InstanceVariableReferenced {

  private static Object example;
  private String s = "yes";

  public Object getInstance() {
    if (example == null) {
      example<caret> = getString(s);
    }
    return example
  }

  private static String getString(String s) {
    return new String(s);
  }
}