freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [13/19] incubator-freemarker git commit: Error message fix for ?chunk
Date Fri, 25 Aug 2017 23:39:39 GMT
Error message fix for ?chunk


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

Branch: refs/heads/2.3
Commit: 0213afa5f5d154db1bde5c1d74d2d206eff14877
Parents: 05dc385
Author: ddekany <ddekany@apache.org>
Authored: Fri Aug 25 23:48:18 2017 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Fri Aug 25 23:48:18 2017 +0200

----------------------------------------------------------------------
 src/main/java/freemarker/core/BuiltInsForSequences.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0213afa5/src/main/java/freemarker/core/BuiltInsForSequences.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/BuiltInsForSequences.java b/src/main/java/freemarker/core/BuiltInsForSequences.java
index 609f53e..eca5fec 100644
--- a/src/main/java/freemarker/core/BuiltInsForSequences.java
+++ b/src/main/java/freemarker/core/BuiltInsForSequences.java
@@ -64,6 +64,9 @@ class BuiltInsForSequences {
             public Object exec(List args) throws TemplateModelException {
                 checkMethodArgCount(args, 1, 2);
                 int chunkSize = getNumberMethodArg(args, 0).intValue();
+                if (chunkSize < 1) {
+                    throw new _TemplateModelException("The 1st argument to ?", key, " (...)
must be at least 1.");
+                }
                 
                 return new ChunkedSequence(
                         tsm,
@@ -85,9 +88,6 @@ class BuiltInsForSequences {
             private ChunkedSequence(
                     TemplateSequenceModel wrappedTsm, int chunkSize, TemplateModel fillerItem)
                     throws TemplateModelException {
-                if (chunkSize < 1) {
-                    throw new _TemplateModelException("The 1st argument to ?', key, ' (...)
must be at least 1.");
-                }
                 this.wrappedTsm = wrappedTsm;
                 this.chunkSize = chunkSize;
                 this.fillerItem = fillerItem;


Mime
View raw message