ソースを参照

异常挪动位置

James 5 年 前
コミット
4263d70945

+ 2 - 4
src/main/java/com/jfinal/template/ext/directive/DateDirective.java

@@ -47,10 +47,6 @@ public class DateDirective extends Directive {
 	
 	public void setExprList(ExprList exprList) {
 		int paraNum = exprList.length();
-		if (paraNum > 2) {
-			throw new ParseException("Wrong number parameter of #date directive, two parameters allowed at most", location);
-		}
-		
 		if (paraNum == 0) {
 			this.dateExpr = null;
 			this.patternExpr = null;
@@ -60,6 +56,8 @@ public class DateDirective extends Directive {
 		} else if (paraNum == 2) {
 			this.dateExpr = exprList.getExpr(0);
 			this.patternExpr = exprList.getExpr(1);
+		} else {
+			throw new ParseException("Wrong number parameter of #date directive, two parameters allowed at most", location);
 		}
 	}