RFR [JDK8]: 7153951: -Xlint:auxiliaryclass
Jonathan Gibbons
jonathan.gibbons at oracle.com
Tue Sep 25 21:58:06 PDT 2012
I think it is OK to be a lint warning, since problems could occur in
situations outside the JDK build. However, a new option requires CCC
approval.
That being said, I don't think we need the more fine-grain warning
involving decl, use, use-other.
The webrev links have become confused: I assume you mean to read the
latest webrev, v4.
Why do you set the AUXILIARY flag in MemberEnter, not Enter?
ClassReader:1021 Repeated "The" in comment.
compiler.properties:1721
Arg {0} is a "symbol", not a "type". We do (occasionally) check the
comments with test/tools/javac/diags/MessageInfo.java.
-- Jon
On 09/24/2012 08:28 AM, Maurizio Cimadamore wrote:
> Nitpick question - it seems like this new lint warning is mainly a
> workaround to overcome problems triggered with javac's implicit
> compilation policy - is this enough to warrant the Lint status, as
> opposed to it just being an internal compiler flag?
>
> Perhaps, if we wanted a more general Lint warning we could expand the
> scope of the new warning a bit, by defining a bunch of subvalues i.e.
> -Xlint:auxiliaryclass[decl, use, use-other]
>
> where meaning of names (names TBD ;-)) is as follows:
>
> *) decl - warns about auxiliary class declaration
> *) use - always warns about use of auxiliary classes regardless of source
> *) use-other - warns about use of auxiliary classes from a different
> source from the one in which they are declared
>
> Maurizio
>
> On 24/09/12 13:01, 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