Bug 254858 - [5.0][templates] Iterate over collection template should be generic-aware
Summary: [5.0][templates] Iterate over collection template should be generic-aware
Status: RESOLVED DUPLICATE of bug 102747
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-11 06:26 EST by Benjamin Muskalla CLA
Modified: 2008-11-11 06:43 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Muskalla CLA 2008-11-11 06:26:26 EST
N20081025-2000 and HEAD

With this snippet and the "for - iterate over collection" template:

package p;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class E {

	public void foo() {
		List<Runnable> foo = new ArrayList<Runnable>();
		for|			
		}
	}
}

results in the following:
List<Runnable> foo = new ArrayList<Runnable>();
for (Iterator iterator = foo.iterator(); iterator.hasNext();) {
	Runnable runnable = (Runnable) iterator.next();
		
}

In my eyes it should result in the following:
List<Runnable> foo = new ArrayList<Runnable>();
for (Iterator<Runnable> iterator = foo.iterator(); iterator.hasNext();) {
	Runnable runnable = iterator.next();
						
}
Comment 1 Dani Megert CLA 2008-11-11 06:42:53 EST

*** This bug has been marked as a duplicate of bug 102747 ***