@@ -2441,6 +2441,7 @@ public String getWhereString(boolean hasPrefix, RequestMethod method, Map<String
24412441}
24422442
24432443key = "" ;
2444+ lastLogic = 0 ;
24442445
24452446if (isOver ) {
24462447break ;
@@ -2482,21 +2483,23 @@ else if (c == '|') {
24822483}
24832484}
24842485else if (c == '!' ) {
2485- char next = i >= n - 1 ? 0 : s .charAt (i + 1 );
2486- if (next == ' ' ) {
2487- throw new IllegalArgumentException (table + ":{ @combine: '" + combine + "' } 中字符 '" + s .substring (0 , i + 1 )
2488- + "' 不合法!非逻辑符 '!' 右边多了一个空格 ' ' !非逻辑符 '!' 右边不允许任何相邻空格 ' ',也不允许 ')' '&' '|' 中任何一个!" );
2489- }
2490- if (next == ')' || next == '&' || next == '!' ) {
2491- throw new IllegalArgumentException (table + ":{ @combine: '" + combine + "' } 中字符 '" + s .substring (0 , i + 1 )
2492- + "' 不合法!非逻辑符 '!' 右边多了一个字符 '" + next + "' !非逻辑符 '!' 右边不允许任何相邻空格 ' ',也不允许 ')' '&' '|' 中任何一个!" );
2493- }
2494-
24952486last = i <= 0 ? 0 : s .charAt (i - 1 ); // & | 后面跳过了空格
2496- if (i > 0 && lastLogic <= 0 && last != '(' ) {
2497- throw new IllegalArgumentException (table + ":{ @combine: '" + combine + "' } 中字符 '" + s .substring (i )
2498- + "' 不合法!左边缺少 & | 逻辑连接符!逻辑连接符 & | 左右必须各一个相邻空格!空格不能多也不能少!"
2499- + "不允许首尾有空格,也不允许连续空格!左括号 ( 的右边 和 右括号 ) 的左边 都不允许有相邻空格!" );
2487+
2488+ char next = i >= n - 1 ? 0 : s .charAt (i + 1 );
2489+ if (last == ' ' || last == '(' ) {
2490+ if (next == ' ' ) {
2491+ throw new IllegalArgumentException (table + ":{ @combine: '" + combine + "' } 中字符 '" + s .substring (0 , i + 1 )
2492+ + "' 不合法!非逻辑符 '!' 右边多了一个空格 ' ' !非逻辑符 '!' 右边不允许任何相邻空格 ' ',也不允许 ')' '&' '|' 中任何一个!" );
2493+ }
2494+ if (next == ')' || next == '&' || next == '!' ) {
2495+ throw new IllegalArgumentException (table + ":{ @combine: '" + combine + "' } 中字符 '" + s .substring (0 , i + 1 )
2496+ + "' 不合法!非逻辑符 '!' 右边多了一个字符 '" + next + "' !非逻辑符 '!' 右边不允许任何相邻空格 ' ',也不允许 ')' '&' '|' 中任何一个!" );
2497+ }
2498+ if (i > 0 && lastLogic <= 0 && last != '(' ) {
2499+ throw new IllegalArgumentException (table + ":{ @combine: '" + combine + "' } 中字符 '" + s .substring (i )
2500+ + "' 不合法!左边缺少 & | 逻辑连接符!逻辑连接符 & | 左右必须各一个相邻空格!空格不能多也不能少!"
2501+ + "不允许首尾有空格,也不允许连续空格!左括号 ( 的右边 和 右括号 ) 的左边 都不允许有相邻空格!" );
2502+ }
25002503}
25012504
25022505if (next == '(' ) {
0 commit comments