title: method annotations null when proxying via CGLIB
body: <p>I'm experiencing a strange behaviour when looking via reflection for annotations on a method belonging to a class proxied via CGLIB. We use CGLIB in Spring, and if I annotate a method only with an annotation it works well (I'm able to retrieve the annotations via the <code>getAnnotations()</code> method on the correspondent <code>Method</code> object). If I annotate the method with 2 annotations instead (no matter the order of annotation), <code>getAnnotations()</code> just return <code>null</code>. Both annotation have <code>RetentionPolicy.RUNTIME</code>. </p>
  
  <p>I read there are some issues with CGLIB, but it's strange that it simply works for one annotation and it returns null when I put 2 annotations.</p>
  
  <p>Any suggestions?</p>
  
  <p>(Using Spring 3.0.5 and CGLIB 2.2.2)</p>
  
  <p>Adding code:</p>
  
  <p>1st annotation is:</p>
  
  <pre><code>@Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface Produces {
      ResultType[] value();
  }
  </code></pre>
  
  <p>2nd annotation is </p>
  
  <pre><code>@Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface JamonMonitored {
      String type() default "";
      String tag() default "";
  }
  </code></pre>
  
  <p>And the block of code is for checking annotations is</p>
  
  <pre><code>Collection&lt;Method&gt; candidates = Collections2.filter(Arrays.asList(executorInstance.getClass().getMethods()), new Predicate&lt;Method&gt;() {
      @Override
      public boolean apply(Method input) {
          return input.getAnnotation(Produces.class) != null;
      }
  });
  
  if (candidates.isEmpty()) {
      // throws exception
  }
  </code></pre>
  
  <p>If I annotate a method with both @Produces and @JamonMonitored, <code>getAnnotation(Produces.class)</code> is always <code>null</code>.</p>