Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8027181 Type Annotations Cleanup
  3. JDK-8027189

Incorrect type path for type annotations on wildcards

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P2
    • Resolution: Not an Issue
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • Verification:
      Verified

      Description

      The following program should emit a class file with a RuntimeVisibleTypeAnnotations attribute on TestWildcard.meth with a type path of [WILDCARD]. Instead, the type path is [TYPE_ARGUMENT(0)].

      import java.lang.annotation.*;
      import static java.lang.annotation.RetentionPolicy.*;
      import static java.lang.annotation.ElementType.*;

      class WithArgs<T> {}

      public class TestWildcard {
        public void meth(WithArgs<@A @A @B @B ?> a) {}
      }

      @Retention(RUNTIME)
      @Target({TYPE_USE,TYPE_PARAMETER})
      @interface AC { A[] value(); }
      @Retention(RUNTIME)
      @Target({TYPE_USE,TYPE_PARAMETER})
      @Repeatable(AC.class)
      @interface A { }@Retention(RUNTIME)
      @Target({TYPE_USE})
      @interface BC { B[] value(); }
      @Retention(RUNTIME)
      @Target({TYPE_USE})
      @Repeatable(BC.class)
      @interface B { }

        Attachments

          Activity

            People

            Assignee:
            emc Eric Mccorkle
            Reporter:
            emc Eric Mccorkle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: