title: What "inconsistent synchronization" means?
body: <p>This is my Java 1.6 class:</p>
  
  <pre><code>public class Foo {
    private ArrayList&lt;String&gt; names;
    public void scan() {
      if (names == null) {
        synchronized (this) {
          this.names = new ArrayList&lt;String&gt;();
          // fill the array with data
        }
      }
    }
  }
  </code></pre>
  
  <p>Findbugs says:</p>
  
  <pre><code>Inconsistent synchronization of com.XXX.Foo.names; locked 40% of time
  </code></pre>
  
  <p>What does it mean and what I'm doing wrong? I'm trying to avoid problems when two or more clients call <code>Foo.scan()</code> at the same time.</p>