Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6880086

regression: JSR 308 type annotations on type parameters are not visible processing class files

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 7
    • Fix Version/s: 7
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      From Alexey Gavrilov:

      I've noticed that 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 that prints contents on 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 {
      @X
      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:

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jjg Jonathan Gibbons
                Reporter:
                jjg Jonathan Gibbons
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: