This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new eeda77235e Partial fix for BZ 69338. Better performance for >2 operand 
And/Or
eeda77235e is described below

commit eeda77235e3e5b6d0ab0af4839a223bc48f2bccc
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Sep 25 19:55:09 2024 +0100

    Partial fix for BZ 69338. Better performance for >2 operand And/Or
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=69338
---
 java/org/apache/el/parser/AstAnd.java              |  17 +-
 java/org/apache/el/parser/AstOr.java               |  17 +-
 java/org/apache/el/parser/ELParser.java            | 720 +++++++++++----------
 java/org/apache/el/parser/ELParser.jjt             |   4 +-
 .../apache/el/parser/TestELParserPerformance.java  |  51 ++
 webapps/docs/changelog.xml                         |   4 +
 6 files changed, 458 insertions(+), 355 deletions(-)

diff --git a/java/org/apache/el/parser/AstAnd.java 
b/java/org/apache/el/parser/AstAnd.java
index 8a87feaaaa..a55ca4cfc5 100644
--- a/java/org/apache/el/parser/AstAnd.java
+++ b/java/org/apache/el/parser/AstAnd.java
@@ -33,13 +33,16 @@ public final class AstAnd extends BooleanNode {
 
     @Override
     public Object getValue(EvaluationContext ctx) throws ELException {
-        Object obj = children[0].getValue(ctx);
-        Boolean b = ELSupport.coerceToBoolean(ctx, obj, true);
-        if (!b.booleanValue()) {
-            return b;
+        int i = 0;
+        while (i < children.length - 1) {
+            Object obj = children[i].getValue(ctx);
+            Boolean b = ELSupport.coerceToBoolean(ctx, obj, true);
+            if (!b.booleanValue()) {
+                return b;
+            }
+            i++;
         }
-        obj = children[1].getValue(ctx);
-        b = ELSupport.coerceToBoolean(ctx, obj, true);
-        return b;
+        Object obj = children[i].getValue(ctx);
+        return ELSupport.coerceToBoolean(ctx, obj, true);
     }
 }
diff --git a/java/org/apache/el/parser/AstOr.java 
b/java/org/apache/el/parser/AstOr.java
index d5e7d40120..eeecf8dd38 100644
--- a/java/org/apache/el/parser/AstOr.java
+++ b/java/org/apache/el/parser/AstOr.java
@@ -33,13 +33,16 @@ public final class AstOr extends BooleanNode {
 
     @Override
     public Object getValue(EvaluationContext ctx) throws ELException {
-        Object obj = this.children[0].getValue(ctx);
-        Boolean b = ELSupport.coerceToBoolean(ctx, obj, true);
-        if (b.booleanValue()) {
-            return b;
+        int i = 0;
+        while (i < children.length - 1) {
+            Object obj = children[i].getValue(ctx);
+            Boolean b = ELSupport.coerceToBoolean(ctx, obj, true);
+            if (b.booleanValue()) {
+                return b;
+            }
+            i++;
         }
-        obj = this.children[1].getValue(ctx);
-        b = ELSupport.coerceToBoolean(ctx, obj, true);
-        return b;
+        Object obj = children[i].getValue(ctx);
+        return ELSupport.coerceToBoolean(ctx, obj, true);
     }
 }
diff --git a/java/org/apache/el/parser/ELParser.java 
b/java/org/apache/el/parser/ELParser.java
index b80fd01b6c..06c07abe13 100644
--- a/java/org/apache/el/parser/ELParser.java
+++ b/java/org/apache/el/parser/ELParser.java
@@ -637,67 +637,76 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
      */
     final public void Or() throws ParseException {
         And();
-        label_7: while (true) {
-            switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
-                case OR0:
-                case OR1: {
-                    ;
-                    break;
-                }
-                default:
-                    jj_la1[10] = jj_gen;
-                    break label_7;
-            }
-            switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
-                case OR0: {
-                    jj_consume_token(OR0);
-                    break;
-                }
-                case OR1: {
-                    jj_consume_token(OR1);
-                    break;
-                }
-                default:
-                    jj_la1[11] = jj_gen;
-                    jj_consume_token(-1);
-                    throw new ParseException();
-            }
-            AstOr jjtn001 = new AstOr(JJTOR);
-            boolean jjtc001 = true;
-            jjtree.openNodeScope(jjtn001);
-            try {
-                And();
-            } catch (Throwable jjte001) {
-                if (jjtc001) {
-                    jjtree.clearNodeScope(jjtn001);
-                    jjtc001 = false;
-                } else {
-                    jjtree.popNode();
-                }
-                if (jjte001 instanceof RuntimeException) {
-                    {
-                        if (true) {
-                            throw (RuntimeException) jjte001;
+        switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
+            case OR0:
+            case OR1: {
+                AstOr jjtn001 = new AstOr(JJTOR);
+                boolean jjtc001 = true;
+                jjtree.openNodeScope(jjtn001);
+                try {
+                    label_7: while (true) {
+                        switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
+                            case OR0: {
+                                jj_consume_token(OR0);
+                                break;
+                            }
+                            case OR1: {
+                                jj_consume_token(OR1);
+                                break;
+                            }
+                            default:
+                                jj_la1[10] = jj_gen;
+                                jj_consume_token(-1);
+                                throw new ParseException();
+                        }
+                        And();
+                        switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
+                            case OR0:
+                            case OR1: {
+                                ;
+                                break;
+                            }
+                            default:
+                                jj_la1[11] = jj_gen;
+                                break label_7;
+                        }
+                    }
+                } catch (Throwable jjte001) {
+                    if (jjtc001) {
+                        jjtree.clearNodeScope(jjtn001);
+                        jjtc001 = false;
+                    } else {
+                        jjtree.popNode();
+                    }
+                    if (jjte001 instanceof RuntimeException) {
+                        {
+                            if (true) {
+                                throw (RuntimeException) jjte001;
+                            }
+                        }
+                    }
+                    if (jjte001 instanceof ParseException) {
+                        {
+                            if (true) {
+                                throw (ParseException) jjte001;
+                            }
                         }
                     }
-                }
-                if (jjte001 instanceof ParseException) {
                     {
                         if (true) {
-                            throw (ParseException) jjte001;
+                            throw (Error) jjte001;
                         }
                     }
-                }
-                {
-                    if (true) {
-                        throw (Error) jjte001;
+                } finally {
+                    if (jjtc001) {
+                        jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() + 1);
                     }
                 }
-            } finally {
-                if (jjtc001) {
-                    jjtree.closeNodeScope(jjtn001, 2);
-                }
+                break;
             }
+            default:
+                jj_la1[12] = jj_gen;
+                ;
         }
     }
 
@@ -706,67 +715,76 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
      */
     final public void And() throws ParseException {
         Equality();
-        label_8: while (true) {
-            switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
-                case AND0:
-                case AND1: {
-                    ;
-                    break;
-                }
-                default:
-                    jj_la1[12] = jj_gen;
-                    break label_8;
-            }
-            switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
-                case AND0: {
-                    jj_consume_token(AND0);
-                    break;
-                }
-                case AND1: {
-                    jj_consume_token(AND1);
-                    break;
-                }
-                default:
-                    jj_la1[13] = jj_gen;
-                    jj_consume_token(-1);
-                    throw new ParseException();
-            }
-            AstAnd jjtn001 = new AstAnd(JJTAND);
-            boolean jjtc001 = true;
-            jjtree.openNodeScope(jjtn001);
-            try {
-                Equality();
-            } catch (Throwable jjte001) {
-                if (jjtc001) {
-                    jjtree.clearNodeScope(jjtn001);
-                    jjtc001 = false;
-                } else {
-                    jjtree.popNode();
-                }
-                if (jjte001 instanceof RuntimeException) {
-                    {
-                        if (true) {
-                            throw (RuntimeException) jjte001;
+        switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
+            case AND0:
+            case AND1: {
+                AstAnd jjtn001 = new AstAnd(JJTAND);
+                boolean jjtc001 = true;
+                jjtree.openNodeScope(jjtn001);
+                try {
+                    label_8: while (true) {
+                        switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
+                            case AND0: {
+                                jj_consume_token(AND0);
+                                break;
+                            }
+                            case AND1: {
+                                jj_consume_token(AND1);
+                                break;
+                            }
+                            default:
+                                jj_la1[13] = jj_gen;
+                                jj_consume_token(-1);
+                                throw new ParseException();
+                        }
+                        Equality();
+                        switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
+                            case AND0:
+                            case AND1: {
+                                ;
+                                break;
+                            }
+                            default:
+                                jj_la1[14] = jj_gen;
+                                break label_8;
+                        }
+                    }
+                } catch (Throwable jjte001) {
+                    if (jjtc001) {
+                        jjtree.clearNodeScope(jjtn001);
+                        jjtc001 = false;
+                    } else {
+                        jjtree.popNode();
+                    }
+                    if (jjte001 instanceof RuntimeException) {
+                        {
+                            if (true) {
+                                throw (RuntimeException) jjte001;
+                            }
+                        }
+                    }
+                    if (jjte001 instanceof ParseException) {
+                        {
+                            if (true) {
+                                throw (ParseException) jjte001;
+                            }
                         }
                     }
-                }
-                if (jjte001 instanceof ParseException) {
                     {
                         if (true) {
-                            throw (ParseException) jjte001;
+                            throw (Error) jjte001;
                         }
                     }
-                }
-                {
-                    if (true) {
-                        throw (Error) jjte001;
+                } finally {
+                    if (jjtc001) {
+                        jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() + 1);
                     }
                 }
-            } finally {
-                if (jjtc001) {
-                    jjtree.closeNodeScope(jjtn001, 2);
-                }
+                break;
             }
+            default:
+                jj_la1[15] = jj_gen;
+                ;
         }
     }
 
@@ -785,7 +803,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[14] = jj_gen;
+                    jj_la1[16] = jj_gen;
                     break label_9;
             }
             switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
@@ -801,7 +819,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                             break;
                         }
                         default:
