JDK-7166704 : javac7 doesn't invoke given annotation processor when meets unresolved "import static"
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2012-05-05
  • Updated: 2012-06-01
  • Resolved: 2012-06-01
Related Reports
Duplicate :  
Description
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.