freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [freemarker] branch 2.3-gae updated: (Renamed NullTemplateModel to TemplateNullModel)
Date Sun, 25 Aug 2019 15:50:21 GMT
This is an automated email from the ASF dual-hosted git repository.

ddekany pushed a commit to branch 2.3-gae
in repository https://gitbox.apache.org/repos/asf/freemarker.git


The following commit(s) were added to refs/heads/2.3-gae by this push:
     new 7c24fe7  (Renamed NullTemplateModel to TemplateNullModel)
7c24fe7 is described below

commit 7c24fe7cf72450ccb558ab080a8436a509f3af24
Author: ddekany <ddekany@apache.org>
AuthorDate: Sun Aug 25 17:50:03 2019 +0200

    (Renamed NullTemplateModel to TemplateNullModel)
---
 src/main/java/freemarker/core/BodyInstruction.java                | 2 +-
 src/main/java/freemarker/core/Environment.java                    | 8 ++++----
 src/main/java/freemarker/core/IteratorBlock.java                  | 4 ++--
 src/main/java/freemarker/core/LocalContext.java                   | 2 +-
 src/main/java/freemarker/core/LocalLambdaExpression.java          | 2 +-
 .../core/{NullTemplateModel.java => TemplateNullModel.java}       | 8 ++++----
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/main/java/freemarker/core/BodyInstruction.java b/src/main/java/freemarker/core/BodyInstruction.java
index 7cedbfb..102ce67 100644
--- a/src/main/java/freemarker/core/BodyInstruction.java
+++ b/src/main/java/freemarker/core/BodyInstruction.java
@@ -140,7 +140,7 @@ final class BodyInstruction extends TemplateElement {
                                 tm != null
                                         ? tm
                                         : getTemplate().getConfiguration().getFallbackOnNullLoopVariable()
-                                                ? null : NullTemplateModel.INSTANCE);
+                                                ? null : TemplateNullModel.INSTANCE);
                     }
                 }
             }
