title: no suitable method found for getAnnotation(Class<CAP#1>)
body: <p>I'm coding a few simple methods to get annotations a class, field, or method.  The first method, which gets a class-level annotation, works fine.  Copy and paste that to create a new method to get a field-level annotation results in a compile error saying:</p>
  
  <pre><code>error: no suitable method found for getAnnotation(Class&lt;CAP#1&gt;)
  </code></pre>
  
  <p>Not sure how the getAnnotation method call on the Class object works OK but the same method call on the Field object results in this compilation error.</p>
  
  <p>Thoughts?</p>
  
  <pre><code>public class AnnotationTool {
      public static &lt;T&gt; T getAnnotation(Class c, Class&lt;? extends T&gt; annotation) {
          return (T)c.getAnnotation(annotation);
      }
  
      public static &lt;T&gt; T getAnnotation(Class c, String fieldName, Class&lt;? extends T&gt; annotation) {
          try {
              Field f = c.getDeclaredField(fieldName); 
              return (T)f.getAnnotation(annotation);   // compile error here??
          } catch (NoSuchFieldException nsfe) {
              throw new RuntimeException(nsfe);
          }
      }
  }
  </code></pre>