| Summary: | [templates] for iterate over collection should use generics | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Hannes Niederhausen <hniederhausen> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r |
| Version: | 3.8 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 357408 *** *** This bug has been marked as a duplicate of bug 102747 *** |
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