diff --git a/src/main/java/freemarker/core/Environment.java b/src/main/java/freemarker/core/Environment.java
index a1bc38c..5838646 100644
--- a/src/main/java/freemarker/core/Environment.java
+++ b/src/main/java/freemarker/core/Environment.java
@@ -2038,12 +2038,12 @@ public final class Environment extends Configurable {
      */
     public TemplateModel getLocalVariable(String name) throws TemplateModelException {
         TemplateModel val = getNullableLocalVariable(name);
-        return val != NullTemplateModel.INSTANCE ? val : null;
+        return val != TemplateNullModel.INSTANCE ? val : null;
     }
 
     /**
-     * Similar to {@link #getLocalVariable(String)}, but might returns {@link NullTemplateModel}.
Only used internally,
-     * as {@link NullTemplateModel} is internal.
+     * Similar to {@link #getLocalVariable(String)}, but might returns {@link TemplateNullModel}.
Only used internally,
+     * as {@link TemplateNullModel} is internal.
      *
      * @since 2.3.29
      */
@@ -2080,7 +2080,7 @@ public final class Environment extends Configurable {
     public TemplateModel getVariable(String name) throws TemplateModelException {
         TemplateModel result = getNullableLocalVariable(name);
         if (result != null) {
-            return result != NullTemplateModel.INSTANCE ? result : null;
+            return result != TemplateNullModel.INSTANCE ? result : null;
         }
 
         result = currentNamespace.get(name);
diff --git a/src/main/java/freemarker/core/IteratorBlock.java b/src/main/java/freemarker/core/IteratorBlock.java
index e6d1173..14aac31 100644
--- a/src/main/java/freemarker/core/IteratorBlock.java
+++ b/src/main/java/freemarker/core/IteratorBlock.java
@@ -464,7 +464,7 @@ final class IteratorBlock extends TemplateElement {
                     case 0:
                         return loopVar1Value != null ? loopVar1Value
                                 : getTemplate().getConfiguration().getFallbackOnNullLoopVariable()
-                                        ? null : NullTemplateModel.INSTANCE;
+                                        ? null : TemplateNullModel.INSTANCE;
                     case 6: 
                         if (name.endsWith(LOOP_STATE_INDEX)) {
                             return new SimpleNumber(index);
@@ -481,7 +481,7 @@ final class IteratorBlock extends TemplateElement {
             if (name.equals(loopVar2Name)) {
                 return loopVar2Value != null ? loopVar2Value
                         : getTemplate().getConfiguration().getFallbackOnNullLoopVariable()
-                                ? null : NullTemplateModel.INSTANCE;
+                                ? null : TemplateNullModel.INSTANCE;
             }
             
             return null;
diff --git a/src/main/java/freemarker/core/LocalContext.java b/src/main/java/freemarker/core/LocalContext.java
index bb2b351..2dad205 100644
--- a/src/main/java/freemarker/core/LocalContext.java
+++ b/src/main/java/freemarker/core/LocalContext.java
@@ -35,7 +35,7 @@ public interface LocalContext {
 
     /**
      * @return {@code null} if the variable doesn't exit. Since 2.3.29, if this context represents
loop variables, this
-     *     is possibly {@code freemarker.core.NullTemplateModel.INSTANCE} (an internal class)
when
+     *     is possibly {@code freemarker.core.TemplateNullModel.INSTANCE} (an internal class)
when
      *     {@link Configuration#setFallbackOnNullLoopVariable(boolean)} was set to {@code
false}, in which
      *     case the caller must not fall back to higher scopes to find the variable, and
treat the value as
      *     {@code null} in other respects. While this is in theory an incompatible change
in 2.3.29, it's not a problem,
diff --git a/src/main/java/freemarker/core/LocalLambdaExpression.java b/src/main/java/freemarker/core/LocalLambdaExpression.java
index 68b3712..852a934 100644
--- a/src/main/java/freemarker/core/LocalLambdaExpression.java
+++ b/src/main/java/freemarker/core/LocalLambdaExpression.java
@@ -63,7 +63,7 @@ final class LocalLambdaExpression extends Expression {
      */
     TemplateModel invokeLambdaDefinedFunction(TemplateModel argValue, Environment env) throws
TemplateException {
         return env.evaluateWithNewLocal(rho, lho.getParameters().get(0).getName(),
-                argValue != null ? argValue : NullTemplateModel.INSTANCE);
+                argValue != null ? argValue : TemplateNullModel.INSTANCE);
     }
 
     @Override
diff --git a/src/main/java/freemarker/core/NullTemplateModel.java b/src/main/java/freemarker/core/TemplateNullModel.java
similarity index 87%
rename from src/main/java/freemarker/core/NullTemplateModel.java
rename to src/main/java/freemarker/core/TemplateNullModel.java
index f0f0a22..b3ac0de 100644
--- a/src/main/java/freemarker/core/NullTemplateModel.java
+++ b/src/main/java/freemarker/core/TemplateNullModel.java
@@ -27,13 +27,13 @@ import freemarker.template.TemplateModel;
  * doesn't exist at all in the current scope, and so we fall back to a higher scope. This
distinction wasn is only
  * used for (and expected from) certain scopes, so be careful where you are using it. (As
of this
  * writing, it's onlt for local variables, including loop variables). The user should never
meet a
- * {@link NullTemplateModel}, it must not be returned from public API-s.
+ * {@link TemplateNullModel}, it must not be returned from public API-s.
  *
  * @see Environment#getNullableLocalVariable(String)
  *
  * @since 2.3.29
  */
-final class NullTemplateModel implements TemplateModel {
-    static final NullTemplateModel INSTANCE = new NullTemplateModel();
-    private NullTemplateModel() { }
+final class TemplateNullModel implements TemplateModel {
+    static final TemplateNullModel INSTANCE = new TemplateNullModel();
+    private TemplateNullModel() { }
 }


Mime
View raw message