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

javac7 doesn't invoke given annotation processor when meets unresolved "import static"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 7
    • tools
    • None
    • generic
    • generic

      I'm using Annotation Processing mechanism to extract some meta-data from java sources (from the certain annotations and javadoc comments). When I run javac not all classes listed in imports are available yet and javac fairly reports errors and then invokes my processor. With JDK6 everything worked fine.
      But in JDK7 something happened to javac. It no longer invokes the processor if meets some sort of imports. I discovered, that javac7 doesn't like unresolved static class and dynamic wildcard:

      import static aaa.bbb;
      import bbb.*;

      at the same time it still accepts:
       
      import static aaa.*;
      import bbb.aaa;

      javac6 works well in all such cases.
      I suspect that this is a regression.

      To reproduce the problem unzip attached H.zip and give the following commands:

      # javac Main.java
      # java -cp . Main H*.java 2>/dev/null

      Output with jdk7 will be:
      Handling: H1.java
      isPassed: true
      -------------
      Handling: H2.java
      isPassed: false
      -------------
      Handling: H3.java
      isPassed: false
      -------------
      Handling: H4.java
      isPassed: true
      -------------

      If run on jdk6 isPasses is always true.

            Unassigned Unassigned
            dfazunen Dmitry Fazunenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: