Project: JDT
Bug 160312 [clean up] Compile error after converting nested for loops without block
Reported: 2006-10-10 10:07:17 | Status: verified fixed

N20061010-0010 Given: package test1; public class E1 { void foo(Object[] x, Object[] y) { for (int i = 0; i < y.length; i++) for (int j = 0; j < x.length; j++) System.out.println(y[i]); } } Clean Ups: - Convert control statement bodies to block - Convert for loops to enhanced for loops Is: for (Object element : y) { for (int j = 0; j < x.length; j++) } } Should: for (Object element : y) { for (Object element1 : x) { System.out.println(element1); } }

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertForLoopOperation.java