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

ClassWriter: Position UNKNOWN in type annotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8
    • tools

      My colleague Chris Povirk noticed that for the following input, javac logs a warning to stderr and omits the type annotations from the output.

      The issue is similar to the one discussed in this compiler-dev thread:
      http://mail.openjdk.java.net/pipermail/type-annotations-dev/2013-April/000777.html

      ```
      import static java.lang.annotation.ElementType.TYPE_USE;

      import java.lang.annotation.Target;

      @Target(TYPE_USE)
      @interface Anno {}

      class Lib<T> {}

      class PositionUnknown {
        Object foo() {
          return new Lib<@Anno ?>[0];
        }
      }
      ```

      ```
      $ javac -fullversion T.java
      javac full version "14-ea+22-982"
      ClassWriter: Position UNKNOWN in type annotation: @Anno
      ClassWriter: Position UNKNOWN in type annotation: @Anno
      ```

            vromero Vicente Arturo Romero Zaldivar
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: