title: Eclipse showing two THIS$0 fields for a nested class (Java)
body: <p>I have been facing an odd phenomena that I don't quite understand. I have an abstract class that is extended by several other classes. the abstract class is a type of special collection and it has a nested abstract iterator class that fits it. Every class that extends the abstract collection class, also has a nester iterator class that extends the orginal abstract iterator.</p>
  
  <p>The abstract class is something like this:</p>
  
  <pre><code>public abstract class AbstractMultiCollection&lt;T&gt; {
  
      public AbstractMultiCollection() {
      ...
      }
  
      MultiIterator&lt;T&gt; iterator();
  
      public abstract class AbstractMultiIterator {
          public AbstractMultiIterator() {
          ...
          }
  </code></pre>
  
  <p>The extending classes are something like this:</p>
  
  <pre><code>public class MajorityMultiCollection&lt;T&gt; extends AbstractMultiCollection&lt;T&gt; {
  ...
      public MultiIterator&lt;T&gt; iterator() {
          return new MajorityIterator();
      }
      ...     
  
      public class MajorityIterator extends AbstractMultiIterator {
  
          public MajorityIterator() {
          super();
          ...
          }
  
          public T next() {
          ...
          }
  </code></pre>
  
  <p>Simply put, the collections extend the abstract collection and their nested iterators extend the nested abstract iterator.</p>
  
  <p>I have two problems that I don't understand and would appreciate clarification on:</p>
  
  <ol>
  <li>When I debug my code, the "return new MajorityIterator();" lines raise a "Source Not Found" error and "ClassNotFound" exception in the eclipse debugger and a bunch of "ClassLoaderExt" exceptions that I don't understand.</li>
  <li>I noticed that every "MajorityIterator" has two "This$0" fields, containing the collection he belongs to. one is null at first, but receives the collection once I invoke the "super();" builder.</li>
  </ol>
  
  <p>I failed to find the reason for this, can anyone clarify? Thanks in advance!</p>