<div dir="ltr"><div>I had an idea for a new lint warning and wanted to get feedback from those who understand the lint system better than me about the idea and whether this is feasible.<br></div><div><br></div><div>The name of the new warning would be something like <span style="font-family:monospace">"unnecessary"<font face="arial,sans-serif">.</font></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif"><br></font></span></div><div>The idea is that if you said <span style="font-family:monospace">-Xlint:foobar,unnecessary</span> then you would get a warning for any unnecessary <span style="font-family:monospace">@SuppressWarnings("foobar")</span> annotations, meaning, there are actually no warnings that need suppressing at that spot, and so the annotation is unnecessary and can be removed.</div><div><br></div><div>The reason you would need to do <span style="font-family:monospace">-Xlint:foobar,unnecessary</span><font face="arial,sans-serif"> instead of just plain </font><span style="font-family:monospace">-Xlint:unnecessary<font face="arial,sans-serif"> to cover all of them is because in some cases if </font>-Xlint:foobar<font face="arial,sans-serif"> is not specified then the logic for detecting </font>foobar<font face="arial,sans-serif"> warnings is completely disabled, so it's not possible to know when the warning would or would not have fired. Also, this makes the control more precise.<br></font></span></div><div><br></div><div>The benefit of this of course is it helps avoid accidental warning suppression (false negatives) by making it easier to minimize your suppression surface.<br></div><div><br></div><div>I started trying to evaluate doing this, but am not completely understanding how lint and "deferred lint" interact.</div><div><br></div><div>Is there a lint expert who can comment on whether this would be feasible given the way lint is currently implemented?<br></div><div><br></div><div>Thanks,</div><div>-Archie<br></div><div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Archie L. Cobbs<br></div></div></div>