Bug 301452

Summary: Make unnecessary @SuppressWarnings sensitive to compiler settings
Product: [Eclipse Project] JDT Reporter: John Arthorne <john.arthorne>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: Olivier_Thomann
Version: 3.5   
Target Milestone: 3.6 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description John Arthorne CLA 2010-02-01 14:24:50 EST
The "unnecessary @SuppressWarnings" warning is currently difficult to use because it is sensitive to the particular compiler settings at the time of compilation. This means everyone who is browsing or working with a particular piece of code must use the same compiler settings, or else suffer from "unnecessary @SuppressWarnings" warnings.

For example, if user 1 has set usage of raw types to be "warning", and user 2 has set usage of raw types to "ignore" or "error", then it is impossible for both users to have warning-free code containing a raw reference (if @SuppressWarnings is added then user 2 has a compiler warning, and without it user 1 will have a warning). We keep getting bitten by this in p2 because we like to have more strict warning levels in our workspaces than we have in the formal build.

This request is to make the "unnecessary @SuppressWarnings" warning consistent with the warning settings on the project. I.e., only flag "unnecessary @SuppressWarnings" for problem type X if X has a severity level of "warning" in the compiler settings. If the severity for problem type X is "error" or "info", then simply ignore any @SuppressWarnings annotation for that problem type. If you're ignoring the warning it's reasonable to ignore the warning about the warning...
Comment 1 Olivier Thomann CLA 2010-03-18 13:16:28 EDT
We added support to use SuppressWarnings to remove error or warnings. This is the best we can do in this case. We cannot detect that a SuppressWarning would be used if some warning are enabled for the corresponding scope. This is simply because the warnings are not reported at all.
Changing that would have a performance impact.
Closing as WONTFIX.
Comment 2 Frederic Fusier CLA 2010-04-26 13:03:53 EDT
Verified for 3.6M7