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

    • Icon: Sub-task Sub-task
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 8
    • tools
    • Verified

      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 { }

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

              Created:
              Updated:
              Resolved: