JDK-6876892 : JSR 308 type annotations not visible when processing class files
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.annotation.processing
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2009-08-28
  • Updated: 2012-03-22
  • Resolved: 2010-12-07
Related Reports
Duplicate :  
Relates :  
Description
JSR 308 type annotations on type parameters are not visible when doing the annotation processing of java *class* files. For example, if I compile the sample class T below and run my simple annotation processor (source attached) that prints contents of the processed java class, then the "@X" annotation on the "A" type variable is not printed out:

====
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@interface X {}

public class T {
     public <@X A> void foo() {}
}
====

# jdk7/bin/javac MyProcessor.java T.java
# jdk7/bin/javac -processor MyProcessor T
TypeParam: A
TypeParamAnnotation:

However, the annotation processing of the java source works fine (before b70):

# jdk7_69/bin/javac -processor MyProcessor T.java
TypeParam: A
TypeParamAnnotation: @X

Note that the annotation processor behaves as reported with promoted builds 64 through 69 (JSR 308 support was added in b64). Starting b70 the annotation processing of source files has stopped working. See separate CR 6876891.

Comments
EVALUATION JSR 308 is not in JDK 7
29-10-2010

EVALUATION Caused by this changeset: changeset: 336:6d0add6ad778 user: mcimadamore date: Thu Jul 30 10:30:34 2009 +0100 summary: 6861837: JCK compilation failures
08-09-2009