Community
Participate
Working Groups
task-using_batch_compiler.htm said that the "-warn:+unused" command-line argument would also include unusedAllocation, but the code in org.eclipse.jdt.internal.compiler.batch.Main doesn't do that. In contrast, @SuppressWarnings("unused") does suppress unused allocation warnings. I've fixed the documentation with bug 391643. To help the team avoid such mistakes in the future, also sort the options alphabetically in the code. Then it becomes trivial to always update the documentation at the same time something is changed in the Main class.
Markus, if I understand it correctly, this bug is only to sort the options in the code, isn't it?
No, I should have repeated the summary in the description: "-warn:+unused" should include unusedAllocation. It was just too late for code changes when I discovered this, so the best "solution" at that time was to adapt the documentation to the reality. The fix should: - sort the options in the code - add OPTION_ReportUnusedObjectAllocation to the "unused" macro - re-add "unusedAllocation" to the "unused" macro in task-using_batch_compiler.htm
(In reply to comment #2) > No, I should have repeated the summary in the description: "-warn:+unused" > should include unusedAllocation. It was just too late for code changes when > I discovered this, so the best "solution" at that time was to adapt the > documentation to the reality. Ah, I see. I assumed you were just happy with the documentation being adjusted to reflect the current behavior. Anyway, thanks for clarifying.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
New Gerrit change created: https://git.eclipse.org/r/150560
(In reply to Eclipse Genie from comment #5) > New Gerrit change created: https://git.eclipse.org/r/150560 unusedAllocation wasn't the only thing that ran out of sync. So, I sorted sub-options of "unused" in - CompilerOptions.warningTokenFromIrritant(int) - o.e.j.i.compiler.batch.Main.handleErrorOrWarningToken(String, boolean, int) I used the former as the master and added in the latter (batch compiler): + OPTION_ReportDeadCode + OPTION_ReportRedundantSuperinterface + OPTION_ReportUnusedExceptionParameter *********************** Now for some good news: *********************** With these changes BatchCompilerTest begged for reverting some changes: from "At least one of the problems in category 'unused' is not analysed due to a compiler option being ignored\n" + back to "Unnecessary @SuppressWarnings(\"unused\")\n" + Woohooo :)
Documentation update is https://git.eclipse.org/c/platform/eclipse.platform.common.git/commit/?id=0341904883591de55f8e61a4fb37587322b4dc05
Gerrit change https://git.eclipse.org/r/150560 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=9f7623dbf89718c901b626f8024cbc33b5147b6e
(In reply to Eclipse Genie from comment #8) > Gerrit change https://git.eclipse.org/r/150560 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > ?id=9f7623dbf89718c901b626f8024cbc33b5147b6e Code changes released for 4.14 M1
Verified with ecj-I20191009-0600.jar for Eclipse 4.14 M1