title: Defining generics from supertype at runtime when overriding methods in Eclipse
body: <p>I have a class called <code>AbstractCollection&lt;E&gt;</code> and a subclass called <code>AbstractMap&lt;K, V&gt;</code>. The subclass is defined as <code>public abstract class AbstractMap&lt;K, V&gt; extends AbstractCollection&lt;Pair&lt;K, V&gt;&gt;</code>. A method called append in <code>AbstractCollection&lt;E&gt;</code> has the following signature <code>protected abstract int append(E element)</code>. But when I override this method in the AbstractMap class <code>public int append(Pair&lt;K, V&gt; pair)</code>, I get an error. None of the generics are wild-cards, since they are all specified when an instance of AbstractMap is created as K and V, and therefore I don't understand why this error pops up.</p>
  
  <p>I also tried to let Eclipse override the method for me, but it writes the same signature as I did, and so the error is still there. <code>Right-click on code &gt;&gt; Source &gt;&gt; Override/Implement Methods...</code></p>
  
  <p>UPDATE
  I've recreated the code that produce the error in the simplest form:</p>
  
  <pre><code>public abstract class AbstractCollection&lt;E&gt; {
  
      protected abstract int append(E element);
  }
  
  public abstract class AbstractMap&lt;K, V&gt; extends AbstractCollection&lt;Pair&lt;K, V&gt;&gt; {
  
      @Override
      public int append(Pair&lt;K, V&gt; pair) {  //error pops up here
          //... 
      }
  
      public static final class Pair&lt;K, V&gt; {
  
      }
  }
  </code></pre>
  
  <p>I also tried this again on another version of Eclipse, and now it works, although the error flag still appears on the version I mainly use (Luna with java 8).</p>
  
  <p>The error flag contains this message: </p>
  
  <blockquote>
    <p>The method append(AbstractMap.Pair) of type AbstractMap must override or implement a supertype method</p>
  </blockquote>