| Summary: | Enhanced For Loop cleanup causes compile errors | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jeramyn Feucht <jfeucht> | ||||
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
| Status: | CLOSED DUPLICATE | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | markus.kell.r, Olivier_Thomann | ||||
| Version: | 3.6 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 163048 [details]
Save this file with enhanced for loop cleanup to demonstrate
Example java code that will trigger the bug in the cleanup.
Moving to JDT/UI *** This bug has been marked as a duplicate of bug 260626 *** |
Build Identifier: I20090611-1540 Also checked in 20100318-1801 The following code will break after a code cleanup for enhanced for loops, the cleanup should skip this code. private static void function1() { List<String> data=new ArrayList<String>(); for (Iterator<String> iterator = data.iterator(); iterator.hasNext();) { String row = iterator.next(); // Put a horizontal rule between each record function2(iterator.hasNext()); } } private static void function2(boolean b){ //Do nothing } Reproducible: Always Steps to Reproduce: 1. Turn on the code clean-up "Convert for loops to enhanced for loops" on save. 2. Edit the code in the test case. 3. Save.