You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2017/08/25 23:39:41 UTC
[15/19] incubator-freemarker git commit: Allowed Iterable constructor
parameter for SimpleCollection
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
Commit: 3531b06e9e9f1cf730470d886ade505003f31cd9
Parents: e395401
Author: ddekany <dd...@apache.org>
Authored: Sat Aug 26 00:28:02 2017 +0200
Committer: ddekany <dd...@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);
}
/**