Bug 508228 - Transparence for the relation between @SuppressWarnings tokens and compiler options
Summary: Transparence for the relation between @SuppressWarnings tokens and compiler o...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Doc (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.7 RC1   Edit
Assignee: Noopur Gupta CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2016-11-26 06:57 EST by Stephan Herrmann CLA
Modified: 2017-05-31 05:29 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2016-11-26 06:57:00 EST
Following bug 506888 I feel that users don't have a fair chance to fully understand which compiler options correlate to which @SuppressWarnings tokens.

Possible directions for improvement:

(0) Let the quick fix proposed in bug 506888 cover *all* relevant ignored options, either by offering multiple quick fixes (one per option) or by supporting multi-highlighting in the preferences page (not sure if the latter is technically feasible).

(1) Create detailed cross-references between the following help pages:
- reference/preferences/java/compiler/ref-preferences-errors-warnings.htm
- tasks/task-suppress_warnings.htm
Currently neither page refers to the other

(2) Add an optional column to the Errors/Warnings properties page: "suppressable by warning token" (or "controlled by ...").

(3) Add help references from Errors/Warnings page to task-suppress_warnings.htm (the other page is already linked)

Those options are of course not exclusive, maybe we should actually do all of the above.

Since maintaining all this information in help pages is becoming cumbersome, we may even want to think of some automated validation ...


What do others think?
Comment 1 Dani Megert CLA 2017-01-19 07:39:32 EST
I agree we need to do something here.

Currently when using the example from bug 506888 comment 0, one gets this info:
"
At least one of the problems in category 'unused' is not analysed due to a compiler option being ignored
"

1) The message should not say "At least..." but "The following option/options ...:
- option 1
- option 2
...

2) The 'Configure problem severity' quick fix goes to the first option that should be enabled and (in the 'unused' case) the second time to the second option, and so on. This is frustrating for the user, and it is also wrong: The quick fix should go to the (new) option where I can change the severity of the above issued info.
==> We need an option for that.

3) From a user perspective, the only way to get rid of the info message is to set it to 'Ignore' (see above) or set all related options to either warning or error. So, we could offer two quick fixes:
Set all related options to 'Warning'
Set all related options to 'Error'

4) Adding the relations to the doc seems useful to me.


I would not start to mess with the preference dialog.
Comment 2 Stephan Herrmann CLA 2017-01-19 07:53:30 EST
At a second look, I guess my proposal (0) and also Dani's proposals (1)-(3) all belong in bug 506888, they don't improve the general transparence of the mapping between options and @SW tokens.

