Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 221767

Summary: [quick fix] Foreach needs quick fix for type mismatch
Product: [Eclipse Project] JDT Reporter: Luke Hutchison <luke.hutch>
Component: UIAssignee: Martin Aeschlimann <martinae>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: markus.kell.r, martinae, ullenboom
Version: 3.4   
Target Milestone: 3.4 M6   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Luke Hutchison CLA 2008-03-06 17:54:01 EST
Build ID: M20080221-1800

Steps To Reproduce:
If the type of a variable declared in a loop is wrong, there should be a quick fix to change it to the right type, to be consistent with the behavior of Eclipse in other contexts.

For example:

ArrayList<String> myList = ...
for (Integer val : myList|) {

}

This should offer the choice to change val to type String etc.

See also bug 167472, it seems like there are no quick fixes implemented in the foreach context yet.

Thanks!


More information:
Comment 1 Martin Aeschlimann CLA 2008-03-17 20:37:37 EDT
*** Bug 190208 has been marked as a duplicate of this bug. ***
Comment 2 Martin Aeschlimann CLA 2008-03-17 20:41:08 EDT
*** Bug 102844 has been marked as a duplicate of this bug. ***
Comment 3 Martin Aeschlimann CLA 2008-03-17 20:45:41 EDT
fixed > 20080317