JDK 12 RFR of JDK-8190886: package-info handling in RoundEnvironment.getElementsAnnotatedWith

joe darcy joe.darcy at oracle.com
Tue Jul 24 06:50:09 UTC 2018


Hello,

Please review the changes to address

     JDK-8190886: package-info handling in 
RoundEnvironment.getElementsAnnotatedWith
     http://cr.openjdk.java.net/~darcy/8190886.1/

Contrary to the spec, the RoundEnvironment.getElementsAnnotatedWith 
implementation was traversing into packages (and modules). Given the 
phase of JDK 11 and at least the potential for behavioral compatibility 
impact, I'm proposing to fix this in 12 rather than 11. I'll file a CSR 
for the behavioral change in due course.

The implementation change is small, just adding overrides of visitor 
methods which skip scanning packages and modules. To allow use of 
AnnotatedElementInfo in compilation units in a named package, the 
AnnotatedElementInfo type has to itself be in a named package rather 
than an unnamed one; therefore, a number of supporting changes are 
needed to other test files in the directory to support that type rename.

The tests have not been updated to verify the behavior on modules, but 
that could be done too.

I've verified the updated test fails with a promoted build of JDK 12 but 
passes with a build with these javac modifications. All other langtools 
tests pass on a modified build too.

I'll perform a copyright pass before pushing once the rest of the 
contents are reviewed.

Thanks,

-Joe



More information about the compiler-dev mailing list