-                            jj_la1[15] = jj_gen;
+                            jj_la1[17] = jj_gen;
                             jj_consume_token(-1);
                             throw new ParseException();
                     }
@@ -855,7 +873,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                             break;
                         }
                         default:
-                            jj_la1[16] = jj_gen;
+                            jj_la1[18] = jj_gen;
                             jj_consume_token(-1);
                             throw new ParseException();
                     }
@@ -898,7 +916,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[17] = jj_gen;
+                    jj_la1[19] = jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
             }
@@ -924,7 +942,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[18] = jj_gen;
+                    jj_la1[20] = jj_gen;
                     break label_10;
             }
             switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
@@ -940,7 +958,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                             break;
                         }
                         default:
-                            jj_la1[19] = jj_gen;
+                            jj_la1[21] = jj_gen;
                             jj_consume_token(-1);
                             throw new ParseException();
                     }
@@ -994,7 +1012,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                             break;
                         }
                         default:
-                            jj_la1[20] = jj_gen;
+                            jj_la1[22] = jj_gen;
                             jj_consume_token(-1);
                             throw new ParseException();
                     }
@@ -1048,7 +1066,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                             break;
                         }
                         default:
-                            jj_la1[21] = jj_gen;
+                            jj_la1[23] = jj_gen;
                             jj_consume_token(-1);
                             throw new ParseException();
                     }
@@ -1102,7 +1120,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                             break;
                         }
                         default:
-                            jj_la1[22] = jj_gen;
+                            jj_la1[24] = jj_gen;
                             jj_consume_token(-1);
                             throw new ParseException();
                     }
@@ -1145,7 +1163,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[23] = jj_gen;
+                    jj_la1[25] = jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
             }
@@ -1165,7 +1183,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[24] = jj_gen;
+                    jj_la1[26] = jj_gen;
                     break label_11;
             }
             jj_consume_token(CONCAT);
@@ -1221,7 +1239,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[25] = jj_gen;
+                    jj_la1[27] = jj_gen;
                     break label_12;
             }
             switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
@@ -1306,7 +1324,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[26] = jj_gen;
+                    jj_la1[28] = jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
             }
@@ -1329,7 +1347,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[27] = jj_gen;
+                    jj_la1[29] = jj_gen;
                     break label_13;
             }
             switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
@@ -1385,7 +1403,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                             break;
                         }
                         default:
-                            jj_la1[28] = jj_gen;
+                            jj_la1[30] = jj_gen;
                             jj_consume_token(-1);
                             throw new ParseException();
                     }
@@ -1439,7 +1457,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                             break;
                         }
                         default:
-                            jj_la1[29] = jj_gen;
+                            jj_la1[31] = jj_gen;
                             jj_consume_token(-1);
                             throw new ParseException();
                     }
