Community
Participate
Working Groups
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?
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.
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)).
New Gerrit change created: https://git.eclipse.org/r/94926
(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.
Gerrit change https://git.eclipse.org/r/94926 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.common.git/commit/?id=00d5da1aa00b07712183f2b626b81462f6711697
(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.
(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.
New Gerrit change created: https://git.eclipse.org/r/95121
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
(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?
(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.
Gerrit change https://git.eclipse.org/r/95121 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.common.git/commit/?id=ce9c88b90673bed7c6f99e1c8b34854a3b0e9e1a
Released the updated documentation as a table.
Verified in I20170530-2000.