Project: JDT
Bug 224557 [quick fix] does not remove mutiple assignments with side effects
Reported: 2008-03-28 06:40:54 | Status: resolved fixed

Build ID: I20070625-1500 Steps To Reproduce: 1. Build Test.java described below: public class Test { public void test() { int i = new Integer(10); int j = new Integer(20); } } Then, two warnings are displayed in Problems view. The local variable i is never read Test.java line 3 The local variable j is never read Test.java line 4 2. Select the first problem in Problems view, and select 'Quick Fix' from the popup menu. 3. In the Quick Fix dialog, select "Remove 'i', keep side-effect assignments". 4. Press 'Find Similar Problems' and press 'Select All' to select all the two problems. 5. Press 'Finish'. However, the two lines are not deleted. More information: If you do not press 'Select All' in Step 4, that is, if you try to fix only one problem, the problem is fixed correctly. If you do not use unboxing, like: int i = 10; int j = 20; then, the above steps work correctly.

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java