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

ClassWriter: Position UNKNOWN in type annotation

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 14
    • Fix Version/s: 15
    • Component/s: tools

      Description

      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 compile-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
      ```

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cushon Liam Miller-Cushon
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: