The meaning of -Xlint:none,serial

Archie Cobbs archie.cobbs at gmail.com
Thu Mar 20 20:16:03 UTC 2025


What is the intended meaning of a javac flag like -Xlint:none,serial (where
you might replace "serial" with any other non-mandatory lint category).

I always assumed that this means "Disable all lint categories, and then
enable the "serial" category". And in fact, that's how it works for
mandatory lint categories like "unchecked".

But for non-mandatory lint categories, what it actually means is "Disable
all lint categories, period." (which happens here
<https://github.com/openjdk/jdk/blob/56038fb5a156568cce2e80f5db18b10ad61c06e4/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java#L370>
and here
<https://github.com/openjdk/jdk/blob/56038fb5a156568cce2e80f5db18b10ad61c06e4/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java#L722>).


Is that intended? It seems surprising, and is asymmetrical with the meaning
of -Xlint:all,-serial, which means the converse "Enable all lint
categories, and then disable the "serial" category".

Thanks,
-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20250320/5a75733f/attachment.htm>


More information about the compiler-dev mailing list