Browse Source

jfinal 4.9

James 5 years ago
parent
commit
0bab472a96
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/main/java/com/jfinal/template/expr/ast/Arith.java

+ 5 - 3
src/main/java/com/jfinal/template/expr/ast/Arith.java

@@ -108,9 +108,11 @@ public class Arith extends Expr {
 		}
 		}
 		
 		
 		// 字符串加法运算
 		// 字符串加法运算
-		if (leftValue instanceof String || rightValue instanceof String) {
-            return String.valueOf(leftValue).concat(String.valueOf(rightValue));
-        }
+		if (op == Sym.ADD) {
+			if (leftValue instanceof String || rightValue instanceof String) {
+				return String.valueOf(leftValue).concat(String.valueOf(rightValue));
+			}
+		}
 		
 		
 		String leftObj = leftValue != null ? leftValue.getClass().getName() : "null";
 		String leftObj = leftValue != null ? leftValue.getClass().getName() : "null";
 		String rightObj = rightValue != null ? rightValue.getClass().getName() : "null";
 		String rightObj = rightValue != null ? rightValue.getClass().getName() : "null";