freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [3/6] incubator-freemarker git commit: Allowed Iterable constructor parameter for SimpleCollection
Date Fri, 25 Aug 2017 23:38:16 GMT
Allowed Iterable constructor parameter for SimpleCollection


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/3531b06e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/3531b06e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/3531b06e

Branch: refs/heads/2.3-gae
Commit: 3531b06e9e9f1cf730470d886ade505003f31cd9
Parents: e395401
Author: ddekany <ddekany@apache.org>
Authored: Sat Aug 26 00:28:02 2017 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Sat Aug 26 00:28:02 2017 +0200

----------------------------------------------------------------------
 .../freemarker/template/SimpleCollection.java   | 23 ++++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3531b06e/src/main/java/freemarker/template/SimpleCollection.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/SimpleCollection.java b/src/main/java/freemarker/template/SimpleCollection.java
index aa67ef1..b29c110 100644
--- a/src/main/java/freemarker/template/SimpleCollection.java
+++ b/src/main/java/freemarker/template/SimpleCollection.java
@@ -43,7 +43,7 @@ implements TemplateCollectionModel, Serializable {
     
     private boolean iteratorOwned;
     private final Iterator iterator;
-    private final Collection collection;
+    private final Iterable iterable;
 
     /**
      * @deprecated Use {@link #SimpleCollection(Iterator, ObjectWrapper)}
@@ -51,27 +51,32 @@ implements TemplateCollectionModel, Serializable {
     @Deprecated
     public SimpleCollection(Iterator iterator) {
         this.iterator = iterator;
-        collection = null;
+        iterable = null;
     }
 
     /**
-     * @deprecated Use {@link #SimpleCollection(Collection, ObjectWrapper)}
+     * @param iterable Note that this was a {@link Collection} before 2.3.27, not an {@link
Iterable}
+     *
+     * @deprecated Use {@link #SimpleCollection(Iterable, ObjectWrapper)}
      */
     @Deprecated
-    public SimpleCollection(Collection collection) {
-        this.collection = collection;
+    public SimpleCollection(Iterable iterable) {
+        this.iterable = iterable;
         iterator = null;
     }
 
     public SimpleCollection(Iterator iterator, ObjectWrapper wrapper) {
         super(wrapper);
         this.iterator = iterator;
-        collection = null;
+        iterable = null;
     }
 
-    public SimpleCollection(Collection collection, ObjectWrapper wrapper) {
+    /**
+     * @param iterable Note that this was a {@link Collection} before 2.3.27, not an {@link
Iterable}
+     */
+    public SimpleCollection(Iterable iterable, ObjectWrapper wrapper) {
         super(wrapper);
-        this.collection = collection;
+        this.iterable = iterable;
         iterator = null;
     }
 
@@ -87,7 +92,7 @@ implements TemplateCollectionModel, Serializable {
     public TemplateModelIterator iterator() {
         return iterator != null
                 ? new SimpleTemplateModelIterator(iterator, false)
-                : new SimpleTemplateModelIterator(collection.iterator(), true);
+                : new SimpleTemplateModelIterator(iterable.iterator(), true);
     }
     
     /**


Mime
View raw message