<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>It seems to be that:</p>
<p>* Lint::isEnabled correctly reflects the command line flags<br>
* Lint::isSuppressed does not</p>
<p>As such, isEnabled is correctly used in the constructor of
Preview, to set the value of MandatoryWarningHandler::verbose.</p>
<p>But the isSuppressed check in Preview::warnPreview seems
redundant, because no suppression will ever be found this way.</p>
<p>IMHO, Preview should not hold on to Lint after it uses it to
initialize the MandatoryWarningHandler. The suppressions checks,
where possible, should be left to clients (as code in Check etc.
will be in a better position to know which Lint to actually use).</p>
<p>Alternalively, warnPreview could take a Lint as well, but then
we'd have to think about how to model cases where no meaningful
Lint exists (Scanner and Parser).</p>
<p>Maurizio <br>
</p>
<div class="moz-cite-prefix">On 10/01/2025 17:58, Archie Cobbs
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CANSoFxudwDWtPhGTPStg6vugvaXzibYaqEE0zJQBPTy7_qAt6w@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">On Fri, Jan 10, 2025 at 9:32 AM Archie Cobbs
<<a href="mailto:archie.cobbs@gmail.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">archie.cobbs@gmail.com</a>>
wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">On Fri, Jan 10, 2025 at 1:49 AM Jan
Lahoda <<a href="mailto:jan.lahoda@oracle.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">jan.lahoda@oracle.com</a>>
wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>I And the "lint" here is the "global" Lint
instance, that (AFAIK) never suppresses
anything. I.e. the condition in the "if"
statement is always true, I believe.</p>
</div>
</blockquote>
<div>The root Lint instance doesn't include any <span style="font-family:monospace">@SuppressWarnings</span>
suppressions but it does include suppressions from
command line flags like <span style="font-family:monospace">-Xlint:-preview</span>,
so the "if" statement can be false.</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Oops - I am wrong about that. You are right - <span style="font-family:monospace">Lint.suppressedValues</span>
does not get initialized from <span style="font-family:monospace">Xlint:-foo</span> flags,
only from <span style="font-family:monospace">@SuppressWarnings</span>
annotations.</div>
<div><br>
</div>
<div>And that also explains my bogus test for classfile
minor versions.</div>
<div><br>
</div>
<div>Thanks!</div>
<div><br>
</div>
<div>-Archie<br>
</div>
<br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature">Archie L. Cobbs<br>
</div>
</div>
</div>
</blockquote>
</body>
</html>