RFR [JDK8]: 7153951: -Xlint:auxiliaryclass

Jonathan Gibbons jonathan.gibbons at oracle.com
Mon Sep 24 12:58:12 PDT 2012

Comment in ClassReader:

1021                     // The the class is a toplevel class, originating from a Java source file,

Does this work correctly with inner classes, which are initially treated 
as top level classes, but then subsequently converted to inner classes, 
when more of the necessary info is known?

-- Jon

On 09/24/2012 05:01 AM, Fredrik Öhrström wrote:
> From the bug text:
> Although legal, the use of multiple top level classes in the same file
> is somewhat questionable to begin with, but it is particularly bad when
> in some package class A in A.java refers to class B defined in C.java.
> This requires that at times the files must be compiled together, and
> prevents implicit compilation from locating such "auxiliary classes".
> http://cr.openjdk.java.net/~ohrstrom/webrev-7153951-v4/ 
> <http://cr.openjdk.java.net/%7Eohrstrom/webrev-7153951-v1/>
> There are 499 auxiliary classes in the openjdk, but only 16 of
> these are used in such a way that they cannot be found using the
> -sourcepath option, ie they break implicit compilation.
> The -Xlint:auxiliaryclass reports all references to those 16 classes.
> Allowing the developer to either move the reference into the same
> source file as the auxiliary class, or break out the auxiliary class into
> a separate source file.
> //Fredrik

More information about the compiler-dev mailing list