Bug 200920 - [templates] Provide collection iterator template for java 1.5
Summary: [templates] Provide collection iterator template for java 1.5
Status: RESOLVED DUPLICATE of bug 102747
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-23 06:20 EDT by Benno Baumgartner CLA
Modified: 2007-08-23 11:10 EDT (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 Benno Baumgartner CLA 2007-08-23 06:20:56 EDT
I20070821-0800

A 'for' template to iterate over parameterized collection should be added:

for (Iterator<${type:argType(collection, 0)}> ${iter:newName(java.util.Iterator)} = ${collection:var(java.util.Collection)}.iterator(); ${iter}.hasNext(); ) {
	${type} ${name:newName(type)} = ${iter}.next();
	${cursor}
}

The advances over the existing 'for' template is that it
- Does not use Iterator as raw type
- Does not make cast to element type

We can either add this to the java context or add a new 'Java 1.5' context which only shows proposals if project is a 1.5+ project.
Comment 1 Dani Megert CLA 2007-08-23 11:10:12 EDT

*** This bug has been marked as a duplicate of bug 95787 ***
Comment 2 Dani Megert CLA 2007-08-23 11:10:49 EDT

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