RFR [JDK8]: 7153951: -Xlint:auxiliaryclass
Fredrik Öhrström
fredrik.ohrstrom at oracle.com
Mon Sep 24 05:01:16 PDT 2012
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