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

javac fails to compile module-info.java when -processor is specified

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 7
    • Fix Version/s: 9
    • Component/s: tools
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      javac (with the module support) fails to compile module-info.java file when an annotation processor is specified via the -processor option. Without the -processor option, javac successfully compiles that module-info.java file.

      To reproduce:

      // m/module-info.java
      @ImportModules({
          @ImportModule(name="java.se")
      })

      module m;

      $ <JDK>/bin/javac -source 7 -target 7 module-info.java
        - compiled successfully

      $ <JDK>/bin/javac -source 7 -target 7 -processor MyProcessor module-info.java
      initialising...
      module-info.java:1: incompatible types
      found : java.module.annotation.ImportModules
      required: java.lang.annotation.Annotation
      @ImportModules({
       ^
      1 error

      Attached is the MyProcessor.java.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mchung Mandy Chung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: