Community
Participate
Working Groups
Given: private void myMethod() { methodWithUunusedParam(123); } private void methodWithUunusedParam(int unused) { } When: Clicking on "Remove 'unused', keep assignments with side effects" Then: private void myMethod() { methodWithUunusedParam(123); ^^^ } private void methodWithUunusedParam() { } Compilation error. When a method parameter (let's name it 'x') is not used in the method body, there is the warning "The value of the parameter x is not used". 5 quickfixes are available. The first one is "Remove 'x', keep assignments with side effects". If you click on the quickfix, the parameter is removed on the method signature but the method calls are not updated. In other words, the values passed as the parameter are still passed and the signature of the call becomes wrong. Currently, if a user wants to use this quickfix, the user should rather right-click on the method, click on Refactor -> Change the Method Signature... -> Select the parameter, click on remove and click on OK. Doing so, so behavior is correct. The quickfix should do the same. It should refactor the whole project. It seems that the code should be edited here: https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.core.manipulation/core%20extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFixCore.java?id=c63ac951840bb1149dd72111d963b0129d9df235#n225
ping!
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.