freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/3] incubator-freemarker git commit: Renamed `TemplateScalarModel` to `TemplateStringModel`. (The `TemplateScalarModel` name come from the early FM, where there where strings, numbers, booleans, etc. weren't separated.)
Date Sun, 20 Aug 2017 22:08:43 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 888ebe114 -> 999afd28d


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/MessageUtils.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/MessageUtils.java b/freemarker-core/src/main/java/org/apache/freemarker/core/MessageUtils.java
index 21f7876..b8354d7 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/MessageUtils.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/MessageUtils.java
@@ -25,7 +25,7 @@ import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateMarkupOutputModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.util.BugException;
 import org.apache.freemarker.core.util.TemplateLanguageUtils;
@@ -65,7 +65,7 @@ class MessageUtils {
     static final String STRING_COERCABLE_TYPES_DESC
             = "string or something automatically convertible to string (number, date or boolean)";
     static final Class[] EXPECTED_TYPES_STRING_COERCABLE = new Class[] {
-        TemplateScalarModel.class, TemplateNumberModel.class, TemplateDateModel.class, TemplateBooleanModel.class
+        TemplateStringModel.class, TemplateNumberModel.class, TemplateDateModel.class, TemplateBooleanModel.class
     };
 
     static final String STRING_COERCABLE_TYPES_OR_TOM_DESC

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/NativeHashEx2.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/NativeHashEx2.java b/freemarker-core/src/main/java/org/apache/freemarker/core/NativeHashEx2.java
index 526bf6b..a7b2415 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/NativeHashEx2.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/NativeHashEx2.java
@@ -28,7 +28,7 @@ import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateHashModelEx2;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 
 /**
  * A hash where each value is already a {@link TemplateModel}, so no {@link ObjectWrapper} need to be specified.
@@ -76,7 +76,7 @@ class NativeHashEx2 implements TemplateHashModelEx2, Serializable {
 
                     @Override
                     public TemplateModel getKey() throws TemplateException {
-                        return new SimpleScalar(entry.getKey());
+                        return new SimpleString(entry.getKey());
                     }
 
                     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringArraySequence.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringArraySequence.java b/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringArraySequence.java
index fedaf66..a74a63e 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringArraySequence.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringArraySequence.java
@@ -23,10 +23,10 @@ import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.impl.DefaultArrayAdapter;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 
 /**
- * Adapts (not copies) a {@link String} array with on-the-fly wrapping of the items to {@link SimpleScalar}-s. The
+ * Adapts (not copies) a {@link String} array with on-the-fly wrapping of the items to {@link SimpleString}-s. The
  * important difference to {@link DefaultArrayAdapter} is that it doesn't depend on an {@link ObjectWrapper}, which is
  * needed to guarantee the behavior of some template language constructs. The important difference to
  * {@link NativeSequence} is that it doesn't need upfront conversion to {@link TemplateModel}-s (performance).
@@ -41,7 +41,7 @@ class NativeStringArraySequence implements TemplateSequenceModel {
 
     @Override
     public TemplateModel get(int index) throws TemplateException {
-        return index < items.length ? new SimpleScalar(items[index]) : null;
+        return index < items.length ? new SimpleString(items[index]) : null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringCollectionCollectionEx.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringCollectionCollectionEx.java b/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringCollectionCollectionEx.java
index cef0e79..78b2099 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringCollectionCollectionEx.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringCollectionCollectionEx.java
@@ -27,11 +27,11 @@ import org.apache.freemarker.core.model.TemplateCollectionModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelIterator;
 import org.apache.freemarker.core.model.impl.DefaultNonListCollectionAdapter;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 
 /**
  * Adapts (not copies) a {@link Collection} of {@link String}-s with on-the-fly wrapping of the items to {@link
- * SimpleScalar}-s. The important difference to {@link DefaultNonListCollectionAdapter} is that it doesn't depend on an
+ * SimpleString}-s. The important difference to {@link DefaultNonListCollectionAdapter} is that it doesn't depend on an
  * {@link ObjectWrapper}, which is needed to guarantee the behavior of some template language constructs. The important
  * difference to {@link NativeCollectionEx} is that it doesn't need upfront conversion to {@link TemplateModel}-s
  * (performance).
@@ -66,7 +66,7 @@ class NativeStringCollectionCollectionEx implements TemplateCollectionModelEx {
                     throw new TemplateException("The collection has no more items.");
                 }
 
-                return new SimpleScalar(iterator.next());
+                return new SimpleString(iterator.next());
             }
 
             @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringListSequence.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringListSequence.java b/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringListSequence.java
index 6adeade..8ab167e 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringListSequence.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/NativeStringListSequence.java
@@ -25,11 +25,11 @@ import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.impl.DefaultListAdapter;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 
 /**
  * Adapts (not copies) a {@link List} of {@link String}-s with on-the-fly wrapping of the items to {@link
- * SimpleScalar}-s. The important difference to {@link DefaultListAdapter} is that it doesn't depend on an {@link
+ * SimpleString}-s. The important difference to {@link DefaultListAdapter} is that it doesn't depend on an {@link
  * ObjectWrapper}, which is needed to guarantee the behavior of some template language constructs. The important
  * difference to {@link NativeSequence} is that it doesn't need upfront conversion to {@link TemplateModel}-s
  * (performance).
@@ -44,7 +44,7 @@ class NativeStringListSequence implements TemplateSequenceModel {
 
     @Override
     public TemplateModel get(int index) throws TemplateException {
-        return index < items.size() ? new SimpleScalar(items.get(index)) : null;
+        return index < items.size() ? new SimpleString(items.get(index)) : null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/_EvalUtils.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/_EvalUtils.java b/freemarker-core/src/main/java/org/apache/freemarker/core/_EvalUtils.java
index 3e21a2b..a8e2ed1 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/_EvalUtils.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/_EvalUtils.java
@@ -31,7 +31,7 @@ import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateMarkupOutputModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.outputformat.MarkupOutputFormat;
 import org.apache.freemarker.core.util.BugException;
@@ -59,7 +59,7 @@ public class _EvalUtils {
     /**
      * @param expr {@code null} is allowed, but may results in less helpful error messages
      */
-    public static String modelToString(TemplateScalarModel model, ASTExpression expr)
+    public static String modelToString(TemplateStringModel model, ASTExpression expr)
     throws TemplateException {
         String value = model.getAsString();
         if (value == null) {
@@ -264,13 +264,13 @@ public class _EvalUtils {
             Date leftDate = _EvalUtils.modelToDate(leftDateModel, leftExp);
             Date rightDate = _EvalUtils.modelToDate(rightDateModel, rightExp);
             cmpResult = leftDate.compareTo(rightDate);
-        } else if (leftValue instanceof TemplateScalarModel && rightValue instanceof TemplateScalarModel) {
+        } else if (leftValue instanceof TemplateStringModel && rightValue instanceof TemplateStringModel) {
             if (operator != CMP_OP_EQUALS && operator != CMP_OP_NOT_EQUALS) {
                 throw new TemplateException(defaultBlamed, env,
                         "Can't use operator \"", cmpOpToString(operator, operatorString), "\" on string values.");
             }
-            String leftString = _EvalUtils.modelToString((TemplateScalarModel) leftValue, leftExp);
-            String rightString = _EvalUtils.modelToString((TemplateScalarModel) rightValue, rightExp);
+            String leftString = _EvalUtils.modelToString((TemplateStringModel) leftValue, leftExp);
+            String rightString = _EvalUtils.modelToString((TemplateStringModel) rightValue, rightExp);
             // FIXME NBC: Don't use the Collator here. That's locale-specific, but ==/!= should not be.
             cmpResult = env.getCollator().compare(leftString, rightString);
         } else if (leftValue instanceof TemplateBooleanModel && rightValue instanceof TemplateBooleanModel) {
@@ -445,8 +445,8 @@ public class _EvalUtils {
             TemplateModel tm, ASTExpression exp, String seqHint, boolean supportsTOM, boolean returnNullOnNonCoercableType,
             Environment env)
             throws TemplateException {
-        if (tm instanceof TemplateScalarModel) {
-            return modelToString((TemplateScalarModel) tm, exp);
+        if (tm instanceof TemplateStringModel) {
+            return modelToString((TemplateStringModel) tm, exp);
         } else if (tm == null) {
             if (exp != null) {
                 throw InvalidReferenceException.getInstance(exp, env);
@@ -456,8 +456,8 @@ public class _EvalUtils {
                         env);
             }
         } else if (tm instanceof TemplateBooleanModel) {
-            // [FM3] This should be before TemplateScalarModel, but automatic boolean-to-string is only non-error since
-            // 2.3.20, so to keep backward compatibility we couldn't insert this before TemplateScalarModel.
+            // [FM3] This should be before TemplateStringModel, but automatic boolean-to-string is only non-error since
+            // 2.3.20, so to keep backward compatibility we couldn't insert this before TemplateStringModel.
             boolean booleanValue = ((TemplateBooleanModel) tm).getAsBoolean();
             return env.formatBoolean(booleanValue, false);
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/debug/DebugModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/debug/DebugModel.java b/freemarker-core/src/main/java/org/apache/freemarker/core/debug/DebugModel.java
index 41d1742..423a533 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/debug/DebugModel.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/debug/DebugModel.java
@@ -37,7 +37,7 @@ import org.apache.freemarker.core.TemplateException;
  * template models are implemented by the mirrored object.
  */
 public interface DebugModel extends Remote {
-    public static final int TYPE_SCALAR        =    1;
+    public static final int TYPE_STRING        =    1;
     public static final int TYPE_NUMBER        =    2;
     public static final int TYPE_DATE          =    4;
     public static final int TYPE_BOOLEAN       =    8;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebugModelImpl.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebugModelImpl.java b/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebugModelImpl.java
index 01becc2..debe879 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebugModelImpl.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebugModelImpl.java
@@ -36,7 +36,7 @@ import org.apache.freemarker.core.model.TemplateHashModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelIterator;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 
 /**
@@ -58,7 +58,7 @@ class RmiDebugModelImpl extends UnicastRemoteObject implements DebugModel {
     }
     @Override
     public String getAsString() throws TemplateException {
-        return ((TemplateScalarModel) model).getAsString();
+        return ((TemplateStringModel) model).getAsString();
     }
 
     @Override
@@ -135,7 +135,7 @@ class RmiDebugModelImpl extends UnicastRemoteObject implements DebugModel {
         List list = new ArrayList();
         TemplateModelIterator i = h.keys().iterator();
         while (i.hasNext()) {
-            list.add(((TemplateScalarModel) i.next()).getAsString());
+            list.add(((TemplateStringModel) i.next()).getAsString());
         }
         return (String[]) list.toArray(new String[list.size()]);
     }
@@ -147,7 +147,7 @@ class RmiDebugModelImpl extends UnicastRemoteObject implements DebugModel {
     
     private static int calculateType(TemplateModel model) {
         int type = 0;
-        if (model instanceof TemplateScalarModel) type += TYPE_SCALAR;
+        if (model instanceof TemplateStringModel) type += TYPE_STRING;
         if (model instanceof TemplateNumberModel) type += TYPE_NUMBER;
         if (model instanceof TemplateDateModel) type += TYPE_DATE;
         if (model instanceof TemplateBooleanModel) type += TYPE_BOOLEAN;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebuggedEnvironmentImpl.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebuggedEnvironmentImpl.java b/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebuggedEnvironmentImpl.java
index af0958a..be2953d 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebuggedEnvironmentImpl.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/debug/RmiDebuggedEnvironmentImpl.java
@@ -43,7 +43,7 @@ import org.apache.freemarker.core.model.TemplateHashModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.core.model.impl.SimpleCollection;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 import org.apache.freemarker.core.util.UndeclaredThrowableException;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -229,11 +229,11 @@ class RmiDebuggedEnvironmentImpl extends RmiDebugModelImpl implements DebuggedEn
         private static final List KEYS = composeList(DebugConfigurableModel.KEYS, 
             Arrays.asList("configuration", "name"));
     
-        private final SimpleScalar name;
+        private final SimpleString name;
 
         DebugTemplateModel(Template template) {
             super(template);
-            name = new SimpleScalar(template.getLookupName());
+            name = new SimpleString(template.getLookupName());
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/GeneralPurposeNothing.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/GeneralPurposeNothing.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/GeneralPurposeNothing.java
index 6a25f09..e3d5c4a 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/GeneralPurposeNothing.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/GeneralPurposeNothing.java
@@ -30,7 +30,7 @@ import org.apache.freemarker.core.TemplateException;
  */
 
 final class GeneralPurposeNothing
-implements TemplateBooleanModel, TemplateScalarModel, TemplateSequenceModel, TemplateHashModelEx2,
+implements TemplateBooleanModel, TemplateStringModel, TemplateSequenceModel, TemplateHashModelEx2,
         TemplateFunctionModel {
 
     public static final TemplateModel INSTANCE = new GeneralPurposeNothing();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx.java
index cd2c0ee..becb3c5 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx.java
@@ -39,7 +39,7 @@ public interface TemplateHashModelEx extends TemplateHashModel {
 
     /**
      * @return a collection containing the keys in the hash. Every element of 
-     *      the returned collection must implement the {@link TemplateScalarModel}
+     *      the returned collection must implement the {@link TemplateStringModel}
      *      (as the keys of hashes are always strings).
      */
     TemplateCollectionModel keys() throws TemplateException;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateMarkupOutputModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateMarkupOutputModel.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateMarkupOutputModel.java
index bd03438..aff8657 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateMarkupOutputModel.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateMarkupOutputModel.java
@@ -31,8 +31,8 @@ import org.apache.freemarker.core.outputformat.OutputFormat;
  * {@link #getOutputFormat()}. See more about how markup output values work at {@link OutputFormat}.
  * 
  * <p>
- * Note that {@link TemplateMarkupOutputModel}-s are by design not treated like {@link TemplateScalarModel}-s, and so
- * the implementations of this interface usually shouldn't implement {@link TemplateScalarModel}. (Because, operations
+ * Note that {@link TemplateMarkupOutputModel}-s are by design not treated like {@link TemplateStringModel}-s, and so
+ * the implementations of this interface usually shouldn't implement {@link TemplateStringModel}. (Because, operations
  * applicable on plain strings, like converting to upper case, substringing, etc., can corrupt markup.) If the template
  * author wants to pass in the "source" of the markup as string somewhere, he should use {@code ?markup_string}.
  * 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java
deleted file mode 100644
index b34b21b..0000000
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.model;
-
-import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-
-/**
- * "string" template language data-type; like in Java, an unmodifiable UNICODE character sequence.
- * (The name of this interface should be {@code TemplateStringModel}. The misnomer is inherited from the
- * old times, when this was the only single-value type in FreeMarker.)
- */
-public interface TemplateScalarModel extends TemplateModel {
-
-    /**
-     * A constant value to use as the empty string.
-     */
-    TemplateModel EMPTY_STRING = new SimpleScalar("");
-
-    /**
-     * Returns the string representation of this model. Don't return {@code null}, as that will cause exception.
-     * 
-     * <p>
-     * Objects of this type should be immutable, that is, calling {@link #getAsString()} should always return the same
-     * value as for the first time.
-     */
-    String getAsString() throws TemplateException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateStringModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateStringModel.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateStringModel.java
new file mode 100644
index 0000000..847bca8
--- /dev/null
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/TemplateStringModel.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.freemarker.core.model;
+
+import org.apache.freemarker.core.TemplateException;
+import org.apache.freemarker.core.model.impl.SimpleString;
+
+/**
+ * "string" template language data-type; like in Java, an unmodifiable UNICODE character sequence.
+ * When a template has to print a value of this class, it will assume that it stores plain text (not HTML, XML, etc.),
+ * and thus it will be possibly auto-escaped. To avoid that, use the appropriate {@link TemplateMarkupOutputModel}
+ * instead.
+ */
+public interface TemplateStringModel extends TemplateModel {
+
+    /**
+     * A constant value to use as the empty string.
+     */
+    TemplateModel EMPTY_STRING = new SimpleString("");
+
+    /**
+     * Returns the {@link String} representation of this model. Returning {@code null} is illegal, and may cause
+     * exception in the calling code.
+     */
+    String getAsString() throws TemplateException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanAndStringModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanAndStringModel.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanAndStringModel.java
index c154bba..4fb931a 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanAndStringModel.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanAndStringModel.java
@@ -19,19 +19,18 @@
 
 package org.apache.freemarker.core.model.impl;
 
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 
 /**
  * Subclass of {@link BeanModel} that exposes the return value of the {@link
- * java.lang.Object#toString()} method through the {@link TemplateScalarModel}
+ * java.lang.Object#toString()} method through the {@link TemplateStringModel}
  * interface.
  */
 // [FM3] Treating all beans as FTL strings was certainly a bad idea in FM2.
-public class BeanAndStringModel extends BeanModel implements TemplateScalarModel {
+public class BeanAndStringModel extends BeanModel implements TemplateStringModel {
 
     /**
-     * Creates a new model that wraps the specified object with BeanModel + scalar
-     * functionality.
+     * Creates a new model that wraps the specified object with BeanModel + string functionality.
      * @param object the object to wrap into a model.
      * @param wrapper the {@link DefaultObjectWrapper} associated with this model.
      * Every model has to have an associated {@link DefaultObjectWrapper} instance. The

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanModel.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanModel.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanModel.java
index 761122f..1b779d5 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanModel.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/BeanModel.java
@@ -43,7 +43,7 @@ import org.apache.freemarker.core.model.TemplateHashModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelIterator;
 import org.apache.freemarker.core.model.TemplateModelWithAPISupport;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -67,7 +67,7 @@ public class BeanModel
     protected final DefaultObjectWrapper wrapper;
     
     // We use this to represent an unknown value as opposed to known value of null (JR)
-    static final TemplateModel UNKNOWN = new SimpleScalar("UNKNOWN");
+    static final TemplateModel UNKNOWN = new SimpleString("UNKNOWN");
 
     // I've tried to use a volatile ConcurrentHashMap field instead of HashMap + synchronized(this), but oddly it was
     // a bit slower, at least on Java 8 u66. 
@@ -77,7 +77,7 @@ public class BeanModel
      * Creates a new model that wraps the specified object. Note that there are
      * specialized subclasses of this class for wrapping arrays, collections,
      * enumeration, iterators, and maps. Note also that the superclass can be
-     * used to wrap String objects if only scalar functionality is needed. You
+     * used to wrap String objects if only {@link TemplateStringModel} functionality is needed. You
      * can also choose to delegate the choice over which model class is used for
      * wrapping to {@link DefaultObjectWrapper#wrap(Object)}.
      * @param object the object to wrap into a model.
@@ -297,7 +297,7 @@ public class BeanModel
         List<Object> values = new ArrayList<>(size());
         TemplateModelIterator it = keys().iterator();
         while (it.hasNext()) {
-            String key = ((TemplateScalarModel) it.next()).getAsString();
+            String key = ((TemplateStringModel) it.next()).getAsString();
             values.add(get(key));
         }
         return new CollectionAndSequence(new SimpleSequence(values, wrapper));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/CharacterOrString.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/CharacterOrString.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/CharacterOrString.java
index 6026011..8fc8f22 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/CharacterOrString.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/CharacterOrString.java
@@ -19,12 +19,12 @@
 
 package org.apache.freemarker.core.model.impl;
 
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 
 /**
  * Represents value unwrapped both to {@link Character} and {@link String}. This is needed for unwrapped overloaded
  * method parameters where both {@link Character} and {@link String} occurs on the same parameter position when the
- * {@link TemplateScalarModel} to unwrapp contains a {@link String} of length 1.
+ * {@link TemplateStringModel} to unwrapp contains a {@link String} of length 1.
  */
 final class CharacterOrString {
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java
index 42e9e1a..ca06017 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java
@@ -63,7 +63,7 @@ import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelAdapter;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
 import org.apache.freemarker.core.util.BugException;
@@ -420,7 +420,7 @@ public class DefaultObjectWrapper implements RichObjectWrapper {
      */
     protected TemplateModel wrapSpecialObject(Object obj) {
         if (obj instanceof String) {
-            return new SimpleScalar((String) obj);
+            return new SimpleString((String) obj);
         }
         if (obj instanceof Number) {
             return new SimpleNumber((Number) obj);
@@ -507,7 +507,7 @@ public class DefaultObjectWrapper implements RichObjectWrapper {
      * method is the inverse of the {@link #wrap(Object)} method. In addition
      * it will unwrap arbitrary {@link TemplateNumberModel} instances into
      * a number, arbitrary {@link TemplateDateModel} instances into a date,
-     * {@link TemplateScalarModel} instances into a String, arbitrary
+     * {@link TemplateStringModel} instances into a String, arbitrary
      * {@link TemplateBooleanModel} instances into a Boolean, arbitrary
      * {@link TemplateHashModel} instances into a Map, arbitrary
      * {@link TemplateSequenceModel} into a List, and arbitrary
@@ -621,8 +621,8 @@ public class DefaultObjectWrapper implements RichObjectWrapper {
 
             // [2.4][IcI]: Should also check for CharSequence at the end
             if (String.class == targetClass) {
-                if (model instanceof TemplateScalarModel) {
-                    return ((TemplateScalarModel) model).getAsString();
+                if (model instanceof TemplateStringModel) {
+                    return ((TemplateStringModel) model).getAsString();
                 }
                 // String is final, so no other conversion will work
                 return ObjectWrapperAndUnwrapper.CANT_UNWRAP_TO_TARGET_CLASS;
@@ -686,8 +686,8 @@ public class DefaultObjectWrapper implements RichObjectWrapper {
 
             // Allow one-char strings to be coerced to characters
             if (char.class == targetClass || targetClass == Character.class) {
-                if (model instanceof TemplateScalarModel) {
-                    String s = ((TemplateScalarModel) model).getAsString();
+                if (model instanceof TemplateStringModel) {
+                    String s = ((TemplateStringModel) model).getAsString();
                     if (s.length() == 1) {
                         return Character.valueOf(s.charAt(0));
                     }
@@ -727,9 +727,9 @@ public class DefaultObjectWrapper implements RichObjectWrapper {
                 }
             }
             if ((itf == 0 || (itf & (TypeFlags.ACCEPTS_STRING | TypeFlags.CHARACTER)) != 0)
-                    && model instanceof TemplateScalarModel
+                    && model instanceof TemplateStringModel
                     && (itf != 0 || targetClass.isAssignableFrom(String.class))) {
-                String strVal = ((TemplateScalarModel) model).getAsString();
+                String strVal = ((TemplateStringModel) model).getAsString();
                 if (itf == 0 || (itf & TypeFlags.CHARACTER) == 0) {
                     return strVal;
                 } else { // TypeFlags.CHAR == 1
@@ -745,7 +745,7 @@ public class DefaultObjectWrapper implements RichObjectWrapper {
                     // It had to be unwrapped to Character, but the string length wasn't 1 => Fall through
                 }
             }
-            // Should be earlier than TemplateScalarModel, but we keep it here until FM 2.4 or such
+            // Should be earlier than TemplateStringModel, but we keep it here until FM 2.4 or such
             if ((itf == 0 || (itf & TypeFlags.ACCEPTS_BOOLEAN) != 0)
                     && model instanceof TemplateBooleanModel
                     && (itf != 0 || targetClass.isAssignableFrom(Boolean.class))) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/SimpleScalar.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/SimpleScalar.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/SimpleScalar.java
deleted file mode 100644
index 388498a..0000000
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/SimpleScalar.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.model.impl;
-
-import java.io.Serializable;
-
-import org.apache.freemarker.core.model.TemplateScalarModel;
-
-/**
- * A simple implementation of the <tt>TemplateScalarModel</tt>
- * interface, using a <tt>String</tt>.
- * As of version 2.0 this object is immutable.
- *
- * <p>This class is thread-safe.
- *
- * @see SimpleSequence
- * @see SimpleHash
- */
-public final class SimpleScalar 
-implements TemplateScalarModel, Serializable {
-    
-    /**
-     * @serial the value of this <tt>SimpleScalar</tt> if it wraps a
-     * <tt>String</tt>.
-     */
-    private final String value;
-
-    /**
-     * Constructs a <tt>SimpleScalar</tt> containing a string value.
-     * @param value the string value. If this is {@code null}, its value in FTL will be {@code ""}.
-     */
-    public SimpleScalar(String value) {
-        this.value = value;
-    }
-
-    @Override
-    public String getAsString() {
-        return (value == null) ? "" : value;
-    }
-
-    @Override
-    public String toString() {
-        // [2.4] Shouldn't return null
-        return value;
-    }
-    
-    /**
-     * Same as calling the constructor, except that for a {@code null} parameter it returns null. 
-     */
-    public static SimpleScalar newInstanceOrNull(String s) {
-        return s != null ? new SimpleScalar(s) : null;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/SimpleString.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/SimpleString.java b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/SimpleString.java
new file mode 100644
index 0000000..8b91452
--- /dev/null
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/model/impl/SimpleString.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.freemarker.core.model.impl;
+
+import java.io.Serializable;
+
+import org.apache.freemarker.core.model.TemplateStringModel;
+
+/**
+ * A simple implementation of the <tt>TemplateStringModel</tt>
+ * interface, using a <tt>String</tt>.
+ *
+ * <p>This class is thread-safe.
+ *
+ * @see SimpleSequence
+ * @see SimpleHash
+ */
+public final class SimpleString
+implements TemplateStringModel, Serializable {
+    
+    /**
+     * @serial the value of this <tt>SimpleString</tt> if it wraps a
+     * <tt>String</tt>.
+     */
+    private final String value;
+
+    /**
+     * Constructs a <tt>SimpleString</tt> containing a string value.
+     * @param value the string value. If this is {@code null}, its value in FTL will be {@code ""}.
+     */
+    public SimpleString(String value) {
+        this.value = value;
+    }
+
+    @Override
+    public String getAsString() {
+        return (value == null) ? "" : value;
+    }
+
+    @Override
+    public String toString() {
+        // [2.4] Shouldn't return null
+        return value;
+    }
+    
+    /**
+     * Same as calling the constructor, except that for a {@code null} parameter it returns null. 
+     */
+    public static SimpleString newInstanceOrNull(String s) {
+        return s != null ? new SimpleString(s) : null;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/util/CallableUtils.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/util/CallableUtils.java b/freemarker-core/src/main/java/org/apache/freemarker/core/util/CallableUtils.java
index 796d082..b3442d9 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/util/CallableUtils.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/util/CallableUtils.java
@@ -41,7 +41,7 @@ import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateFunctionModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 
 /**
@@ -407,15 +407,15 @@ public final class CallableUtils {
 
     /**
      * See {@link #castArgumentValue(TemplateModel, int, Class, boolean, TemplateModel, TemplateCallableModel,
-     * boolean)}; this does the same, but with {@link TemplateScalarModel} as {@code type}, and with {@link String}
+     * boolean)}; this does the same, but with {@link TemplateStringModel} as {@code type}, and with {@link String}
      * return value.
      */
     public static String castArgumentValueToString(
             TemplateModel argValue, int argIdx, boolean optional, String defaultValue,
             TemplateCallableModel callable, boolean calledAsFunction)
             throws TemplateException {
-        if (argValue instanceof TemplateScalarModel) {
-            return _EvalUtils.modelToString((TemplateScalarModel) argValue, null);
+        if (argValue instanceof TemplateStringModel) {
+            return _EvalUtils.modelToString((TemplateStringModel) argValue, null);
         }
         if (argValue == null) {
             if (optional) {
@@ -423,7 +423,7 @@ public final class CallableUtils {
             }
             throw newNullOrOmittedArgumentException(argIdx, callable, calledAsFunction);
         }
-        throw newArgumentValueTypeException(argValue, argIdx, TemplateScalarModel.class, callable, calledAsFunction);
+        throw newArgumentValueTypeException(argValue, argIdx, TemplateStringModel.class, callable, calledAsFunction);
     }
 
     // Number arg:

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java b/freemarker-core/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java
index 599cdea..62bc25d 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java
@@ -33,7 +33,7 @@ import org.apache.freemarker.core.model.TemplateHashModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelIterator;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
 
@@ -52,8 +52,8 @@ public class DeepUnwrap {
      *       of {@link WrapperTemplateModel#getWrappedObject()} is returned.
      *   <li>If the object is identical to the null model of the current object 
      *       wrapper, null is returned. 
-     *   <li>If the object implements {@link TemplateScalarModel}, then the result
-     *       of {@link TemplateScalarModel#getAsString()} is returned.
+     *   <li>If the object implements {@link TemplateStringModel}, then the result
+     *       of {@link TemplateStringModel#getAsString()} is returned.
      *   <li>If the object implements {@link TemplateNumberModel}, then the result
      *       of {@link TemplateNumberModel#getAsNumber()} is returned.
      *   <li>If the object implements {@link TemplateDateModel}, then the result
@@ -105,8 +105,8 @@ public class DeepUnwrap {
         if (model == nullModel) {
             return null;
         }
-        if (model instanceof TemplateScalarModel) {
-            return ((TemplateScalarModel) model).getAsString();
+        if (model instanceof TemplateStringModel) {
+            return ((TemplateStringModel) model).getAsString();
         }
         if (model instanceof TemplateNumberModel) {
             return ((TemplateNumberModel) model).getAsNumber();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/java/org/apache/freemarker/core/util/TemplateLanguageUtils.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/util/TemplateLanguageUtils.java b/freemarker-core/src/main/java/org/apache/freemarker/core/util/TemplateLanguageUtils.java
index 9b980d9..bdb7e93 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/util/TemplateLanguageUtils.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/util/TemplateLanguageUtils.java
@@ -39,7 +39,7 @@ import org.apache.freemarker.core.model.TemplateModelIterator;
 import org.apache.freemarker.core.model.TemplateNodeModel;
 import org.apache.freemarker.core.model.TemplateNodeModelEx;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
 import org.apache.freemarker.core.model.impl.BeanAndStringModel;
@@ -697,7 +697,7 @@ public final class TemplateLanguageUtils {
     /**
      * Returns the type description of a value with FTL terms (not plain class name), as it should be used in
      * type-related error messages and for debugging purposes. The exact format is not specified and might change over
-     * time, but currently it's something like {@code "string (wrapper: f.t.SimpleScalar)"} or
+     * time, but currently it's something like {@code "string (wrapper: f.t.SimpleString)"} or
      * {@code "sequence+hash+string (ArrayList wrapped into f.e.b.CollectionModel)"}.
      *
      * @param tm The value whose type we will describe. If {@code null}, then {@code "Null"} is returned (without the
@@ -819,7 +819,7 @@ public final class TemplateLanguageUtils {
             if (tm instanceof BeanAndStringModel) {
                 Object wrapped = ((BeanModel) tm).getWrappedObject();
                 return wrapped instanceof String
-                        ? TemplateScalarModel.class
+                        ? TemplateStringModel.class
                         : (tm instanceof TemplateHashModelEx ? TemplateHashModelEx.class : null);
             } else {
                 return null;
@@ -884,7 +884,7 @@ public final class TemplateLanguageUtils {
             appendTypeName(sb, typeNamesAppended, "boolean");
         }
 
-        if (TemplateScalarModel.class.isAssignableFrom(cl)) {
+        if (TemplateStringModel.class.isAssignableFrom(cl)) {
             appendTypeName(sb, typeNamesAppended, "string");
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-core/src/main/javacc/FTL.jj
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/javacc/FTL.jj b/freemarker-core/src/main/javacc/FTL.jj
index 6d05ddd..e5d1e30 100644
--- a/freemarker-core/src/main/javacc/FTL.jj
+++ b/freemarker-core/src/main/javacc/FTL.jj
@@ -364,9 +364,9 @@ public class FMParser {
             } catch (TemplateException tme) {
             }
         }
-        if (legacyCompat && tm instanceof TemplateScalarModel) {
+        if (legacyCompat && tm instanceof TemplateStringModel) {
             try {
-                return _StringUtils.getYesNo(((TemplateScalarModel) tm).getAsString());
+                return _StringUtils.getYesNo(((TemplateStringModel) tm).getAsString());
             } catch (Exception e) {
                 throw new ParseException(e.getMessage()
                         + "\nExpecting boolean (true/false), found: " + exp.getCanonicalForm(),
@@ -1581,10 +1581,10 @@ ASTExpression EqualityExpression() :
         )
         rhs = RelationalExpression()
         {
-	        notHashLiteral(lhs, "scalar");
-	        notHashLiteral(rhs, "scalar");
-	        notListLiteral(lhs, "scalar");
-	        notListLiteral(rhs, "scalar");
+	        notHashLiteral(lhs, "string");
+	        notHashLiteral(rhs, "string");
+	        notListLiteral(lhs, "string");
+	        notListLiteral(rhs, "string");
 	        result = new ASTExpComparison(lhs, rhs, t.image);
 	        result.setLocation(template, lhs, rhs);
         }
@@ -1618,10 +1618,10 @@ ASTExpression RelationalExpression() :
         )
         rhs = RangeExpression()
         {
-            notHashLiteral(lhs, "scalar");
-            notHashLiteral(rhs, "scalar");
-            notListLiteral(lhs, "scalar");
-            notListLiteral(rhs, "scalar");
+            notHashLiteral(lhs, "number");
+            notHashLiteral(rhs, "number");
+            notListLiteral(lhs, "number");
+            notListLiteral(rhs, "number");
             notStringLiteral(lhs, "number");
             notStringLiteral(rhs, "number");
             result = new ASTExpComparison(lhs, rhs, t.image);
@@ -1809,7 +1809,7 @@ ASTExpBuiltInVariable ASTExpBuiltInVariable() :
         TemplateModel parseTimeValue;
         String nameStr = name.image;
         if (nameStr.equals(ASTExpBuiltInVariable.OUTPUT_FORMAT)) {
-            parseTimeValue = new SimpleScalar(outputFormat.getName());
+            parseTimeValue = new SimpleString(outputFormat.getName());
         } else if (nameStr.equals(ASTExpBuiltInVariable.AUTO_ESC)) {
             parseTimeValue = autoEscaping ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE;
         } else {
@@ -3622,9 +3622,9 @@ ASTDirOutputFormat OutputFormat() :
                     paramExp, e);
         }
         String paramStr;
-        if (paramTM instanceof TemplateScalarModel) {
+        if (paramTM instanceof TemplateStringModel) {
             try {
-                paramStr = ((TemplateScalarModel) paramTM).getAsString();
+                paramStr = ((TemplateStringModel) paramTM).getAsString();
             } catch (TemplateException e) {
 	            throw new ParseException(
 	                    "Could not evaluate expression (on parse-time): " + paramExp.getCanonicalForm()
@@ -4112,9 +4112,9 @@ void HeaderElement() :
                                 exp, e);
                     }
                     String vs = null;
-                    if (value instanceof TemplateScalarModel) {
+                    if (value instanceof TemplateStringModel) {
                         try {
-                            vs = ((TemplateScalarModel) exp).getAsString();
+                            vs = ((TemplateStringModel) exp).getAsString();
                         } catch (TemplateException tme) {}
                     }
                     if (template != null) {
@@ -4178,12 +4178,12 @@ void HeaderElement() :
                             try {
                                 TemplateCollectionModel keys = prefixMap.keys();
                                 for (TemplateModelIterator it = keys.iterator(); it.hasNext();) {
-                                    String prefix = ((TemplateScalarModel) it.next()).getAsString();
+                                    String prefix = ((TemplateStringModel) it.next()).getAsString();
                                     TemplateModel valueModel = prefixMap.get(prefix);
-                                    if (!(valueModel instanceof TemplateScalarModel)) {
+                                    if (!(valueModel instanceof TemplateStringModel)) {
                                         throw new ParseException("Non-string value in prefix to namespace hash.", exp);
                                     }
-                                    String nsURI = ((TemplateScalarModel) valueModel).getAsString();
+                                    String nsURI = ((TemplateStringModel) valueModel).getAsString();
                                     try {
                                         template.addPrefixNSMapping(prefix, nsURI);
                                     } catch (IllegalArgumentException iae) {
@@ -4200,7 +4200,7 @@ void HeaderElement() :
                             try {
                                 TemplateCollectionModel keys = attributeMap.keys();
                                 for (TemplateModelIterator it = keys.iterator(); it.hasNext();) {
-                                        String attName = ((TemplateScalarModel) it.next()).getAsString();
+                                        String attName = ((TemplateStringModel) it.next()).getAsString();
                                         Object attValue = DeepUnwrap.unwrap(attributeMap.get(attName));
                                         if (attValue != null && !(attValue instanceof Serializable)) {
                                             throw new ParseException(

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/AttributeNodeModel.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/AttributeNodeModel.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/AttributeNodeModel.java
index cc510c4..d6af687 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/AttributeNodeModel.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/AttributeNodeModel.java
@@ -20,10 +20,10 @@
 package org.apache.freemarker.dom;
 
 import org.apache.freemarker.core.Environment;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.w3c.dom.Attr;
 
-class AttributeNodeModel extends NodeModel implements TemplateScalarModel {
+class AttributeNodeModel extends NodeModel implements TemplateStringModel {
     
     public AttributeNodeModel(Attr att) {
         super(att);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/CharacterDataNodeModel.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/CharacterDataNodeModel.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/CharacterDataNodeModel.java
index 264c0db..21e8a27 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/CharacterDataNodeModel.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/CharacterDataNodeModel.java
@@ -19,11 +19,11 @@
  
 package org.apache.freemarker.dom;
 
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.w3c.dom.CharacterData;
 import org.w3c.dom.Comment;
 
-class CharacterDataNodeModel extends NodeModel implements TemplateScalarModel {
+class CharacterDataNodeModel extends NodeModel implements TemplateStringModel {
     
     public CharacterDataNodeModel(CharacterData text) {
         super(text);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/ElementModel.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/ElementModel.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/ElementModel.java
index cfd0430..4be196d 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/ElementModel.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/ElementModel.java
@@ -25,16 +25,16 @@ import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 import org.apache.freemarker.core.util._StringUtils;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-class ElementModel extends NodeModel implements TemplateScalarModel {
+class ElementModel extends NodeModel implements TemplateStringModel {
 
     public ElementModel(Element element) {
         super(element);
@@ -76,15 +76,15 @@ class ElementModel extends NodeModel implements TemplateScalarModel {
                     return new NodeListModel(node.getAttributes(), this);
                 } else if (key.equals(AtAtKey.START_TAG.getKey())) {
                     NodeOutputter nodeOutputter = new NodeOutputter(node);
-                    return new SimpleScalar(nodeOutputter.getOpeningTag((Element) node));
+                    return new SimpleString(nodeOutputter.getOpeningTag((Element) node));
                 } else if (key.equals(AtAtKey.END_TAG.getKey())) {
                     NodeOutputter nodeOutputter = new NodeOutputter(node);
-                    return new SimpleScalar(nodeOutputter.getClosingTag((Element) node));
+                    return new SimpleString(nodeOutputter.getClosingTag((Element) node));
                 } else if (key.equals(AtAtKey.ATTRIBUTES_MARKUP.getKey())) {
                     StringBuilder buf = new StringBuilder();
                     NodeOutputter nu = new NodeOutputter(node);
                     nu.outputContent(node.getAttributes(), buf);
-                    return new SimpleScalar(buf.toString().trim());
+                    return new SimpleString(buf.toString().trim());
                 } else if (key.equals(AtAtKey.PREVIOUS_SIBLING_ELEMENT.getKey())) {
                     Node previousSibling = node.getPreviousSibling();
                     while (previousSibling != null && !isSignificantNode(previousSibling)) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/JaxenXPathSupport.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/JaxenXPathSupport.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/JaxenXPathSupport.java
index 4b3fb2f..4cd06ed 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/JaxenXPathSupport.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/JaxenXPathSupport.java
@@ -39,7 +39,7 @@ import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.util.UndeclaredThrowableException;
 import org.apache.freemarker.core.util._ObjectHolder;
 import org.jaxen.BaseXPath;
@@ -128,8 +128,8 @@ class JaxenXPathSupport implements XPathSupport {
                 if (model == null) {
                     throw new UnresolvableException("Variable \"" + localName + "\" not found.");
                 }
-                if (model instanceof TemplateScalarModel) {
-                    return ((TemplateScalarModel) model).getAsString();
+                if (model instanceof TemplateStringModel) {
+                    return ((TemplateStringModel) model).getAsString();
                 }
                 if (model instanceof TemplateNumberModel) {
                     return ((TemplateNumberModel) model).getAsNumber();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeListModel.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeListModel.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeListModel.java
index 3f60482..5db727a 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeListModel.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeListModel.java
@@ -32,9 +32,9 @@ import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateNodeModel;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 import org.apache.freemarker.core.model.impl.SimpleSequence;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
@@ -120,10 +120,10 @@ class NodeListModel extends SimpleSequence implements TemplateHashModel, _Unexpe
                 StringBuilder result = new StringBuilder();
                 for (int i = 0; i < size(); i++) {
                     NodeModel nm = (NodeModel) get(i);
-                    TemplateScalarModel textModel = (TemplateScalarModel) nm.get(key);
+                    TemplateStringModel textModel = (TemplateStringModel) nm.get(key);
                     result.append(textModel.getAsString());
                 }
-                return new SimpleScalar(result.toString());
+                return new SimpleString(result.toString());
             } else if (key.length() != 2 /* to allow "@@" to fall through */) {
                 // As @@... would cause exception in the XPath engine, we throw a nicer exception now. 
                 if (AtAtKey.containsKey(key)) {
@@ -193,7 +193,7 @@ class NodeListModel extends SimpleSequence implements TemplateHashModel, _Unexpe
     @Override
     public Object[] explainTypeError(Class[] expectedClasses) {
         for (Class expectedClass : expectedClasses) {
-            if (TemplateScalarModel.class.isAssignableFrom(expectedClass)
+            if (TemplateStringModel.class.isAssignableFrom(expectedClass)
                     || TemplateDateModel.class.isAssignableFrom(expectedClass)
                     || TemplateNumberModel.class.isAssignableFrom(expectedClass)
                     || TemplateBooleanModel.class.isAssignableFrom(expectedClass)) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeModel.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeModel.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeModel.java
index f6c4d38..123a1a7 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeModel.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeModel.java
@@ -22,7 +22,6 @@ package org.apache.freemarker.dom;
 
 import java.lang.ref.WeakReference;
 import java.util.Collections;
-import java.util.List;
 import java.util.Map;
 import java.util.WeakHashMap;
 
@@ -40,7 +39,7 @@ import org.apache.freemarker.core.model.TemplateNumberModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 import org.slf4j.Logger;
 import org.w3c.dom.Attr;
 import org.w3c.dom.CDATASection;
@@ -114,29 +113,29 @@ abstract public class NodeModel implements TemplateNodeModelEx, TemplateHashMode
     public TemplateModel get(String key) throws TemplateException {
         if (key.startsWith("@@")) {
             if (key.equals(AtAtKey.TEXT.getKey())) {
-                return new SimpleScalar(getText(node));
+                return new SimpleString(getText(node));
             } else if (key.equals(AtAtKey.NAMESPACE.getKey())) {
                 String nsURI = node.getNamespaceURI();
-                return nsURI == null ? null : new SimpleScalar(nsURI);
+                return nsURI == null ? null : new SimpleString(nsURI);
             } else if (key.equals(AtAtKey.LOCAL_NAME.getKey())) {
                 String localName = node.getLocalName();
                 if (localName == null) {
                     localName = getNodeName();
                 }
-                return new SimpleScalar(localName);
+                return new SimpleString(localName);
             } else if (key.equals(AtAtKey.MARKUP.getKey())) {
                 StringBuilder buf = new StringBuilder();
                 NodeOutputter nu = new NodeOutputter(node);
                 nu.outputContent(node, buf);
-                return new SimpleScalar(buf.toString());
+                return new SimpleString(buf.toString());
             } else if (key.equals(AtAtKey.NESTED_MARKUP.getKey())) {
                 StringBuilder buf = new StringBuilder();
                 NodeOutputter nu = new NodeOutputter(node);
                 nu.outputContent(node.getChildNodes(), buf);
-                return new SimpleScalar(buf.toString());
+                return new SimpleString(buf.toString());
             } else if (key.equals(AtAtKey.QNAME.getKey())) {
                 String qname = getQualifiedName();
-                return qname != null ? new SimpleScalar(qname) : null;
+                return qname != null ? new SimpleString(qname) : null;
             } else {
                 // As @@... would cause exception in the XPath engine, we throw a nicer exception now. 
                 if (AtAtKey.containsKey(key)) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeQueryResultItemObjectWrapper.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeQueryResultItemObjectWrapper.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeQueryResultItemObjectWrapper.java
index 20a8662..7a5545f 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeQueryResultItemObjectWrapper.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/NodeQueryResultItemObjectWrapper.java
@@ -29,7 +29,7 @@ import org.apache.freemarker.core.model.TemplateModelAdapter;
 import org.apache.freemarker.core.model.WrappingTemplateModel;
 import org.apache.freemarker.core.model.impl.SimpleDate;
 import org.apache.freemarker.core.model.impl.SimpleNumber;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 import org.w3c.dom.Node;
 
 /**
@@ -65,7 +65,7 @@ class NodeQueryResultItemObjectWrapper implements ObjectWrapper {
             }
 
             if (obj instanceof String) {
-                return new SimpleScalar((String) obj);
+                return new SimpleString((String) obj);
             }
             if (obj instanceof Number) {
                 return new SimpleNumber((Number) obj);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/PINodeModel.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/PINodeModel.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/PINodeModel.java
index 381d4d6..2a6a43e 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/PINodeModel.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/PINodeModel.java
@@ -19,10 +19,10 @@
  
 package org.apache.freemarker.dom;
 
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.w3c.dom.ProcessingInstruction;
 
-class PINodeModel extends NodeModel implements TemplateScalarModel {
+class PINodeModel extends NodeModel implements TemplateStringModel {
     
     public PINodeModel(ProcessingInstruction pi) {
         super(pi);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/SunInternalXalanXPathSupport.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/SunInternalXalanXPathSupport.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/SunInternalXalanXPathSupport.java
index 20fd66e..5554f9b 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/SunInternalXalanXPathSupport.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/SunInternalXalanXPathSupport.java
@@ -29,7 +29,7 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.impl.SimpleNumber;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 import org.w3c.dom.Node;
 import org.w3c.dom.traversal.NodeIterator;
 
@@ -106,7 +106,7 @@ class SunInternalXalanXPathSupport implements XPathSupport {
                 return null;
             }
             if (xresult instanceof XString) {
-                return new SimpleScalar(xresult.toString());
+                return new SimpleString(xresult.toString());
             }
             if (xresult instanceof XNumber) {
                 return new SimpleNumber(Double.valueOf(((XNumber) xresult).num()));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-dom/src/main/java/org/apache/freemarker/dom/XalanXPathSupport.java
----------------------------------------------------------------------
diff --git a/freemarker-dom/src/main/java/org/apache/freemarker/dom/XalanXPathSupport.java b/freemarker-dom/src/main/java/org/apache/freemarker/dom/XalanXPathSupport.java
index 67640d4..f962d05 100644
--- a/freemarker-dom/src/main/java/org/apache/freemarker/dom/XalanXPathSupport.java
+++ b/freemarker-dom/src/main/java/org/apache/freemarker/dom/XalanXPathSupport.java
@@ -29,7 +29,7 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.impl.SimpleNumber;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 import org.apache.xml.utils.PrefixResolver;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
@@ -106,7 +106,7 @@ class XalanXPathSupport implements XPathSupport {
                 return null;
             }
             if (xresult instanceof XString) {
-                return new SimpleScalar(xresult.toString());
+                return new SimpleString(xresult.toString());
             }
             if (xresult instanceof XNumber) {
                 return new SimpleNumber(Double.valueOf(((XNumber) xresult).num()));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/HttpRequestParametersHashModel.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/HttpRequestParametersHashModel.java b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/HttpRequestParametersHashModel.java
index 33e5817..e815a17 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/HttpRequestParametersHashModel.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/HttpRequestParametersHashModel.java
@@ -31,7 +31,7 @@ import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateHashModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.impl.SimpleCollection;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 
 /**
  * TemplateHashModel wrapper for a HttpServletRequest parameters.
@@ -50,7 +50,7 @@ public class HttpRequestParametersHashModel implements TemplateHashModelEx {
     @Override
     public TemplateModel get(String key) {
         String value = request.getParameter(key);
-        return value == null ? null : new SimpleScalar(value);
+        return value == null ? null : new SimpleString(value);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/IncludePage.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/IncludePage.java b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/IncludePage.java
index 304c71c..5e52043 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/IncludePage.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/IncludePage.java
@@ -36,15 +36,14 @@ import javax.servlet.http.HttpServletRequestWrapper;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponseWrapper;
 
+import org.apache.freemarker.core.CallPlace;
 import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core._DelayedTemplateLanguageTypeDescription;
 import org.apache.freemarker.core.model.ArgumentArrayLayout;
-import org.apache.freemarker.core.CallPlace;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.util.CallableUtils;
 import org.apache.freemarker.core.util.DeepUnwrap;
 import org.apache.freemarker.core.util.StringToIndexMap;
 
@@ -91,21 +90,8 @@ public class IncludePage implements TemplateDirectiveModel {
     @Override
     public void execute(TemplateModel[] args, CallPlace callPlace, Writer out, Environment env)
             throws TemplateException, IOException {
-        // Determine the path
-        final TemplateModel path = args[PATH_PARAM_IDX];
-        if (path == null) {
-            throw new TemplateException(env, "Missing required parameter \"path\"");
-        }
-        if (!(path instanceof TemplateScalarModel)) {
-            throw new TemplateException(env,
-                    "Expected a scalar model. \"", PATH_PARAM_NAME, "\" is instead ",
-                    new _DelayedTemplateLanguageTypeDescription(path));
-        }
-        final String strPath = ((TemplateScalarModel) path).getAsString();
-        if (strPath == null) {
-            throw new TemplateException(env, "String value of \"path\" parameter is null");
-        }
-        
+        final String strPath = CallableUtils.getStringArgument(args, PARAMS_PARAM_IDX, this);
+
         // See whether we need to use a custom response (if we're inside a TTM
         // or TDM or macro nested body, we'll need to as then the current 
         // FM environment writer is not identical to HTTP servlet response 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
index 438a622..3c2b4c0 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
@@ -52,7 +52,7 @@ import org.apache.freemarker.core.model.ObjectWrappingException;
 import org.apache.freemarker.core.model.TemplateHashModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelIterator;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.util.UndeclaredThrowableException;
 import org.apache.freemarker.servlet.FreemarkerServlet;
 import org.apache.freemarker.servlet.HttpRequestHashModel;
@@ -451,7 +451,7 @@ public JspWriter pushBody(Writer w) {
         @Override
         public Object nextElement() {
             try {
-                return ((TemplateScalarModel) it.next()).getAsString();
+                return ((TemplateStringModel) it.next()).getAsString();
             } catch (TemplateException tme) {
                 throw new UndeclaredThrowableException(tme);
             }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
index 6d66094..81f0e03 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
@@ -41,7 +41,7 @@ import org.apache.freemarker.core._ErrorDescriptionBuilder;
 import org.apache.freemarker.core.model.ObjectWrapperAndUnwrapper;
 import org.apache.freemarker.core.model.TemplateHashModelEx2;
 import org.apache.freemarker.core.model.TemplateModelWithOriginName;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.core.util._StringUtils;
 import org.apache.freemarker.servlet.jsp.SimpleTagDirectiveModel.TemplateExceptionWrapperJspException;
@@ -78,7 +78,7 @@ abstract class JspTagModelBase implements TemplateModelWithOriginName {
                 final TemplateHashModelEx2.KeyValuePair entry = iter.next();
                 final Object arg = wrapper.unwrap(entry.getValue());
                 argArray[0] = arg;
-                final String paramName = ((TemplateScalarModel) entry.getKey()).getAsString();
+                final String paramName = ((TemplateStringModel) entry.getKey()).getAsString();
                 Method setterMethod = (Method) propertySetters.get(paramName);
                 if (setterMethod == null) {
                     if (tag instanceof DynamicAttributes) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java b/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
index 3cc6993..1ebdcd4 100644
--- a/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
+++ b/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
@@ -34,10 +34,10 @@ import javax.xml.parsers.SAXParserFactory;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.NonTemplateCallPlace;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.core.model.impl.JavaMethodModel;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
+import org.apache.freemarker.core.model.impl.SimpleString;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -85,13 +85,13 @@ public class TLDParsingTest {
 
         JavaMethodModel function = (JavaMethodModel) tagsAndFunctions.get("toUpperCase");
         assertNotNull(function);
-        TemplateScalarModel result = (TemplateScalarModel) function.execute(
-                new TemplateModel[] { new SimpleScalar("abc") }, NonTemplateCallPlace.INSTANCE);
+        TemplateStringModel result = (TemplateStringModel) function.execute(
+                new TemplateModel[] { new SimpleString("abc") }, NonTemplateCallPlace.INSTANCE);
         assertEquals("ABC", result.getAsString());
         function = (JavaMethodModel) tagsAndFunctions.get("toUpperCase2");
         assertNotNull(function);
-        result = (TemplateScalarModel) function.execute(
-                new TemplateModel[] { new SimpleScalar("abc") }, NonTemplateCallPlace.INSTANCE);
+        result = (TemplateStringModel) function.execute(
+                new TemplateModel[] { new SimpleString("abc") }, NonTemplateCallPlace.INSTANCE);
         assertEquals("ABC", result.getAsString());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/999afd28/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
----------------------------------------------------------------------
diff --git a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
index 923ced8..213dfbb 100644
--- a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
+++ b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
@@ -31,7 +31,7 @@ import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
+import org.apache.freemarker.core.model.TemplateStringModel;
 import org.apache.freemarker.core.util.CallableUtils;
 import org.apache.freemarker.core.util.StringToIndexMap;
 import org.apache.freemarker.core.util._StringUtils;
@@ -81,7 +81,7 @@ public class AssertEqualsDirective implements TemplateDirectiveModel {
             // This is the same order as comparison goes:
         else if (value instanceof TemplateNumberModel) return ((TemplateNumberModel) value).getAsNumber().toString();
         else if (value instanceof TemplateDateModel) return ((TemplateDateModel) value).getAsDate().toString();
-        else if (value instanceof TemplateScalarModel) return _StringUtils.jQuote(((TemplateScalarModel) value).getAsString());
+        else if (value instanceof TemplateStringModel) return _StringUtils.jQuote(((TemplateStringModel) value).getAsString());
         else if (value instanceof TemplateBooleanModel) return String.valueOf(((TemplateBooleanModel) value).getAsBoolean());
             // This shouldn't be reached, as the comparison should have failed earlier:
         else return value.toString();



Mime
View raw message