@@ -1482,7 +1500,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[30] = jj_gen;
+                    jj_la1[32] = jj_gen;
                     jj_consume_token(-1);
                     throw new ParseException();
             }
@@ -1546,7 +1564,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                         break;
                     }
                     default:
-                        jj_la1[31] = jj_gen;
+                        jj_la1[33] = jj_gen;
                         jj_consume_token(-1);
                         throw new ParseException();
                 }
@@ -1642,7 +1660,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 break;
             }
             default:
-                jj_la1[32] = jj_gen;
+                jj_la1[34] = jj_gen;
                 jj_consume_token(-1);
                 throw new ParseException();
         }
@@ -1665,7 +1683,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                         break;
                     }
                     default:
-                        jj_la1[33] = jj_gen;
+                        jj_la1[35] = jj_gen;
                         break label_14;
                 }
                 ValueSuffix();
@@ -1725,7 +1743,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 break;
             }
             default:
-                jj_la1[34] = jj_gen;
+                jj_la1[36] = jj_gen;
                 jj_consume_token(-1);
                 throw new ParseException();
         }
@@ -1745,7 +1763,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 break;
             }
             default:
-                jj_la1[35] = jj_gen;
+                jj_la1[37] = jj_gen;
                 jj_consume_token(-1);
                 throw new ParseException();
         }
@@ -1755,7 +1773,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 break;
             }
             default:
-                jj_la1[36] = jj_gen;
+                jj_la1[38] = jj_gen;
                 ;
         }
     }
@@ -1857,7 +1875,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                                 break;
                             }
                             default:
-                                jj_la1[37] = jj_gen;
+                                jj_la1[39] = jj_gen;
                                 break label_15;
                         }
                         jj_consume_token(COMMA);
@@ -1866,7 +1884,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[38] = jj_gen;
+                    jj_la1[40] = jj_gen;
                     ;
             }
             jj_consume_token(RPAREN);
@@ -1918,7 +1936,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[39] = jj_gen;
+                    jj_la1[41] = jj_gen;
                     if (jj_2_7(2147483647)) {
                         Function();
                     } else {
@@ -1928,7 +1946,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                                 break;
                             }
                             default:
-                                jj_la1[40] = jj_gen;
+                                jj_la1[42] = jj_gen;
                                 if (jj_2_8(5)) {
                                     SetData();
                                 } else {
@@ -1942,7 +1960,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                                             break;
                                         }
                                         default:
-                                            jj_la1[41] = jj_gen;
+                                            jj_la1[43] = jj_gen;
                                             jj_consume_token(-1);
                                             throw new ParseException();
                                     }
@@ -1986,7 +2004,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                                 break;
                             }
                             default:
-                                jj_la1[42] = jj_gen;
+                                jj_la1[44] = jj_gen;
                                 break label_16;
                         }
                         jj_consume_token(COMMA);
@@ -1995,7 +2013,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[43] = jj_gen;
+                    jj_la1[45] = jj_gen;
                     ;
             }
             jj_consume_token(RBRACE);
@@ -2061,7 +2079,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                                 break;
                             }
                             default:
-                                jj_la1[44] = jj_gen;
+                                jj_la1[46] = jj_gen;
                                 break label_17;
                         }
                         jj_consume_token(COMMA);
@@ -2070,7 +2088,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[45] = jj_gen;
+                    jj_la1[47] = jj_gen;
                     ;
             }
             jj_consume_token(RBRACK);
@@ -2140,7 +2158,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                                 break;
                             }
                             default:
-                                jj_la1[46] = jj_gen;
+                                jj_la1[48] = jj_gen;
                                 break label_18;
                         }
                         jj_consume_token(COMMA);
@@ -2149,7 +2167,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[47] = jj_gen;
+                    jj_la1[49] = jj_gen;
                     ;
             }
             jj_consume_token(RBRACE);
@@ -2265,7 +2283,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                     break;
                 }
                 default:
-                    jj_la1[48] = jj_gen;
+                    jj_la1[50] = jj_gen;
                     ;
             }
             if (t1 != null) {
@@ -2282,7 +2300,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                         break;
                     }
                     default:
-                        jj_la1[49] = jj_gen;
+                        jj_la1[51] = jj_gen;
                         break label_19;
                 }
             }
@@ -2346,7 +2364,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 break;
             }
             default:
-                jj_la1[50] = jj_gen;
+                jj_la1[52] = jj_gen;
                 jj_consume_token(-1);
                 throw new ParseException();
         }
@@ -2384,7 +2402,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 break;
             }
             default:
-                jj_la1[51] = jj_gen;
+                jj_la1[53] = jj_gen;
                 jj_consume_token(-1);
                 throw new ParseException();
         }
@@ -2562,21 +2580,6 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         }
     }
 
