tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44284] New: - Support java.lang.Iterable in c:forEach tag
Date Wed, 23 Jan 2008 13:18:51 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44284>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44284

           Summary: Support java.lang.Iterable in c:forEach tag
           Product: Tomcat 6
           Version: 6.0.14
          Platform: Other
        OS/Version: other
            Status: NEW
          Keywords: PatchAvailable
          Severity: enhancement
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: james@jsptags.com


---
apache-tomcat-6.0.10-src/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
  Tue Feb 13 05:04:52 2007
+++ webapp/WEB-INF/classes/org/apache/jasper/tagplugins/jstl/core/ForEach.java 
Fri Mar  2 09:07:07 2007
@@ -137,9 +137,9 @@
         ctxt.generateJavaSource("else if (" + itemsV + " instanceof double[])");
         ctxt.generateJavaSource(iterV + "=toIterator((double[])" + itemsV + ");");
         
-        // Collection
-        ctxt.generateJavaSource("else if (" + itemsV + " instanceof Collection)");
-        ctxt.generateJavaSource(iterV + "=((Collection)" + itemsV +
").iterator();");
+        // Iterable
+        ctxt.generateJavaSource("else if (" + itemsV + " instanceof Iterable)");
+        ctxt.generateJavaSource(iterV + "=((Iterable)" + itemsV + ").iterator();");
         
         // Iterator
         ctxt.generateJavaSource("else if (" + itemsV + " instanceof Iterator)");





---
jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/core/ForEachSupport.java
       Tue Aug 29 01:13:06 2006
+++
webapp/WEB-INF/classes/org/apache/taglibs/standard/tag/common/core/ForEachSupport.java
     Fri Mar  2 09:21:06 2007
@@ -17,7 +17,6 @@
 package org.apache.taglibs.standard.tag.common.core;
 
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.Map;
@@ -201,8 +200,8 @@
             items = toForEachIterator((float[]) o);
         else if (o instanceof double[])
             items = toForEachIterator((double[]) o);
-        else if (o instanceof Collection)
-            items = toForEachIterator((Collection) o);
+        else if (o instanceof Iterable)
+            items = toForEachIterator((Iterable) o);
         else if (o instanceof Iterator)
             items = toForEachIterator((Iterator) o);
         else if (o instanceof Enumeration)
@@ -324,8 +323,8 @@
         return new SimpleForEachIterator(Arrays.asList(wrapped).iterator());
     }
 
-    // retrieves an iterator from a Collection
-    protected ForEachIterator toForEachIterator(Collection c) {
+    // retrieves an iterator from a Iterable
+    protected ForEachIterator toForEachIterator(Iterable c) {
         return new SimpleForEachIterator(c.iterator());
     }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message