Browse Source

jfinal 3.2 release ^_^

James 8 years ago
parent
commit
ae3413026d

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

@@ -26,12 +26,12 @@ import com.jfinal.template.stat.Scope;
 
 
 /**
 /**
  * Arithmetic
  * Arithmetic
- * 1:支持 int long float double BigDecimal 的 + - * / % 运算
+ * 1:支持 byte short int long float double BigDecimal 的 + - * / % 运算
  * 2:支持字符串加法运算
  * 2:支持字符串加法运算
  */
  */
 public class Arith extends Expr {
 public class Arith extends Expr {
 	
 	
-	public static final int INT = 0;
+	public static final int INT = 0;	// byte、short 用 int 类型支持,java 表达式亦如此
 	public static final int LONG = 1;
 	public static final int LONG = 1;
 	public static final int FLOAT = 2;
 	public static final int FLOAT = 2;
 	public static final int DOUBLE = 3;
 	public static final int DOUBLE = 3;
@@ -132,7 +132,7 @@ public class Arith extends Expr {
 		} else if (obj instanceof BigDecimal) {
 		} else if (obj instanceof BigDecimal) {
 			return BIGDECIMAL;
 			return BIGDECIMAL;
 		} else if (obj instanceof Short || obj instanceof Byte) {
 		} else if (obj instanceof Short || obj instanceof Byte) {
-			return INT;
+			return INT;	// short byte 用 int 支持,java 表达式亦如此
 		}
 		}
 		throw new TemplateException("Unsupported data type: " + obj.getClass().getName(), location);
 		throw new TemplateException("Unsupported data type: " + obj.getClass().getName(), location);
 	}
 	}

+ 2 - 2
src/main/java/com/jfinal/template/expr/ast/Compare.java

@@ -26,7 +26,7 @@ import com.jfinal.template.stat.Scope;
 /**
 /**
  * Compare
  * Compare
  * 
  * 
- * 1:支持 int long float double BigDecimal 的 == != > >= < <= 操作
+ * 1:支持 byte short int long float double BigDecimal 的 == != > >= < <= 操作
  * 2:== != 作用于 string,调用其 equals 方法进行比较
  * 2:== != 作用于 string,调用其 equals 方法进行比较
  * 3:> >= < <= 可以比较实现了 Comparable 接口的对象
  * 3:> >= < <= 可以比较实现了 Comparable 接口的对象
  * 
  * 
@@ -248,7 +248,7 @@ public class Compare extends Expr {
 		} else if (obj instanceof BigDecimal) {
 		} else if (obj instanceof BigDecimal) {
 			return Arith.BIGDECIMAL;
 			return Arith.BIGDECIMAL;
 		} else if (obj instanceof Short || obj instanceof Byte) {
 		} else if (obj instanceof Short || obj instanceof Byte) {
-			return Arith.INT;
+			return Arith.INT;	// short byte 用 int 支持,java 表达式亦如此
 		}
 		}
 		throw new TemplateException("Unsupported data type: " + obj.getClass().getName(), location);
 		throw new TemplateException("Unsupported data type: " + obj.getClass().getName(), location);
 	}
 	}