-    private boolean jj_3R_And_173_17_41() {
-        Token xsp;
-        xsp = jj_scanpos;
-        if (jj_scan_token(39)) {
-            jj_scanpos = xsp;
-            if (jj_scan_token(40)) {
-                return true;
-            }
-        }
-        if (jj_3R_Equality_182_5_40()) {
-            return true;
-        }
-        return false;
-    }
-
     private boolean jj_3R_LambdaExpressionOrInvocation_144_45_30() {
         if (jj_3R_Choice_155_5_22()) {
             return true;
@@ -2585,13 +2588,13 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
     }
 
     private boolean jj_3R_Equality_182_5_40() {
-        if (jj_3R_Compare_196_5_44()) {
+        if (jj_3R_Compare_196_5_45()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_Equality_184_9_45()) {
+            if (jj_3R_Equality_184_9_46()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -2599,7 +2602,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_ListData_350_26_109() {
+    private boolean jj_3R_ListData_350_26_111() {
         if (jj_scan_token(COMMA)) {
             return true;
         }
@@ -2609,7 +2612,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_MapEntry_368_5_107() {
+    private boolean jj_3R_MapEntry_368_5_109() {
         if (jj_3R_Expression_99_5_36()) {
             return true;
         }
@@ -2622,14 +2625,14 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_MapData_362_11_105() {
-        if (jj_3R_MapEntry_368_5_107()) {
+    private boolean jj_3R_MapData_362_11_107() {
+        if (jj_3R_MapEntry_368_5_109()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_LambdaParameters_132_46_43() {
+    private boolean jj_3R_LambdaParameters_132_46_44() {
         if (jj_scan_token(COMMA)) {
             return true;
         }
@@ -2644,12 +2647,9 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
             return true;
         }
         Token xsp;
-        while (true) {
-            xsp = jj_scanpos;
-            if (jj_3R_And_173_17_41()) {
-                jj_scanpos = xsp;
-                break;
-            }
+        xsp = jj_scanpos;
+        if (jj_3R_And_174_17_41()) {
+            jj_scanpos = xsp;
         }
         return false;
     }
@@ -2664,7 +2664,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Or_164_12_35() {
+    private boolean jj_3R_Or_164_13_42() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(41)) {
@@ -2679,13 +2679,28 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_MapData_361_5_99() {
+    private boolean jj_3R_Or_165_12_35() {
+        Token xsp;
+        if (jj_3R_Or_164_13_42()) {
+            return true;
+        }
+        while (true) {
+            xsp = jj_scanpos;
+            if (jj_3R_Or_164_13_42()) {
+                jj_scanpos = xsp;
+                break;
+            }
+        }
+        return false;
+    }
+
+    private boolean jj_3R_MapData_361_5_101() {
         if (jj_scan_token(START_SET_OR_MAP)) {
             return true;
         }
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_MapData_362_11_105()) {
+        if (jj_3R_MapData_362_11_107()) {
             jj_scanpos = xsp;
         }
         if (jj_scan_token(RBRACE)) {
@@ -2694,14 +2709,14 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_ListData_350_11_104() {
+    private boolean jj_3R_ListData_350_11_106() {
         if (jj_3R_Expression_99_5_36()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_ListData_350_26_109()) {
+            if (jj_3R_ListData_350_26_111()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -2714,12 +2729,9 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
             return true;
         }
         Token xsp;
-        while (true) {
-            xsp = jj_scanpos;
-            if (jj_3R_Or_164_12_35()) {
-                jj_scanpos = xsp;
-                break;
-            }
+        xsp = jj_scanpos;
+        if (jj_3R_Or_165_12_35()) {
+            jj_scanpos = xsp;
         }
         return false;
     }
@@ -2737,13 +2749,13 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_ListData_349_5_98() {
+    private boolean jj_3R_ListData_349_5_100() {
         if (jj_scan_token(LBRACK)) {
             return true;
         }
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_ListData_350_11_104()) {
+        if (jj_3R_ListData_350_11_106()) {
             jj_scanpos = xsp;
         }
         if (jj_scan_token(RBRACK)) {
@@ -2759,7 +2771,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_LambdaParameters_132_46_43()) {
+            if (jj_3R_LambdaParameters_132_46_44()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -2804,7 +2816,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_MethodParameters_317_31_111() {
+    private boolean jj_3R_MethodParameters_317_31_113() {
         if (jj_scan_token(COMMA)) {
             return true;
         }
@@ -2873,15 +2885,15 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_NonLiteral_332_7_89() {
-        if (jj_3R_MapData_361_5_99()) {
+    private boolean jj_3R_NonLiteral_332_7_91() {
+        if (jj_3R_MapData_361_5_101()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_NonLiteral_331_7_88() {
-        if (jj_3R_ListData_349_5_98()) {
+    private boolean jj_3R_NonLiteral_331_7_90() {
+        if (jj_3R_ListData_349_5_100()) {
             return true;
         }
         return false;
@@ -2918,21 +2930,21 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_NonLiteral_329_7_87() {
+    private boolean jj_3R_NonLiteral_329_7_89() {
         if (jj_3R_Identifier_377_5_38()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_NonLiteral_328_7_86() {
-        if (jj_3R_Function_390_5_97()) {
+    private boolean jj_3R_NonLiteral_328_7_88() {
+        if (jj_3R_Function_390_5_99()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_NonLiteral_327_7_85() {
+    private boolean jj_3R_NonLiteral_327_7_87() {
         if (jj_scan_token(LPAREN)) {
             return true;
         }
@@ -2945,14 +2957,14 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_MethodParameters_317_16_110() {
+    private boolean jj_3R_MethodParameters_317_16_112() {
         if (jj_3R_Expression_99_5_36()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_MethodParameters_317_31_111()) {
+            if (jj_3R_MethodParameters_317_31_113()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -2960,29 +2972,29 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_ValueSuffix_291_41_108() {
-        if (jj_3R_MethodParameters_317_5_106()) {
+    private boolean jj_3R_ValueSuffix_291_41_110() {
+        if (jj_3R_MethodParameters_317_5_108()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_NonLiteral_326_5_77() {
+    private boolean jj_3R_NonLiteral_326_5_79() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_3_6()) {
             jj_scanpos = xsp;
-            if (jj_3R_NonLiteral_327_7_85()) {
+            if (jj_3R_NonLiteral_327_7_87()) {
                 jj_scanpos = xsp;
-                if (jj_3R_NonLiteral_328_7_86()) {
+                if (jj_3R_NonLiteral_328_7_88()) {
                     jj_scanpos = xsp;
-                    if (jj_3R_NonLiteral_329_7_87()) {
+                    if (jj_3R_NonLiteral_329_7_89()) {
                         jj_scanpos = xsp;
                         if (jj_3_8()) {
                             jj_scanpos = xsp;
-                            if (jj_3R_NonLiteral_331_7_88()) {
+                            if (jj_3R_NonLiteral_331_7_90()) {
                                 jj_scanpos = xsp;
-                                if (jj_3R_NonLiteral_332_7_89()) {
+                                if (jj_3R_NonLiteral_332_7_91()) {
                                     return true;
                                 }
                             }
@@ -3030,13 +3042,13 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_MethodParameters_317_5_106() {
+    private boolean jj_3R_MethodParameters_317_5_108() {
         if (jj_scan_token(LPAREN)) {
             return true;
         }
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_MethodParameters_317_16_110()) {
+        if (jj_3R_MethodParameters_317_16_112()) {
             jj_scanpos = xsp;
         }
         if (jj_scan_token(RPAREN)) {
@@ -3063,7 +3075,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Semicolon_107_20_46() {
+    private boolean jj_3R_Semicolon_107_20_48() {
         if (jj_scan_token(SEMICOLON)) {
             return true;
         }
@@ -3073,7 +3085,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_BracketSuffix_309_5_91() {
+    private boolean jj_3R_BracketSuffix_309_5_93() {
         if (jj_scan_token(LBRACK)) {
             return true;
         }
@@ -3086,8 +3098,8 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_ValueSuffix_291_21_79() {
-        if (jj_3R_BracketSuffix_309_5_91()) {
+    private boolean jj_3R_ValueSuffix_291_21_81() {
+        if (jj_3R_BracketSuffix_309_5_93()) {
             return true;
         }
         return false;
@@ -3127,7 +3139,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_DotSuffix_300_5_90() {
+    private boolean jj_3R_DotSuffix_300_5_92() {
         if (jj_scan_token(DOT)) {
             return true;
         }
@@ -3137,14 +3149,14 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Semicolon_107_5_42() {
+    private boolean jj_3R_Semicolon_107_5_43() {
         if (jj_3R_Assignment_115_5_20()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_Semicolon_107_20_46()) {
+            if (jj_3R_Semicolon_107_20_48()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -3152,77 +3164,77 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_ValueSuffix_291_7_78() {
-        if (jj_3R_DotSuffix_300_5_90()) {
+    private boolean jj_3R_ValueSuffix_291_7_80() {
+        if (jj_3R_DotSuffix_300_5_92()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_ValueSuffix_291_5_75() {
+    private boolean jj_3R_ValueSuffix_291_5_77() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_ValueSuffix_291_7_78()) {
+        if (jj_3R_ValueSuffix_291_7_80()) {
             jj_scanpos = xsp;
-            if (jj_3R_ValueSuffix_291_21_79()) {
+            if (jj_3R_ValueSuffix_291_21_81()) {
                 return true;
             }
         }
         xsp = jj_scanpos;
-        if (jj_3R_ValueSuffix_291_41_108()) {
+        if (jj_3R_ValueSuffix_291_41_110()) {
             jj_scanpos = xsp;
         }
         return false;
     }
 
     private boolean jj_3R_Expression_99_5_36() {
-        if (jj_3R_Semicolon_107_5_42()) {
+        if (jj_3R_Semicolon_107_5_43()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Value_272_21_72() {
-        if (jj_3R_ValueSuffix_291_5_75()) {
+    private boolean jj_3R_Value_272_21_74() {
+        if (jj_3R_ValueSuffix_291_5_77()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_ValuePrefix_282_7_74() {
-        if (jj_3R_NonLiteral_326_5_77()) {
+    private boolean jj_3R_ValuePrefix_282_7_76() {
+        if (jj_3R_NonLiteral_326_5_79()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_ValuePrefix_281_5_71() {
+    private boolean jj_3R_ValuePrefix_281_5_73() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_ValuePrefix_281_5_73()) {
+        if (jj_3R_ValuePrefix_281_5_75()) {
             jj_scanpos = xsp;
-            if (jj_3R_ValuePrefix_282_7_74()) {
+            if (jj_3R_ValuePrefix_282_7_76()) {
                 return true;
             }
         }
         return false;
     }
 
-    private boolean jj_3R_ValuePrefix_281_5_73() {
-        if (jj_3R_Literal_408_5_76()) {
+    private boolean jj_3R_ValuePrefix_281_5_75() {
+        if (jj_3R_Literal_408_5_78()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Value_272_5_70() {
-        if (jj_3R_ValuePrefix_281_5_71()) {
+    private boolean jj_3R_Value_272_5_72() {
+        if (jj_3R_ValuePrefix_281_5_73()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_Value_272_21_72()) {
+            if (jj_3R_Value_272_21_74()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -3230,31 +3242,31 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Null_458_5_96() {
+    private boolean jj_3R_Null_458_5_98() {
         if (jj_scan_token(NULL)) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Unary_263_9_66() {
-        if (jj_3R_Value_272_5_70()) {
+    private boolean jj_3R_Unary_263_9_68() {
+        if (jj_3R_Value_272_5_72()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Unary_261_9_65() {
+    private boolean jj_3R_Unary_261_9_67() {
         if (jj_scan_token(EMPTY)) {
             return true;
         }
-        if (jj_3R_Unary_257_9_59()) {
+        if (jj_3R_Unary_257_9_61()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Unary_259_9_64() {
+    private boolean jj_3R_Unary_259_9_66() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(37)) {
@@ -3263,22 +3275,22 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Unary_257_9_59()) {
+        if (jj_3R_Unary_257_9_61()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Unary_257_9_59() {
+    private boolean jj_3R_Unary_257_9_61() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_Unary_257_9_63()) {
+        if (jj_3R_Unary_257_9_65()) {
             jj_scanpos = xsp;
-            if (jj_3R_Unary_259_9_64()) {
+            if (jj_3R_Unary_259_9_66()) {
                 jj_scanpos = xsp;
-                if (jj_3R_Unary_261_9_65()) {
+                if (jj_3R_Unary_261_9_67()) {
                     jj_scanpos = xsp;
-                    if (jj_3R_Unary_263_9_66()) {
+                    if (jj_3R_Unary_263_9_68()) {
                         return true;
                     }
                 }
@@ -3287,24 +3299,24 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Unary_257_9_63() {
+    private boolean jj_3R_Unary_257_9_65() {
         if (jj_scan_token(MINUS)) {
             return true;
         }
-        if (jj_3R_Unary_257_9_59()) {
+        if (jj_3R_Unary_257_9_61()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_String_449_5_95() {
+    private boolean jj_3R_String_449_5_97() {
         if (jj_scan_token(STRING_LITERAL)) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Multiplication_247_9_69() {
+    private boolean jj_3R_Multiplication_247_9_71() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(51)) {
@@ -3313,20 +3325,20 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Unary_257_9_59()) {
+        if (jj_3R_Unary_257_9_61()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Integer_440_5_94() {
+    private boolean jj_3R_Integer_440_5_96() {
         if (jj_scan_token(INTEGER_LITERAL)) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Multiplication_245_9_68() {
+    private boolean jj_3R_Multiplication_245_9_70() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(49)) {
@@ -3335,20 +3347,20 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Unary_257_9_59()) {
+        if (jj_3R_Unary_257_9_61()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Multiplication_243_9_60() {
+    private boolean jj_3R_Multiplication_243_9_62() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_Multiplication_243_9_67()) {
+        if (jj_3R_Multiplication_243_9_69()) {
             jj_scanpos = xsp;
-            if (jj_3R_Multiplication_245_9_68()) {
+            if (jj_3R_Multiplication_245_9_70()) {
                 jj_scanpos = xsp;
-                if (jj_3R_Multiplication_247_9_69()) {
+                if (jj_3R_Multiplication_247_9_71()) {
                     return true;
                 }
             }
@@ -3356,24 +3368,24 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Multiplication_243_9_67() {
+    private boolean jj_3R_Multiplication_243_9_69() {
         if (jj_scan_token(MULT)) {
             return true;
         }
-        if (jj_3R_Unary_257_9_59()) {
+        if (jj_3R_Unary_257_9_61()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Multiplication_241_5_57() {
-        if (jj_3R_Unary_257_9_59()) {
+    private boolean jj_3R_Multiplication_241_5_59() {
+        if (jj_3R_Unary_257_9_61()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_Multiplication_243_9_60()) {
+            if (jj_3R_Multiplication_243_9_62()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -3381,79 +3393,79 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_FloatingPoint_431_5_93() {
+    private boolean jj_3R_FloatingPoint_431_5_95() {
         if (jj_scan_token(FLOATING_POINT_LITERAL)) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Math_231_9_62() {
+    private boolean jj_3R_Math_231_9_64() {
         if (jj_scan_token(MINUS)) {
             return true;
         }
-        if (jj_3R_Multiplication_241_5_57()) {
+        if (jj_3R_Multiplication_241_5_59()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Boolean_423_7_101() {
+    private boolean jj_3R_Boolean_423_7_103() {
         if (jj_scan_token(FALSE)) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Math_229_9_58() {
+    private boolean jj_3R_Math_229_9_60() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_Math_229_9_61()) {
+        if (jj_3R_Math_229_9_63()) {
             jj_scanpos = xsp;
-            if (jj_3R_Math_231_9_62()) {
+            if (jj_3R_Math_231_9_64()) {
                 return true;
             }
         }
         return false;
     }
 
-    private boolean jj_3R_Math_229_9_61() {
+    private boolean jj_3R_Math_229_9_63() {
         if (jj_scan_token(PLUS)) {
             return true;
         }
-        if (jj_3R_Multiplication_241_5_57()) {
+        if (jj_3R_Multiplication_241_5_59()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Boolean_421_5_100() {
+    private boolean jj_3R_Boolean_421_5_102() {
         if (jj_scan_token(TRUE)) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Boolean_421_5_92() {
+    private boolean jj_3R_Boolean_421_5_94() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_Boolean_421_5_100()) {
+        if (jj_3R_Boolean_421_5_102()) {
             jj_scanpos = xsp;
-            if (jj_3R_Boolean_423_7_101()) {
+            if (jj_3R_Boolean_423_7_103()) {
                 return true;
             }
         }
         return false;
     }
 
-    private boolean jj_3R_Math_227_5_51() {
-        if (jj_3R_Multiplication_241_5_57()) {
+    private boolean jj_3R_Math_227_5_53() {
+        if (jj_3R_Multiplication_241_5_59()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_Math_229_9_58()) {
+            if (jj_3R_Math_229_9_60()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -3461,45 +3473,45 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Literal_412_7_84() {
-        if (jj_3R_Null_458_5_96()) {
+    private boolean jj_3R_Literal_412_7_86() {
+        if (jj_3R_Null_458_5_98()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Literal_411_7_83() {
-        if (jj_3R_String_449_5_95()) {
+    private boolean jj_3R_Literal_411_7_85() {
+        if (jj_3R_String_449_5_97()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Concatenation_217_10_52() {
+    private boolean jj_3R_Concatenation_217_10_54() {
         if (jj_scan_token(CONCAT)) {
             return true;
         }
-        if (jj_3R_Math_227_5_51()) {
+        if (jj_3R_Math_227_5_53()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Literal_410_7_82() {
-        if (jj_3R_Integer_440_5_94()) {
+    private boolean jj_3R_Literal_410_7_84() {
+        if (jj_3R_Integer_440_5_96()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Literal_409_7_81() {
-        if (jj_3R_FloatingPoint_431_5_93()) {
+    private boolean jj_3R_Literal_409_7_83() {
+        if (jj_3R_FloatingPoint_431_5_95()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Function_390_24_102() {
+    private boolean jj_3R_Function_390_24_104() {
         if (jj_scan_token(COLON)) {
             return true;
         }
@@ -3509,25 +3521,25 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Literal_408_5_80() {
-        if (jj_3R_Boolean_421_5_92()) {
+    private boolean jj_3R_Literal_408_5_82() {
+        if (jj_3R_Boolean_421_5_94()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Literal_408_5_76() {
+    private boolean jj_3R_Literal_408_5_78() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_Literal_408_5_80()) {
+        if (jj_3R_Literal_408_5_82()) {
             jj_scanpos = xsp;
-            if (jj_3R_Literal_409_7_81()) {
+            if (jj_3R_Literal_409_7_83()) {
                 jj_scanpos = xsp;
-                if (jj_3R_Literal_410_7_82()) {
+                if (jj_3R_Literal_410_7_84()) {
                     jj_scanpos = xsp;
-                    if (jj_3R_Literal_411_7_83()) {
+                    if (jj_3R_Literal_411_7_85()) {
                         jj_scanpos = xsp;
-                        if (jj_3R_Literal_412_7_84()) {
+                        if (jj_3R_Literal_412_7_86()) {
                             return true;
                         }
                     }
@@ -3537,14 +3549,14 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Concatenation_215_6_47() {
-        if (jj_3R_Math_227_5_51()) {
+    private boolean jj_3R_Concatenation_215_6_49() {
+        if (jj_3R_Math_227_5_53()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_Concatenation_217_10_52()) {
+            if (jj_3R_Concatenation_217_10_54()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -3552,14 +3564,14 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Function_399_7_103() {
-        if (jj_3R_MethodParameters_317_5_106()) {
+    private boolean jj_3R_Function_399_7_105() {
+        if (jj_3R_MethodParameters_317_5_108()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Compare_204_9_56() {
+    private boolean jj_3R_Compare_204_9_58() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(29)) {
@@ -3568,13 +3580,13 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Concatenation_215_6_47()) {
+        if (jj_3R_Concatenation_215_6_49()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Compare_202_9_55() {
+    private boolean jj_3R_Compare_202_9_57() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(31)) {
@@ -3583,13 +3595,13 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Concatenation_215_6_47()) {
+        if (jj_3R_Concatenation_215_6_49()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Compare_200_9_54() {
+    private boolean jj_3R_Compare_200_9_56() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(25)) {
@@ -3598,22 +3610,22 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Concatenation_215_6_47()) {
+        if (jj_3R_Concatenation_215_6_49()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Compare_198_9_48() {
+    private boolean jj_3R_Compare_198_9_50() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_Compare_198_9_53()) {
+        if (jj_3R_Compare_198_9_55()) {
             jj_scanpos = xsp;
-            if (jj_3R_Compare_200_9_54()) {
+            if (jj_3R_Compare_200_9_56()) {
                 jj_scanpos = xsp;
-                if (jj_3R_Compare_202_9_55()) {
+                if (jj_3R_Compare_202_9_57()) {
                     jj_scanpos = xsp;
-                    if (jj_3R_Compare_204_9_56()) {
+                    if (jj_3R_Compare_204_9_58()) {
                         return true;
                     }
                 }
@@ -3622,7 +3634,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Compare_198_9_53() {
+    private boolean jj_3R_Compare_198_9_55() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(27)) {
@@ -3631,27 +3643,27 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Concatenation_215_6_47()) {
+        if (jj_3R_Concatenation_215_6_49()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Function_390_5_97() {
+    private boolean jj_3R_Function_390_5_99() {
         if (jj_scan_token(IDENTIFIER)) {
             return true;
         }
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_Function_390_24_102()) {
+        if (jj_3R_Function_390_24_104()) {
             jj_scanpos = xsp;
         }
-        if (jj_3R_Function_399_7_103()) {
+        if (jj_3R_Function_399_7_105()) {
             return true;
         }
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_Function_399_7_103()) {
+            if (jj_3R_Function_399_7_105()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -3659,14 +3671,14 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Compare_196_5_44() {
-        if (jj_3R_Concatenation_215_6_47()) {
+    private boolean jj_3R_Compare_196_5_45() {
+        if (jj_3R_Concatenation_215_6_49()) {
             return true;
         }
         Token xsp;
         while (true) {
             xsp = jj_scanpos;
-            if (jj_3R_Compare_198_9_48()) {
+            if (jj_3R_Compare_198_9_50()) {
                 jj_scanpos = xsp;
                 break;
             }
@@ -3674,7 +3686,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
-    private boolean jj_3R_Equality_186_9_50() {
+    private boolean jj_3R_Equality_186_9_52() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(35)) {
@@ -3683,25 +3695,25 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Compare_196_5_44()) {
+        if (jj_3R_Compare_196_5_45()) {
             return true;
         }
         return false;
     }
 
-    private boolean jj_3R_Equality_184_9_45() {
+    private boolean jj_3R_Equality_184_9_46() {
         Token xsp;
         xsp = jj_scanpos;
-        if (jj_3R_Equality_184_9_49()) {
+        if (jj_3R_Equality_184_9_51()) {
             jj_scanpos = xsp;
-            if (jj_3R_Equality_186_9_50()) {
+            if (jj_3R_Equality_186_9_52()) {
                 return true;
             }
         }
         return false;
     }
 
-    private boolean jj_3R_Equality_184_9_49() {
+    private boolean jj_3R_Equality_184_9_51() {
         Token xsp;
         xsp = jj_scanpos;
         if (jj_scan_token(33)) {
@@ -3710,7 +3722,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
                 return true;
             }
         }
-        if (jj_3R_Compare_196_5_44()) {
+        if (jj_3R_Compare_196_5_45()) {
             return true;
         }
         return false;
@@ -3723,6 +3735,36 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         return false;
     }
 
+    private boolean jj_3R_And_174_17_41() {
+        Token xsp;
+        if (jj_3R_And_173_18_47()) {
+            return true;
+        }
+        while (true) {
+            xsp = jj_scanpos;
+            if (jj_3R_And_173_18_47()) {
+                jj_scanpos = xsp;
+                break;
+            }
+        }
+        return false;
+    }
+
+    private boolean jj_3R_And_173_18_47() {
+        Token xsp;
+        xsp = jj_scanpos;
+        if (jj_scan_token(39)) {
+            jj_scanpos = xsp;
+            if (jj_scan_token(40)) {
+                return true;
+            }
+        }
+        if (jj_3R_Equality_182_5_40()) {
+            return true;
+        }
+        return false;
+    }
+
     private boolean jj_3R_Identifier_377_5_38() {
         if (jj_scan_token(IDENTIFIER)) {
             return true;
@@ -3741,7 +3783,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
     private Token jj_scanpos, jj_lastpos;
     private int jj_la;
     private int jj_gen;
-    final private int[] jj_la1 = new int[52];
+    final private int[] jj_la1 = new int[54];
     static private int[] jj_la1_0;
     static private int[] jj_la1_1;
     static {
@@ -3751,7 +3793,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
 
     private static void jj_la1_init_0() {
         jj_la1_0 = new int[] { 0xe, 0xe, 0x800000, 0x15ed00, 0x15ed00, 
0x1000000, 0x0, 0x40000, 0x15ed00, 0x40000, 0x0,
-                0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfe000000, 0x18000000, 
0x6000000, 0x80000000, 0x60000000,
+                0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfe000000, 
0x18000000, 0x6000000, 0x80000000, 0x60000000,
                 0xfe000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15ed00, 
0x120000, 0x15ed00, 0x120000, 0x40000,
                 0x1000000, 0x15ed00, 0x40000, 0x0, 0x100100, 0x1000000, 
0x15ed00, 0x1000000, 0x15ed00, 0x1000000,
                 0x15ed00, 0x400000, 0x40000, 0x1ec00, 0xc000, };
@@ -3759,9 +3801,9 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
 
     private static void jj_la1_init_1() {
         jj_la1_1 = new int[] { 0x0, 0x0, 0x0, 0x1008860, 0x1008860, 0x0, 
0x1000000, 0x1000000, 0x1008860, 0x0, 0x600,
-                0x600, 0x180, 0x180, 0x1e, 0x6, 0x18, 0x1e, 0x1, 0x0, 0x0, 
0x1, 0x0, 0x1, 0x200000, 0xc000, 0xc000,
-                0x1e2000, 0x60000, 0x180000, 0x1e2000, 0x60, 0x1008860, 0x0, 
0x1000000, 0x0, 0x0, 0x0, 0x1008860, 0x0,
-                0x1000000, 0x0, 0x0, 0x1008860, 0x0, 0x1008860, 0x0, 
0x1008860, 0x0, 0x0, 0x0, 0x0, };
+                0x600, 0x600, 0x180, 0x180, 0x180, 0x1e, 0x6, 0x18, 0x1e, 0x1, 
0x0, 0x0, 0x1, 0x0, 0x1, 0x200000,
+                0xc000, 0xc000, 0x1e2000, 0x60000, 0x180000, 0x1e2000, 0x60, 
0x1008860, 0x0, 0x1000000, 0x0, 0x0, 0x0,
+                0x1008860, 0x0, 0x1000000, 0x0, 0x0, 0x1008860, 0x0, 
0x1008860, 0x0, 0x1008860, 0x0, 0x0, 0x0, 0x0, };
     }
 
     final private JJCalls[] jj_2_rtns = new JJCalls[8];
@@ -3784,7 +3826,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         token = new Token();
         jj_ntk = -1;
         jj_gen = 0;
-        for (int i = 0; i < 52; i++) {
+        for (int i = 0; i < 54; i++) {
             jj_la1[i] = -1;
         }
         for (int i = 0; i < jj_2_rtns.length; i++) {
@@ -3809,7 +3851,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         jj_ntk = -1;
         jjtree.reset();
         jj_gen = 0;
-        for (int i = 0; i < 52; i++) {
+        for (int i = 0; i < 54; i++) {
             jj_la1[i] = -1;
         }
         for (int i = 0; i < jj_2_rtns.length; i++) {
@@ -3824,7 +3866,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         token = new Token();
         jj_ntk = -1;
         jj_gen = 0;
-        for (int i = 0; i < 52; i++) {
+        for (int i = 0; i < 54; i++) {
             jj_la1[i] = -1;
         }
         for (int i = 0; i < jj_2_rtns.length; i++) {
@@ -3848,7 +3890,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         jj_ntk = -1;
         jjtree.reset();
         jj_gen = 0;
-        for (int i = 0; i < 52; i++) {
+        for (int i = 0; i < 54; i++) {
             jj_la1[i] = -1;
         }
         for (int i = 0; i < jj_2_rtns.length; i++) {
@@ -3862,7 +3904,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         token = new Token();
         jj_ntk = -1;
         jj_gen = 0;
-        for (int i = 0; i < 52; i++) {
+        for (int i = 0; i < 54; i++) {
             jj_la1[i] = -1;
         }
         for (int i = 0; i < jj_2_rtns.length; i++) {
@@ -3877,7 +3919,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
         jj_ntk = -1;
         jjtree.reset();
         jj_gen = 0;
-        for (int i = 0; i < 52; i++) {
+        for (int i = 0; i < 54; i++) {
             jj_la1[i] = -1;
         }
         for (int i = 0; i < jj_2_rtns.length; i++) {
@@ -4041,7 +4083,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
             la1tokens[jj_kind] = true;
             jj_kind = -1;
         }
-        for (int i = 0; i < 52; i++) {
+        for (int i = 0; i < 54; i++) {
             if (jj_la1[i] == jj_gen) {
                 for (int j = 0; j < 32; j++) {
                     if ((jj_la1_0[i] & (1 << j)) != 0) {
diff --git a/java/org/apache/el/parser/ELParser.jjt 
b/java/org/apache/el/parser/ELParser.jjt
index ce9c7fe431..8739d038cc 100644
--- a/java/org/apache/el/parser/ELParser.jjt
+++ b/java/org/apache/el/parser/ELParser.jjt
@@ -161,7 +161,7 @@ void Choice() : {}
  */
 void Or() : {}
 {
-    And() ((<OR0>|<OR1>) And() #Or(2))*
+    And() [((<OR0>|<OR1>) And())+ #Or(jjtree.nodeArity() + 1)]
 }
 
 /*
@@ -170,7 +170,7 @@ void Or() : {}
  */
 void And() : {}
 {
-    Equality() ((<AND0>|<AND1>) Equality() #And(2))*
+    Equality() [((<AND0>|<AND1>) Equality())+ #And(jjtree.nodeArity() + 1)]
 }
 
 /*
diff --git a/test/org/apache/el/parser/TestELParserPerformance.java 
b/test/org/apache/el/parser/TestELParserPerformance.java
index eb860f4be9..424a6fe27f 100644
--- a/test/org/apache/el/parser/TestELParserPerformance.java
+++ b/test/org/apache/el/parser/TestELParserPerformance.java
@@ -19,8 +19,13 @@ package org.apache.el.parser;
 import java.io.StringReader;
 
 import jakarta.el.ELBaseTest;
+import jakarta.el.ELContext;
+import jakarta.el.ELManager;
+import jakarta.el.ExpressionFactory;
+import jakarta.el.ValueExpression;
 
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import org.apache.tomcat.util.collections.SynchronizedStack;
@@ -91,4 +96,50 @@ public class TestELParserPerformance extends ELBaseTest {
 
         Assert.assertTrue("Using new ElParser() was faster then using 
ELParser.ReInit", reinitTotalTime < newTotalTime);
     }
+
+
+    /*
+     * Ignored by default since this is an absolute test primarily for
+     * https://bz.apache.org/bugzilla/show_bug.cgi?id=69338
+     */
+    @Ignore
+    @Test
+    public void testAstAnd() {
+
+        ELManager manager = new ELManager();
+        ELContext context = manager.getELContext();
+        ExpressionFactory factory = ELManager.getExpressionFactory();
+
+        long durations[] = new long[9];
+        for (int j = 0; j < 5; j++) {
+            for (int operandCount = 2; operandCount < 11; operandCount ++) {
+
+                StringBuilder sb = new StringBuilder("${true");
+                for (int i = 2; i <= operandCount; i++) {
+                    sb.append(" && true");
+                }
+                sb.append("}");
+
+                String expression = sb.toString();
+
+                long start = System.nanoTime();
+
+                for (int i = 0; i < 2000000; i++) {
+                    ValueExpression ve = 
factory.createValueExpression(context, expression, Boolean.class);
+                    Boolean result = ve.getValue(context);
+                    Assert.assertEquals(Boolean.TRUE, result);
+                }
+
+                long duration = System.nanoTime() - start;
+
+                if (j > 0) {
+                    durations[operandCount - 2] += duration;
+                }
+            }
+        }
+        for (int operandCount = 2; operandCount < 11; operandCount ++) {
+            System.out.println("Operand count [" + operandCount + "], duration 
[" + durations[operandCount -2] + "]");
+        }
+        System.out.println("");
+    }
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index aa367c6257..1130159b5c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -164,6 +164,10 @@
       <fix>
         <bug>69333</bug>: Remove unnecessary code from generated JSPs. (markt)
       </fix>
+      <fix>
+        <bug>69338</bug>: Improve the performance of processing expressions 
that
+        include AND or OR operations with more than two operands. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to