title: What exactly are the dangers of passing 'this' from a Java constructor?
body: <p>So it seems that it's a bad idea to pass <code>this</code> from a constructor in Java.</p>
  <pre><code>class Foo {
      Foo() {
          Never.Do(this);
      }
  }
  </code></pre>
  <p>My simple question is: Why?</p>
  <p>There are some related questions on Stackoverflow, but none of them give a comprehensive list of issues that may arise.</p>
  <p>For instance, <a href="https://stackoverflow.com/questions/2419410/passing-this-in-java-constructor">in this question</a>, which is asking for a workaround to this problem, <a href="https://stackoverflow.com/a/2419442/27862">one of the answers</a> states:</p>
  <blockquote>
  <p>For example if your class has a final (non-static) field, then you can usually depend on it being set to a value and never changing.</p>
  <p>When the object you look at is currently executing its constructor, then that guarantee no longer holds true.</p>
  </blockquote>
  <p>How is that?</p>
  <p>Also, I understand that subclassing is a big issue, because the superclass constructor is always called before the subclass constructor, and that may cause problems.</p>
  <p>Besides, I read that <a href="http://www.ibm.com/developerworks/java/library/j-jtp0618/index.html#2" rel="nofollow noreferrer">Java Memory Model (JMM) issues such as differences in visibility across threads and memory access reordering</a> may arise, but no details on that.</p>
  <p>What other problems may occur and can  you elaborate on the abovementioned issues?</p>