Bug 465577 - Compiler flag to disable @SuppressWarnings("restriction")
Summary: Compiler flag to disable @SuppressWarnings("restriction")
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-27 08:49 EDT by Markus Keller CLA
Modified: 2015-04-27 09:01 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2015-04-27 08:49:53 EDT
ECJ should offer a way to disable certain SuppressWarnings tokens.

In my workspace, this regex finds about 30 cases where access restriction problems are silenced and hidden from the build report [1]:

SuppressWarnings\s*\(\s*"[^"]*restriction

The Eclipse command-line compiler should allow the build to disable certain dangerous SuppressWarnings tokens that should always be flagged.
"-warn:-suppress" is not fine-grained enough, since that would also result in a ton of warnings for unchecked generic type operations.

Something like this:

-disableSuppressWarningsTokens:<SuppressWarnings tokens separated by ,>


[1] E.g. http://download.eclipse.org/eclipse/downloads/drops4/I20150426-2000/testResults.php#PluginsErrors
Comment 1 Markus Keller CLA 2015-04-27 09:01:09 EDT
(In reply to Markus Keller from comment #0)
> Something like this:

Or maybe better something like this, which would be better aligned with -warn:+invalidJavadocVisibility(<visibility>):

-warn:-suppressToken(<tokens>)
... where <tokens> is a comma-separated list of @SuppressWarnings tokens that should be active (with +suppressToken) or inactive (with -suppressToken).