My proposal (2) (which I still like) is rejected by Dani, so here we're basically left with a call for improving documentation (my proposals (1) and (3)).
Comment 3 Eclipse Genie CLA 2017-04-12 09:09:07 EDT
New Gerrit change created: https://git.eclipse.org/r/94926
Comment 4 Noopur Gupta CLA 2017-04-12 09:14:37 EDT
(In reply to Stephan Herrmann from comment #2)
> My proposal (2) (which I still like) is rejected by Dani, so here we're
> basically left with a call for improving documentation (my proposals (1) and
> (3)).

(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/94926

The Gerrit patch adds help page references to improve the documentation. Please let me know if it can be improved further.
Comment 6 Dani Megert CLA 2017-04-13 06:08:06 EDT
(In reply to Noopur Gupta from comment #4)
> (In reply to Stephan Herrmann from comment #2)
> > My proposal (2) (which I still like) is rejected by Dani, so here we're
> > basically left with a call for improving documentation (my proposals (1) and
> > (3)).
> 
> (In reply to Eclipse Genie from comment #3)
> > New Gerrit change created: https://git.eclipse.org/r/94926
> 
> The Gerrit patch adds help page references to improve the documentation.
> Please let me know if it can be improved further.

This links the documents together.

There's still no documentation that maps @SuppressWarnings tokens and compiler options.
Comment 7 Noopur Gupta CLA 2017-04-13 07:35:23 EDT
(In reply to Dani Megert from comment #6)
> (In reply to Noopur Gupta from comment #4)
> > (In reply to Stephan Herrmann from comment #2)
> > > My proposal (2) (which I still like) is rejected by Dani, so here we're
> > > basically left with a call for improving documentation (my proposals (1) and
> > > (3)).
> > 
> > (In reply to Eclipse Genie from comment #3)
> > > New Gerrit change created: https://git.eclipse.org/r/94926
> > 
> > The Gerrit patch adds help page references to improve the documentation.
> > Please let me know if it can be improved further.
> 
> This links the documents together.
> 
> There's still no documentation that maps @SuppressWarnings tokens and
> compiler options.

Based on my understanding, that would be similar to (2) in the reverse direction in the Help pages. 

We can convert the tokens list in task-suppress_warnings.htm to a table with columns "Token", "Description" and a new column "Suppressed compiler option". 

I am not sure if the mapping is described anywhere so I will go through the compiler options and create it.
Comment 8 Eclipse Genie CLA 2017-04-17 09:30:13 EDT
New Gerrit change created: https://git.eclipse.org/r/95121
Comment 9 Noopur Gupta CLA 2017-04-17 09:32:30 EDT
This is the list of tokens from the task-suppress_warnings.htm page and the corresponding compiler option(s) that I could find from the Java Compile Errors/Warnings preferences page. 

Stephan, could you please have a look at it?

Also, converted this to a table in the above Gerrit patch.

- all: All compiler options
- boxing: Boxing and unboxing conversions
- cast: Unnecessary cast or 'instanceof' operation
- dep-ann: Missing '@Deprecated' annotation
- deprecation: Deprecated API
- fallthrough: 'switch' case fall-through
- finally: 'finally' does not complete normally
- hiding: Local variable declaration hides another field or variable
- incomplete-switch: Incomplete 'switch' cases on enum
- javadoc: All options in ../reference/preferences/java/compiler/ref-preferences-javadoc.htm
- nls: Non-externalized strings
- null: All options in ../reference/preferences/java/compiler/ref-preferences-errors-warnings.htm#null_analysis
- rawtypes: Usage of a raw type
- resource: Resource leak, Potential resource leak, Resource not managed via try-with-resource 
- restriction: Forbidden reference (access rules), Discouraged reference (access rules) 
- serial: Serializable class without serialVersionUID
- static-access: Non-static access to a static member, Indirect access to a static member
- static-method: Method can be static, Method can potentially be static
- super
- synthetic-access
- sync-override: Missing synchronized modifier on inherited method 
- unchecked: Unchecked generic type operation
- unqualified-field-access: Unqualified access to instance field
- unused: Dead code, Unused object allocation, Value of local variable is not used, Value of method parameter is not used, Value of exception parameter is not used, Unused type parameter, Unused import, Unused private member, Unused 'break' or 'continue' label
Comment 10 Stephan Herrmann CLA 2017-04-18 17:04:56 EDT
(In reply to Noopur Gupta from comment #9)
> This is the list of tokens from the task-suppress_warnings.htm page and the
> corresponding compiler option(s) that I could find from the Java Compile
> Errors/Warnings preferences page. 
> 
> Stephan, could you please have a look at it?

Sure! Hope a few days of delay are OK?
Comment 11 Noopur Gupta CLA 2017-04-19 02:06:12 EDT
(In reply to Stephan Herrmann from comment #10)
> (In reply to Noopur Gupta from comment #9)
> > This is the list of tokens from the task-suppress_warnings.htm page and the
> > corresponding compiler option(s) that I could find from the Java Compile
> > Errors/Warnings preferences page. 
> > 
> > Stephan, could you please have a look at it?
> 
> Sure! Hope a few days of delay are OK?

Yes, thanks.
Comment 13 Noopur Gupta CLA 2017-05-15 05:08:41 EDT
Released the updated documentation as a table.
Comment 14 Noopur Gupta CLA 2017-05-31 05:29:28 EDT
Verified in I20170530-2000.