title: Java Generics - Using the generic type parameter of the enclosing class in a method parameter
body: <p>I've a simple generic class follows which accepts a generic type parameter, which is the same as the one declared as a type parameter of the class:</p>
  
  <pre><code>import java.lang.reflect.AnnotatedElement;
  import java.lang.reflect.Method;
  
  public abstract class SimpleClass&lt;T extends AnnotatedElement&gt;
  {
  
     public void operate()
     {
        Method m = null;
        this.doSomething(m); // Error : SimpleClass.java:[34,10] doSomething(T) in SimpleClass&lt;T&gt; cannot be applied to (java.lang.reflect.Method)
     }
     protected abstract void doSomething(T annotatedElement);
  }
  </code></pre>
  
  <p>This code fails to compile at the following line:</p>
  
  <pre><code>this.doSomething(m); 
  </code></pre>
  
  <p>with this error:</p>
  
  <pre><code>Error : SimpleClass.java:[34,10] doSomething(T) in SimpleClass&lt;T&gt; cannot be applied to (java.lang.reflect.Method)
  </code></pre>
  
  <p>Am I missing something here? The type parameter T is marked as T extends AnnotatedElement. As such, I would expect the call to doSomething with a java.lang.reflect.Method argument to compile successfully.</p>