webwork/src/main/webwork/util IteratorFilterSupport.java,1.8,1.9
[email protected] Fri, 31 Oct 2003 22:38:27 -0800
| Newsgroups | gmane.comp.java.open-symphony.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/opensymphony/webwork/src/main/webwork/util
In directory sc8-pr-cvs1:/tmp/cvs-serv21252/src/main/webwork/util
Modified Files:
IteratorFilterSupport.java
Log Message:
Use MakeIterator.convert, same as the iterator tag for consistency (WW-227)
Index: IteratorFilterSupport.java
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/main/webwork/util/IteratorFilterSupport.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- IteratorFilterSupport.java 8 May 2002 20:39:38 -0000 1.8
+++ IteratorFilterSupport.java 1 Nov 2003 06:38:23 -0000 1.9
@@ -6,10 +6,7 @@
*/
package webwork.util;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.Enumeration;
-import java.util.Map;
import java.util.Iterator;
/**
@@ -23,20 +20,7 @@
// Protected implementation --------------------------------------
protected Object getIterator(Object source)
{
- if(source instanceof Map)
- {
- // Make sure it is iterable
- source = ((Map)source).entrySet();
- } else if(source instanceof Collection)
- {
- // Transform collection to iterator
- source = ((Collection)source).iterator();
- } else if(source instanceof Enumeration)
- {
- // Transform enumeration to iterator
- return new EnumerationIterator((Enumeration)source);
- }
- return source;
+ return MakeIterator.convert(source);
}
// Wrapper for enumerations
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/