title: Is this a safe publication of object?
body: <p>I have a class Item</p>
  
  <pre><code>class Item {
    public int count;
    public Item(int count) {
      this.count = count;
    }
  }
  </code></pre>
  
  <p>Then, I will put a reference to Item in a field of other class </p>
  
  <pre><code>class Holder {
    public Item item;
    public Holder() {
      item = new Item(50);
    }
  }
  </code></pre>
  
  <p>Can this <em>new Item</em> object be safely published? If not, why? According to Java Concurrency in Practice, the new Item is published <em>without being fully constructed</em>, but in my opinion the new Item is fully constructed: its <code>this</code> reference doesn't escape and the reference to it and its state is published at the same time, so the consumer thread will not see a stale value.  Or is it the visibility problem.  I don't exactly know the reason.</p>