Project: JDT
Bug 156513 [Clean Up] Body of converted for loop is removed
Reported: 2006-09-07 09:40:46 | Status: resolved fixed

I20060905-1250 Given: package test; public class E { public void foo(boolean b, int[] is) { if (b) { for (int i = 0; i < is.length; i++) bar(is[i]); } } private void bar(int i) {} } 1. Enable clean ups - Remove blocks - Convert to enhanced for loop 2. Run Source>Clean Up Is: if (b) for (int i = 0; i < is.length; i++) Should if (b) for (int element : is) bar(element);

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/ControlStatementsFix.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertForLoopOperation.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java