title: java static inner class initialization errors
body: <p>Context:
  java.io.File class has a static inner class method as follows:</p>
  
  <pre><code>    LazyInitialization.temporaryDirectory();
  </code></pre>
  
  <p>[EDITED to add some more code]
  My code below eventually calls the above line of code. An exception is thrown from within the temporaryDirectory() method, which in my context is fine/expected.</p>
  
  <pre><code>try {
      File tempFile = File.createTempFile("aaa", "aaa");
  } catch (Exception e) {
      // handle exception 
  }
  </code></pre>
  
  <p>Then, when I next invoke the same method (createTempFile) again, I get a "java.lang.NoClassDefFound error - Could not initialize class java.io.File$LazyInitialization"</p>
  
  <p>Question: 
  I assumed that the inner class LazyInitialization should have been loaded by the class loader when its static method was invoked, even though the inner method threw an exception. Yet, why am I seeing the NoClassDefFound error when invoking the second time? Is the original assumption incorrect?</p>