RFR: 8352612: No way to add back lint categories after "none" [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Apr 10 15:36:34 UTC 2025


On Tue, 25 Mar 2025 16:42:06 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

>> This PR relates to the `-Xlint:none` flag. Currently, it not only disables all lint categories as one would expect, but it also disables all non-mandatory warnings, period. In other words, `-Xlint:none` has `-nowarn` as a hidden side-effect. So for example, trying to do `-Xlint:none,serial` to enable only the `serial` lint category is futile: the category will be enabled but the warnings won't ever appear. This PR removes that hidden side-effect, and also clarifies some of the help output.
>
> Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Correct regression test expected output.

src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties line 171:

> 169:     Append to the bootstrap class path
> 170: javac.opt.Xlint=\
> 171:     Enable recommended lint warning categories

I think the use of "mandatory warning" above is good. However, I find the use of `lint warning` a bit too "implementation-related". I believe I liked the old text better, even if it was more vague.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24227#discussion_r2037690711


More information about the compiler-dev mailing list