Project: JDT
Bug 423689 [quick fix] Create 'for' loop for int array creates duplicate local variable
Reported: 2013-12-10 07:17:27 | Status: verified fixed

package com.test; public class C1 { private int[] nums; private void foo() { nums } } ------------------------------------------ In the above example, hover over 'nums' in foo() and apply the quick fix "Create 'for' loop". It results in the following code: for (int i = 0; i < nums.length; i++) { int i = nums[i]; } The local variable 'i' is duplicate and has compilation error.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/IProposalRelevance.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/GenerateForLoopAssistProposal.java