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

javac aborts before first round of annotation processing is started

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 10
    • tools
    • None
    • 10

      (filed on behalf of Stefan Marr <java@stefan-marr.de>)

      Since JDK 10 (also confirmed with OpenJDK 11-ea+5), the code at the URL http://stefan-marr.de/downloads/truffle/javac-anno-error.zip results in:

      src/som/primitives/ActivitySpawn.java:22: error: expression not allowed as annotation value
      @Primitive(primitive = "threading:threadSpawn:with:",
      ^

      The problem seems to be a somewhat odd parse error, which recognizes the name of a class, which needs to be generated by an annotation processors, as an expression.
      This in turn causes javac to skip execution of any annotation processors. Specifically, javac aborts before the first round of annotation processing is started.

      Steps to reproduce:

      Take code at http://stefan-marr.de/downloads/truffle/javac-anno-error.zip extract and run `ant compile-som`.

      It succeeds with JDK 9, but not with any later JDK.

      The code is as small and self-contained as I could get it while still producing the error.
      It comes with a precompiled library and annotation processor.
      However, these are likely not influencing the bug.

      The same parse error can be observed without the annotation processor being available. The error goes away if the missing ToArgumentsArrayNodeFactory class is provided manually.

      I would expect the behavior to be identical between Java 8 and 9.
      Not sure what change would explain this behavior.

      Currently, I don’t have a work around, so, this blocks use of Java 10.

            Unassigned Unassigned
            dnsimon Douglas Simon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: