<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi Archie,<br>
my 0.02$ below:<br>
</p>
<div class="moz-cite-prefix">On 07/05/2025 19:26, Archie Cobbs
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CANSoFxsZEAzsp5HF4J47-0Ygcd8vbjDbNjU+H80mZMvGCu=b1Q@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>I'd like to restart this discussion of <a href="https://bugs.openjdk.org/browse/JDK-8344159" target="_blank" moz-do-not-send="true">JDK-8344159</a> -
"Add lint warnings for unnecessary warning
suppression"</div>
</div>
<div dir="ltr">
<div><br>
<div>Note, this is likely not destined for JDK
25. I'm bringing it up now simply because
some refactoring that arose from the
previous discussion back in November (which
is <a href="https://mail.openjdk.org/pipermail/compiler-dev/2024-November/028573.html" target="_blank" moz-do-not-send="true">here</a>)
is now mostly done.
<div><br>
</div>
<div>I think a fair summary of the current
state is: Having the compiler emit
warnings for unnecessary warning
suppression is considered a useful idea in
principle, but it's unclear what is the
best way to configure/enable that
functionality in the compiler.</div>
</div>
</div>
<div><br>
</div>
<div>In particular, there are subtle corner
cases that could be problematic if these
warnings were enabled by <span style="font-family:monospace">-Xlint:all</span>,
especially for <span style="font-family:monospace">-Werror</span>
builds.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>IMHO, this is a problem present with the addition of every new
lint warning. It's not specific to this one. Of course, some new
lint warning operate on brand new language features, so the
potential to compromise existing compilaton units is low. But I'd
expect that warnings such as "serial" would have ran into similar
corner cases (e.g. previously ok code started to report new
warnings, and to fail with Werror).</p>
<p>So I think this seems ok, and not enough to cause a tweak to the
treatment of lint:all.</p>
<p>I'll add here that a more robust fix for Werror issues is to
enable developers to be more specific in the warnings they'd like
to promote to errors (as discussed in the past). I'll CC Kevin who
has always been a fan of this feature ;-)<br>
</p>
<blockquote type="cite" cite="mid:CANSoFxsZEAzsp5HF4J47-0Ygcd8vbjDbNjU+H80mZMvGCu=b1Q@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><br>
</div>
<div>Also complicating things, there are two
different ways to suppress warnings, <span style="font-family:monospace">@SuppressWarnings("foo")</span>
and <span style="font-family:monospace">-Xlint:-foo</span>
and for similar "corner case" reasons they
need to be configurable separately.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>IMHO, the main value of this new lint warning is to detect the
use of `@SuppressWarnings` that are redundant. Sure there's the
command-line flavor as well, but that renders any source code
analysis dependent on the flags passed to javac. In other words,
detecting redundant `@SuppressWarnings` has a more "timeless"
nature that does not apply to detecting redundant command-line
suppressions. The former tells you something about _your code_, in
a way that is independent from which flags you use to compile it.
Which is why I think we should only worry about that.</p>
<p>Maurizio</p>
<br>
</body>
</html>