<div dir="ltr"><div>Hi Maurizio,</div><div><br></div><div dir="ltr">On Mon, Jan 13, 2025 at 6:56 AM Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com">maurizio.cimadamore@oracle.com</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<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></div></blockquote><div><br></div><div>Thanks for confirming all of the above.<br></div><div><br></div><div>I'm working on some cleanups in this area (pr #23056) and will include your suggested simplification to Preview.java.<br></div></div><div class="gmail_quote gmail_quote_container"><br></div><div class="gmail_quote gmail_quote_container">-Archie</div><div class="gmail_quote gmail_quote_container"><br></div><div><span class="gmail_signature_prefix">-- </span></div><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>