Bug 357910 - [templates] for iterate over collection should use generics
Summary: [templates] for iterate over collection should use generics
Status: CLOSED DUPLICATE of bug 102747
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 04:14 EDT by Hannes Niederhausen CLA
Modified: 2011-09-16 08:33 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Niederhausen CLA 2011-09-16 04:14:52 EDT
Build Identifier: 20110615-0604

The template should use Generics.
A possible template specification would be:

for (${iteratorType:newType(java.util.Iterator)}<${type:elemType(collection)}> ${iterator} = ${collection}.iterator(); ${iterator}.hasNext(); ) {
	${type:elemType(collection)} ${name:newName(type)} = ${iterator}.next();
	${cursor}
}

This would produce a for loop with an iterator using the type and no cast in the  block.

Reproducible: Always

Steps to Reproduce:
1. type for
2. press CTRL-Space
3. Use the template
Comment 1 Dani Megert CLA 2011-09-16 07:46:12 EDT

*** This bug has been marked as a duplicate of bug 357408 ***
Comment 2 Markus Keller CLA 2011-09-16 08:33:00 EDT

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