Project: JDT
Bug 349782 [quick assist] "Convert to enhanced for loop" isn't available for loops over array with prefix increment
Reported: 2011-06-20 01:33:58 | Status: resolved fixed

Build Identifier: M20110210-1200 public static void main(String[] args) { for (int i = 0; i < args.length; ++i) { // "Convert to enhanced for loop" refactoring should be available on this line String arg = args[i]; System.out.println(arg); } for (int i = 0; i < args.length; ++i) { String arg = args[i]; System.out.println(arg); } } Reproducible: Always Steps to Reproduce: 1. Paste example function to some class. 2. Open suggestion window on for loop header (Ctrl-1). 3. Expected: "Convert to enhanced for loop" command is in list of suggestions, actual: It isn't.

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