struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [2/3] struts git commit: Extracts default loop count constant
Date Mon, 09 Jan 2017 09:08:07 GMT
Extracts default loop count constant


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/b9c05a71
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/b9c05a71
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/b9c05a71

Branch: refs/heads/master
Commit: b9c05a7181836d8484ccd455b8b0318ecfce61a5
Parents: 14d56fb
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Mon Jan 9 09:12:35 2017 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Mon Jan 9 09:12:35 2017 +0100

----------------------------------------------------------------------
 .../java/com/opensymphony/xwork2/util/TextParseUtil.java     | 8 +++-----
 .../main/java/com/opensymphony/xwork2/util/TextParser.java   | 2 ++
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/b9c05a71/core/src/main/java/com/opensymphony/xwork2/util/TextParseUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/util/TextParseUtil.java b/core/src/main/java/com/opensymphony/xwork2/util/TextParseUtil.java
index 4f48685..0e5c9a1 100644
--- a/core/src/main/java/com/opensymphony/xwork2/util/TextParseUtil.java
+++ b/core/src/main/java/com/opensymphony/xwork2/util/TextParseUtil.java
@@ -31,8 +31,6 @@ import java.util.*;
  */
 public class TextParseUtil {
 
-    private static final int MAX_RECURSION = 1;
-
     /**
      * Converts all instances of ${...}, and %{...} in <code>expression</code>
to the value returned
      * by a call to {@link ValueStack#findValue(java.lang.String)}. If an item cannot
@@ -108,7 +106,7 @@ public class TextParseUtil {
      * @return Converted object from variable translation.
      */
     public static Object translateVariables(char open, String expression, ValueStack stack,
Class asType, ParsedValueEvaluator evaluator) {
-        return translateVariables(new char[]{open} , expression, stack, asType, evaluator,
MAX_RECURSION);
+        return translateVariables(new char[]{open} , expression, stack, asType, evaluator,
TextParser.DEFAULT_LOOP_COUNT);
     }
 
     /**
@@ -122,7 +120,7 @@ public class TextParseUtil {
      * @return Converted object from variable translation.
      */
     public static Object translateVariables(char[] openChars, String expression, ValueStack
stack, Class asType, ParsedValueEvaluator evaluator) {
-        return translateVariables(openChars, expression, stack, asType, evaluator, MAX_RECURSION);
+        return translateVariables(openChars, expression, stack, asType, evaluator, TextParser.DEFAULT_LOOP_COUNT);
     }
 
     /**
@@ -178,7 +176,7 @@ public class TextParseUtil {
      * @return converted objects
      */
     public static Collection<String>  translateVariablesCollection(String expression,
ValueStack stack, boolean excludeEmptyElements, ParsedValueEvaluator evaluator) {
-        return translateVariablesCollection(new char[]{'$', '%'}, expression, stack, excludeEmptyElements,
evaluator, MAX_RECURSION);
+        return translateVariablesCollection(new char[]{'$', '%'}, expression, stack, excludeEmptyElements,
evaluator, TextParser.DEFAULT_LOOP_COUNT);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/struts/blob/b9c05a71/core/src/main/java/com/opensymphony/xwork2/util/TextParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/util/TextParser.java b/core/src/main/java/com/opensymphony/xwork2/util/TextParser.java
index 54b18ef..2f53bb0 100644
--- a/core/src/main/java/com/opensymphony/xwork2/util/TextParser.java
+++ b/core/src/main/java/com/opensymphony/xwork2/util/TextParser.java
@@ -6,6 +6,8 @@ package com.opensymphony.xwork2.util;
  */
 public interface TextParser {
 
+    int DEFAULT_LOOP_COUNT = 1;
+
     Object evaluate(char[] openChars, String expression, TextParseUtil.ParsedValueEvaluator
evaluator, int maxLoopCount);
 
 }


Mime
View raw message