Re: Coyote Request getRequestId()

2024-09-25 Thread Igal Sapir
Chris and Mark,

On Wed, Sep 25, 2024 at 7:47 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Igal and Mark,
>
> On 9/24/24 13:55, Igal Sapir wrote:
> > Mark,
> >
> >
> >> On Mon, Sep 23, 2024 at 12:25 AM Mark Thomas  wrote:
> >>
> >>> On 23/09/2024 04:28, Igal Sapir wrote:
>  Hello,
> 
>  The current implementation of getRequestId() is optimized for speed
> and
>  generates IDs that are unique to a running instance of Tomcat.
> 
>  But most server configurations nowadays require uniqueness across the
> >>> whole
>  system, and currently we do not offer that as:
> 
>  1. Request IDs are only unique to a running Tomcat instance
> 
>  2. Request IDs are reset to 0 each time Tomcat is restarted
> 
>  3. Request IDs are sometimes generated by another system like a load
>  balancer or reverse proxy, and passed around via the HTTP header
>  "X-Request-Id"
> 
>  I want to propose a patch that would:
> 
>  1. Check for HTTP header "X-Request-Id" and if valid (e.g. does not
> >>> attempt
>  SQL or XSS injection etc.) returns it
> >>>
> >>>
> >>> That is behaviour we'd typically place in a Valve or Filter. Possibly
> an
> >>> extension to the RemoteIp[Valve|Filter] ?
> >>>
> >>> Rather than us validate it, I'd make processing it optional and the
> >>> admins responsibility to ensure it is trusted if they opt to process
> it.
> >>>
> >>
> > Yes, that makes sense.  I can add that part to the RemoteIp[Valve|Filter]
> > as long as we can add a Setter for requestId that can be called from the
> > filter/valve.
>
> I could have sworn this feature already existed. Rainer added support
> for httpd-generated unique request identifiers to mod_jk a while back
> and maybe I just assumed that he also added the code in Tomcat to accept
> them and wire them into getRequestId.
>
>  2. Generates a URL-safe Base64-encoded UUID (22 CaSe sensitive
> >>> characters)
> >>>
> >>> How expensive is that process compared to the existing mechanism?
> >>>
> >>
> > I will run some benchmarks to find out.  While it would almost certainly
> be
> > more expensive than AtomicLong.incrementAndGet(), I would think that the
> > value that it adds can be acceptable up to some arbitrary threshold of
> > per-request overhead, e.g. 1ms is too much but 50us might be acceptable.
> >
> > We could also make it lazy-init so that it is only processed when
> > getRequestId() is called the first time per Request (though I would want
> it
> > in the Logs so every request would trigger it in that case), and possibly
> > and opt-in and pluggable implementation according to the next point
> below.
>
> We could also generate a "proper" UUID on startup, discard a portion of
> it, and then increment a counter on each request. OR maybe not even
> bother discarding anything. Just a huge integer value that we begin
> randomly and then increment from there.
>
> I'd like to see the performance numbers, of course.
>

I now have the performance numbers to show.  I tested 4 implementations on
my laptop, which has a CPU from late 2015 with 4 cores and 2 threads each,
i.e. 8 CPU threads: Intel(R) Xeon(R) CPU E3-1505M v5 @ 2.80GHz.  The
implementations are:

1. The current implementation, i.e. AtomicLong as Hex string

2. UUIDv4 via java.util.UUID.randomUUID(), e.g.
"3f31da8f-d5ec-4409-ba26-516793cb676d"

3. UUIDv4 Short, i.e. Base64 URL Encode of option 2 above, e.g.
"PNY3MaFjSROh4Sxytzg76A"

4. UUIDv7 via f4b6a3/uuid-creator [2], e.g.
"01922cab-468f-77a9-b4e8-2c242d53f47d", which offers chronological order
but requires a dependency (only 56KB though) and adds some risk as it is
less tested than the JDK implementations

As expected, options 2, 3, and 4 are 15x - 20x compared to option 1:

   Benchmark  Mode  CntScoreError
 Units
1. BenchmarkIdGenerator.benchAtomicLong   avgt5   21.698 ±  0.227
 ns/op
2. BenchmarkIdGenerator.benchmarkUuidV4   avgt5  398.252 ± 13.169
 ns/op
3. BenchmarkIdGenerator.benchmarkUuidV4Short  avgt5  417.014 ± 14.663
 ns/op
4. BenchmarkIdGenerator.benchmarkUuidV7   avgt5  279.479 ±  3.570
 ns/op

But as can be seen above (all times are in nanoseconds), so even option 3,
which is the "slowest", takes less than half a microsecond.



>
> I like the idea of lazy work, here. Since this is a new feature in the
> spec, probably 0% of applications are using it right now. Why bother
> wasting CPU cycles generating request identifiers for applications that
> aren't even using them?
>
>  The value will be set to the requestId private variable to ensure
>  consistent return value for multiple calls on the same Request.
> 
>  I have the code ready, but wanted to discuss the matter here first.
> >>>
> >>> The Servlet spec requires only that the ID is unique for the lifetime
> of
> >>> the container.
> >>>
> >>> How will this interact with ServletRequest.getRequestId() and the
> >>> assoc

(tomcat) branch 9.0.x updated: Regenerate with latest JavaCC then run code-cleanup

2024-09-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 079bd88461 Regenerate with latest JavaCC then run code-cleanup
079bd88461 is described below

commit 079bd88461f7099375af0ad524fab3efde140dad
Author: Mark Thomas 
AuthorDate: Wed Sep 25 20:32:13 2024 +0100

Regenerate with latest JavaCC then run code-cleanup
---
 java/org/apache/el/parser/ELParserConstants.java   | 61 +---
 .../org/apache/el/parser/ELParserTokenManager.java | 81 +-
 .../apache/el/parser/ELParserTreeConstants.java| 44 +---
 java/org/apache/el/parser/JJTELParserState.java| 12 
 4 files changed, 4 insertions(+), 194 deletions(-)

diff --git a/java/org/apache/el/parser/ELParserConstants.java 
b/java/org/apache/el/parser/ELParserConstants.java
index 64be914f31..9eb57a6cc8 100644
--- a/java/org/apache/el/parser/ELParserConstants.java
+++ b/java/org/apache/el/parser/ELParserConstants.java
@@ -1,6 +1,7 @@
 /* Generated By:JJTree&JavaCC: Do not edit this line. ELParserConstants.java */
 package org.apache.el.parser;
 
+
 /**
  * Token literal values and constants. Generated by 
org.javacc.parser.OtherFilesGen#start()
  */
@@ -8,184 +9,125 @@ public interface ELParserConstants {
 
 /** End of File. */
 int EOF = 0;
-
 /** RegularExpression Id. */
 int LITERAL_EXPRESSION = 1;
-
 /** RegularExpression Id. */
 int START_DYNAMIC_EXPRESSION = 2;
-
 /** RegularExpression Id. */
 int START_DEFERRED_EXPRESSION = 3;
-
 /** RegularExpression Id. */
 int START_SET_OR_MAP = 8;
-
 /** RegularExpression Id. */
 int RBRACE = 9;
-
 /** RegularExpression Id. */
 int INTEGER_LITERAL = 10;
-
 /** RegularExpression Id. */
 int FLOATING_POINT_LITERAL = 11;
-
 /** RegularExpression Id. */
 int EXPONENT = 12;
-
 /** RegularExpression Id. */
 int STRING_LITERAL = 13;
-
 /** RegularExpression Id. */
 int TRUE = 14;
-
 /** RegularExpression Id. */
 int FALSE = 15;
-
 /** RegularExpression Id. */
 int NULL = 16;
-
 /** RegularExpression Id. */
 int DOT = 17;
-
 /** RegularExpression Id. */
 int LPAREN = 18;
-
 /** RegularExpression Id. */
 int RPAREN = 19;
-
 /** RegularExpression Id. */
 int LBRACK = 20;
-
 /** RegularExpression Id. */
 int RBRACK = 21;
-
 /** RegularExpression Id. */
 int COLON = 22;
-
 /** RegularExpression Id. */
 int SEMICOLON = 23;
-
 /** RegularExpression Id. */
 int COMMA = 24;
-
 /** RegularExpression Id. */
 int GT0 = 25;
-
 /** RegularExpression Id. */
 int GT1 = 26;
-
 /** RegularExpression Id. */
 int LT0 = 27;
-
 /** RegularExpression Id. */
 int LT1 = 28;
-
 /** RegularExpression Id. */
 int GE0 = 29;
-
 /** RegularExpression Id. */
 int GE1 = 30;
-
 /** RegularExpression Id. */
 int LE0 = 31;
-
 /** RegularExpression Id. */
 int LE1 = 32;
-
 /** RegularExpression Id. */
 int EQ0 = 33;
-
 /** RegularExpression Id. */
 int EQ1 = 34;
-
 /** RegularExpression Id. */
 int NE0 = 35;
-
 /** RegularExpression Id. */
 int NE1 = 36;
-
 /** RegularExpression Id. */
 int NOT0 = 37;
-
 /** RegularExpression Id. */
 int NOT1 = 38;
-
 /** RegularExpression Id. */
 int AND0 = 39;
-
 /** RegularExpression Id. */
 int AND1 = 40;
-
 /** RegularExpression Id. */
 int OR0 = 41;
-
 /** RegularExpression Id. */
 int OR1 = 42;
-
 /** RegularExpression Id. */
 int EMPTY = 43;
-
 /** RegularExpression Id. */
 int INSTANCEOF = 44;
-
 /** RegularExpression Id. */
 int MULT = 45;
-
 /** RegularExpression Id. */
 int PLUS = 46;
-
 /** RegularExpression Id. */
 int MINUS = 47;
-
 /** RegularExpression Id. */
 int QUESTIONMARK = 48;
-
 /** RegularExpression Id. */
 int DIV0 = 49;
-
 /** RegularExpression Id. */
 int DIV1 = 50;
-
 /** RegularExpression Id. */
 int MOD0 = 51;
-
 /** RegularExpression Id. */
 int MOD1 = 52;
-
 /** RegularExpression Id. */
 int CONCAT = 53;
-
 /** RegularExpression Id. */
 int ASSIGN = 54;
-
 /** RegularExpression Id. */
 int ARROW = 55;
-
 /** RegularExpression Id. */
 int IDENTIFIER = 56;
-
 /** RegularExpression Id. */
 int FUNCTIONSUFFIX = 57;
-
 /** RegularExpression Id. */
 int IMPL_OBJ_START = 58;
-
 /** RegularExpression Id. */
 int LETTER = 59;
-
 /** RegularExpression Id. */
 int DIGIT = 60;
-
 /** RegularExpression Id. */
 int ILLEGAL_CHARACTER = 61;
 
 /** Lexical state. */
 int DEFAULT = 0;
-
 /** Lexical state. */
 int IN_EXPRESSION = 1;
-
 /** Lexical state. */
 int IN_SET_OR_MAP = 2;
 
@@ -198,4 +140,5 

(tomcat) branch 10.1.x updated: Regenerate with latest JavaCC and then run code-cleanup

2024-09-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new cee261446c Regenerate with latest JavaCC and then run code-cleanup
cee261446c is described below

commit cee261446c3e3ecd6d209cf14c0c9d525b2306e0
Author: Mark Thomas 
AuthorDate: Wed Sep 25 20:30:04 2024 +0100

Regenerate with latest JavaCC and then run code-cleanup
---
 .../apache/el/parser/ELParserTreeConstants.java| 44 +-
 java/org/apache/el/parser/JJTELParserState.java| 12 --
 2 files changed, 1 insertion(+), 55 deletions(-)

diff --git a/java/org/apache/el/parser/ELParserTreeConstants.java 
b/java/org/apache/el/parser/ELParserTreeConstants.java
index ab1623e62e..240eaf2c90 100644
--- a/java/org/apache/el/parser/ELParserTreeConstants.java
+++ b/java/org/apache/el/parser/ELParserTreeConstants.java
@@ -2,93 +2,51 @@
 package org.apache.el.parser;
 
 public interface ELParserTreeConstants {
-
 int JJTCOMPOSITEEXPRESSION = 0;
-
 int JJTLITERALEXPRESSION = 1;
-
 int JJTDEFERREDEXPRESSION = 2;
-
 int JJTDYNAMICEXPRESSION = 3;
-
 int JJTVOID = 4;
-
 int JJTSEMICOLON = 5;
-
 int JJTASSIGN = 6;
-
 int JJTLAMBDAEXPRESSION = 7;
-
 int JJTLAMBDAPARAMETERS = 8;
-
 int JJTCHOICE = 9;
-
 int JJTOR = 10;
-
 int JJTAND = 11;
-
 int JJTEQUAL = 12;
-
 int JJTNOTEQUAL = 13;
-
 int JJTLESSTHAN = 14;
-
 int JJTGREATERTHAN = 15;
-
 int JJTLESSTHANEQUAL = 16;
-
 int JJTGREATERTHANEQUAL = 17;
-
 int JJTCONCATENATION = 18;
-
 int JJTPLUS = 19;
-
 int JJTMINUS = 20;
-
 int JJTMULT = 21;
-
 int JJTDIV = 22;
-
 int JJTMOD = 23;
-
 int JJTNEGATIVE = 24;
-
 int JJTNOT = 25;
-
 int JJTEMPTY = 26;
-
 int JJTVALUE = 27;
-
 int JJTDOTSUFFIX = 28;
-
 int JJTBRACKETSUFFIX = 29;
-
 int JJTMETHODPARAMETERS = 30;
-
 int JJTSETDATA = 31;
-
 int JJTLISTDATA = 32;
-
 int JJTMAPDATA = 33;
-
 int JJTMAPENTRY = 34;
-
 int JJTIDENTIFIER = 35;
-
 int JJTFUNCTION = 36;
-
 int JJTTRUE = 37;
-
 int JJTFALSE = 38;
-
 int JJTFLOATINGPOINT = 39;
-
 int JJTINTEGER = 40;
-
 int JJTSTRING = 41;
-
 int JJTNULL = 42;
 
+
 String[] jjtNodeName = { "CompositeExpression", "LiteralExpression", 
"DeferredExpression", "DynamicExpression",
 "void", "Semicolon", "Assign", "LambdaExpression", 
"LambdaParameters", "Choice", "Or", "And", "Equal",
 "NotEqual", "LessThan", "GreaterThan", "LessThanEqual", 
"GreaterThanEqual", "Concatenation", "Plus",
diff --git a/java/org/apache/el/parser/JJTELParserState.java 
b/java/org/apache/el/parser/JJTELParserState.java
index 7dc18ded58..e7dec64365 100644
--- a/java/org/apache/el/parser/JJTELParserState.java
+++ b/java/org/apache/el/parser/JJTELParserState.java
@@ -3,18 +3,13 @@ package org.apache.el.parser;
 
 @SuppressWarnings("all") // Ignore warnings in generated code
 public class JJTELParserState {
-
 private java.util.List nodes;
-
 private java.util.List marks;
 
 private int sp; // number of nodes on stack
-
 private int mk; // current mark
-
 private boolean node_created;
 
-
 public JJTELParserState() {
 nodes = new java.util.ArrayList();
 marks = new java.util.ArrayList();
@@ -22,7 +17,6 @@ public class JJTELParserState {
 mk = 0;
 }
 
-
 /*
  * Determines whether the current node was actually closed and pushed. 
This should only be called in the final user
  * action of a node scope.
@@ -31,7 +25,6 @@ public class JJTELParserState {
 return node_created;
 }
 
-
 /*
  * Call this to reinitialize the node stack. It is called automatically by 
the parser's ReInit() method.
  */
@@ -42,7 +35,6 @@ public class JJTELParserState {
 mk = 0;
 }
 
-
 /*
  * Returns the root node of the AST. It only makes sense to call this 
after a successful parse.
  */
@@ -50,14 +42,12 @@ public class JJTELParserState {
 return nodes.get(0);
 }
 
-
 /* Pushes a node on to the stack. */
 public void pushNode(Node n) {
 nodes.add(n);
 ++sp;
 }
 
-
 /*
  * Returns the node on the top of the stack, and remove it from the stack.
  */
@@ -68,13 +58,11 @@ public class JJTELParserState {
 return nodes.remove(nodes.size() - 1);
 }
 
-
 /* Returns the node currently on the top of the stack. */
 public Node peekNode() {
 return nodes.get(nodes.size() - 1);
 }
 
-
 /*
  * Returns the number of children on the stack in the current node scope.
  */


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



[Bug 69339] ClassFormatException in Java11 while compiling JSP pages

2024-09-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69339

--- Comment #4 from Mark Thomas  ---
That JAR was never released by the Tomcat project.

Web applications should not be depending on Tomcat internals. Remove the JAR
completely.

If you need further assistance, please use the users mailing list.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69339] ClassFormatException in Java11 while compiling JSP pages

2024-09-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69339

--- Comment #3 from Prudviraj  ---
>From maven site, we can see that this was released in 2018 only. Keeping that
aside please suggest if there is a recent version of the same library that we
use instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69339] ClassFormatException in Java11 while compiling JSP pages

2024-09-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69339

--- Comment #6 from Prudviraj  ---
That's an interesting point. Will try to do some changes keeping this in mind
and see how it goes. Thanks a lot for this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69338] Overhead in El processing (AST*)

2024-09-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69338

--- Comment #5 from Mark Thomas  ---
I've tweaked the parser for AND and OR so it looks for two or more operands
rather than just two.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot success in on tomcat-10.1.x

2024-09-25 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/44/builds/1412
Blamelist: Mark Thomas , remm 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 10.1.x] 8ce050ba2a4e9e9c96306fe8c7e9b486b9a9f165


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



Re: Coyote Request getRequestId()

2024-09-25 Thread Christopher Schultz

Igal and Mark,

On 9/24/24 13:55, Igal Sapir wrote:

Mark,



On Mon, Sep 23, 2024 at 12:25 AM Mark Thomas  wrote:


On 23/09/2024 04:28, Igal Sapir wrote:

Hello,

The current implementation of getRequestId() is optimized for speed and
generates IDs that are unique to a running instance of Tomcat.

But most server configurations nowadays require uniqueness across the

whole

system, and currently we do not offer that as:

1. Request IDs are only unique to a running Tomcat instance

2. Request IDs are reset to 0 each time Tomcat is restarted

3. Request IDs are sometimes generated by another system like a load
balancer or reverse proxy, and passed around via the HTTP header
"X-Request-Id"

I want to propose a patch that would:

1. Check for HTTP header "X-Request-Id" and if valid (e.g. does not

attempt

SQL or XSS injection etc.) returns it



That is behaviour we'd typically place in a Valve or Filter. Possibly an
extension to the RemoteIp[Valve|Filter] ?

Rather than us validate it, I'd make processing it optional and the
admins responsibility to ensure it is trusted if they opt to process it.




Yes, that makes sense.  I can add that part to the RemoteIp[Valve|Filter]
as long as we can add a Setter for requestId that can be called from the
filter/valve.


I could have sworn this feature already existed. Rainer added support 
for httpd-generated unique request identifiers to mod_jk a while back 
and maybe I just assumed that he also added the code in Tomcat to accept 
them and wire them into getRequestId.



2. Generates a URL-safe Base64-encoded UUID (22 CaSe sensitive

characters)

How expensive is that process compared to the existing mechanism?




I will run some benchmarks to find out.  While it would almost certainly be
more expensive than AtomicLong.incrementAndGet(), I would think that the
value that it adds can be acceptable up to some arbitrary threshold of
per-request overhead, e.g. 1ms is too much but 50us might be acceptable.

We could also make it lazy-init so that it is only processed when
getRequestId() is called the first time per Request (though I would want it
in the Logs so every request would trigger it in that case), and possibly
and opt-in and pluggable implementation according to the next point below.


We could also generate a "proper" UUID on startup, discard a portion of 
it, and then increment a counter on each request. OR maybe not even 
bother discarding anything. Just a huge integer value that we begin 
randomly and then increment from there.


I'd like to see the performance numbers, of course.

I like the idea of lazy work, here. Since this is a new feature in the 
spec, probably 0% of applications are using it right now. Why bother 
wasting CPU cycles generating request identifiers for applications that 
aren't even using them?



The value will be set to the requestId private variable to ensure
consistent return value for multiple calls on the same Request.

I have the code ready, but wanted to discuss the matter here first.


The Servlet spec requires only that the ID is unique for the lifetime of
the container.

How will this interact with ServletRequest.getRequestId() and the
associated methods?




My idea is that ServletRequest.getRequestId() would still delegate calls to
Coyote's getRequestId(), so the new implementation would be used for it.





Should we make the request ID generator a pluggable component? If so, of
what?




That would be great as it would allow us to keep the current behavior as
default, for example, make this enhancement opt-in, and allow for future
implementations e.g. UUIDv7 which allows for natural order sorting.


I like plugability, and then we can offer at least two implementations: 
the naive one we have now which guarantees uniqueness within a single 
JVM and another one which guarantees universal uniqueness[1] but likely 
has a bit of a performance penalty.



Which component is a great question.  On one hand I'm thinking that Coyote
is part of the Connectors, but on the other hand we might want to allow
admins to configure different behavior for different Hosts or Contexts?

I personally feel that running multiple Hosts or Contexts in a single
Tomcat deployment is something that was more valuable in the past when
compute resources were much more expensive than they are today.  Nowadays
it is easy to deploy Tomcat in a container like Docker and map the hosts
and ports as needed, and I rarely find myself needing to have different
configurations for different Hosts or Contexts.


Speaking of hosts... since an engine probably already has a jvmRoute 
defined on it, maybe we could use that to provide cross-cluster 
uniqueness. You could have jvmRoute + random seed + counter = request id 
and that should be unique across your cluster.


-chris

[1] Of course, UUIDs are not actually guaranteed to be unique. Just 
really really REALLY unlikely to experience colissions.



-

[Bug 69339] ClassFormatException in Java11 while compiling JSP pages

2024-09-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69339

--- Comment #5 from Christopher Schultz  ---
For those curious, Java 9 introduced the invokeDynamic bytecode instruction
which allows the JVM to highly optimize String concatenation operations. The
"downside" is that it requires a new bytecode instruction that did not exist
when your version of JDT seems to have been written.

Here is a good SO write-up: https://stackoverflow.com/a/42138460/276232

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 69338] Overhead in El processing (AST*)

2024-09-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69338

--- Comment #4 from Christopher Schultz  ---
I'd be interested in how you solved this particular problem, Mark.

Having written a DSL for $work using AntLR, we have this "problem" as well,
where a string of the same binary operators end up being nested inside one
another. For performance-critical uses, we have e.g. a "sum" function that can
be used for 1+2+3+4+5 and both "and" and "or" functions for the obvious boolean
combinations. That seemed easier than trying to tweak the parser to convert
1+2+3+4+5 into sum(1,2,3,4,5) instead of 1+(2+(3+(4+5))).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 11.0.x updated: Add changelog

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 e619cc6a2c Add changelog
e619cc6a2c is described below

commit e619cc6a2cc6f5f6120dd946b522abf3258c017e
Author: remm 
AuthorDate: Wed Sep 25 14:43:10 2024 +0200

Add changelog
---
 webapps/docs/changelog.xml | 8 
 1 file changed, 8 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8b50fceea2..aa367c6257 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -166,6 +166,14 @@
   
 
   
+  
+
+  
+The manager webapp will now be able to access certificates again when
+OpenSSL is used. (remm)
+  
+
+  
 
 
   


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



(tomcat) branch 10.1.x updated: Add changelog

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 5916dc9ec1 Add changelog
5916dc9ec1 is described below

commit 5916dc9ec1a33a8dc5a561b395f0859932b77342
Author: remm 
AuthorDate: Wed Sep 25 14:43:10 2024 +0200

Add changelog
---
 webapps/docs/changelog.xml | 8 
 1 file changed, 8 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4830b54ce5..34e4065919 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -166,6 +166,14 @@
   
 
   
+  
+
+  
+The manager webapp will now be able to access certificates again when
+OpenSSL is used. (remm)
+  
+
+  
 
 
   


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



(tomcat) branch 9.0.x updated: Add changelog

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 76ee358664 Add changelog
76ee358664 is described below

commit 76ee35866427fddda8c69e155d1cf6270ddcdcec
Author: remm 
AuthorDate: Wed Sep 25 14:43:10 2024 +0200

Add changelog
---
 webapps/docs/changelog.xml | 8 
 1 file changed, 8 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3145c557cb..97354b55e0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -157,6 +157,14 @@
   
 
   
+  
+
+  
+The manager webapp will now be able to access certificates again when
+OpenSSL is used. (remm)
+  
+
+  
 
 
   


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



(tomcat) branch main updated: Add manager certificate handling testing

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new ce70a1780b Add manager certificate handling testing
ce70a1780b is described below

commit ce70a1780bfac04034f8361e81d968eedac6410a
Author: remm 
AuthorDate: Wed Sep 25 14:47:53 2024 +0200

Add manager certificate handling testing
---
 .../catalina/manager/TestManagerWebappSsl.java | 180 +
 1 file changed, 180 insertions(+)

diff --git a/test/org/apache/catalina/manager/TestManagerWebappSsl.java 
b/test/org/apache/catalina/manager/TestManagerWebappSsl.java
new file mode 100644
index 00..19d19c619c
--- /dev/null
+++ b/test/org/apache/catalina/manager/TestManagerWebappSsl.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.manager;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import jakarta.servlet.http.HttpServletResponse;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import static org.apache.catalina.startup.SimpleHttpClient.CRLF;
+import org.apache.catalina.Context;
+import org.apache.catalina.authenticator.TestBasicAuthParser.BasicAuthHeader;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.startup.SimpleHttpClient;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.net.TesterSupport;
+import org.apache.tomcat.websocket.server.WsContextListener;
+
+/**
+ * The keys and certificates used in this file are all available in svn and 
were
+ * generated using a test CA the files for which are in the Tomcat PMC private
+ * repository since not all of them are AL2 licensed.
+ */
+@RunWith(Parameterized.class)
+public class TestManagerWebappSsl extends TomcatBaseTest {
+
+@Parameterized.Parameters(name = "{0}")
+public static Collection parameters() {
+List parameterSets = new ArrayList<>();
+parameterSets.add(new Object[] {
+"JSSE", Boolean.FALSE, 
"org.apache.tomcat.util.net.jsse.JSSEImplementation"});
+parameterSets.add(new Object[] {
+"OpenSSL-FFM", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"});
+parameterSets.add(new Object[] {
+"OpenSSL", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.OpenSSLImplementation"});
+
+return parameterSets;
+}
+
+@Parameter(0)
+public String connectorName;
+
+@Parameter(1)
+public boolean useOpenSSL;
+
+@Parameter(2)
+public String sslImplementationName;
+
+
+@Test
+public void testConnectors() throws Exception {
+TesterSupport.configureClientSsl();
+
+Tomcat tomcat = getTomcatInstance();
+tomcat.addUser("admin", "sekr3t");
+tomcat.addRole("admin", "manager-gui");
+tomcat.addRole("admin", "manager-script");
+tomcat.addRole("admin", "manager-jmx");
+tomcat.addRole("admin", "manager-status");
+
+File webappDir = new File(getBuildDirectory(), "webapps");
+
+// Add manager webapp
+File appDir = new File(webappDir, "manager");
+tomcat.addWebapp(null, "/manager", appDir.getAbsolutePath());
+
+appDir = new File(webappDir, "examples");
+Context ctxt  = tomcat.addWebapp(null, "/examples", 
appDir.getAbsolutePath());
+ctxt.addApplicationListener(WsContextListener.class.getName());
+
+TesterSupport.initSsl(tomcat);
+TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, useOpenSSL);
+
+tomcat.start();
+
+ByteChunk res = getUrl("https://localhost:"; + getPort() +
+"/examples/servlets/servlet/HelloWorldExample");
+Assert.assertTrue(res.toString().indexOf("") > 0);
+
+// Add a regular co

(tomcat) branch 9.0.x updated: Add manager certificate handling testing

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 16982039ec Add manager certificate handling testing
16982039ec is described below

commit 16982039ec8928cdcb2d9227df757f1693e87ac9
Author: remm 
AuthorDate: Wed Sep 25 14:49:18 2024 +0200

Add manager certificate handling testing

No issue found for APR, except no CAs are returned. Skip for now.
---
 .../catalina/manager/TestManagerWebappSsl.java | 181 +
 1 file changed, 181 insertions(+)

diff --git a/test/org/apache/catalina/manager/TestManagerWebappSsl.java 
b/test/org/apache/catalina/manager/TestManagerWebappSsl.java
new file mode 100644
index 00..0eb49ce181
--- /dev/null
+++ b/test/org/apache/catalina/manager/TestManagerWebappSsl.java
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.manager;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import static org.apache.catalina.startup.SimpleHttpClient.CRLF;
+import org.apache.catalina.Context;
+import org.apache.catalina.authenticator.TestBasicAuthParser.BasicAuthHeader;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.startup.SimpleHttpClient;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.net.TesterSupport;
+import org.apache.tomcat.websocket.server.WsContextListener;
+
+/**
+ * The keys and certificates used in this file are all available in svn and 
were
+ * generated using a test CA the files for which are in the Tomcat PMC private
+ * repository since not all of them are AL2 licensed.
+ */
+@RunWith(Parameterized.class)
+public class TestManagerWebappSsl extends TomcatBaseTest {
+
+@Parameterized.Parameters(name = "{0}")
+public static Collection parameters() {
+List parameterSets = new ArrayList<>();
+parameterSets.add(new Object[] {
+"JSSE", Boolean.FALSE, 
"org.apache.tomcat.util.net.jsse.JSSEImplementation"});
+parameterSets.add(new Object[] {
+"OpenSSL-FFM", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"});
+parameterSets.add(new Object[] {
+"OpenSSL", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.OpenSSLImplementation"});
+
+return parameterSets;
+}
+
+@Parameter(0)
+public String connectorName;
+
+@Parameter(1)
+public boolean useOpenSSL;
+
+@Parameter(2)
+public String sslImplementationName;
+
+
+@Test
+public void testConnectors() throws Exception {
+TesterSupport.configureClientSsl();
+
+Tomcat tomcat = getTomcatInstance();
+tomcat.addUser("admin", "sekr3t");
+tomcat.addRole("admin", "manager-gui");
+tomcat.addRole("admin", "manager-script");
+tomcat.addRole("admin", "manager-jmx");
+tomcat.addRole("admin", "manager-status");
+
+File webappDir = new File(getBuildDirectory(), "webapps");
+
+// Add manager webapp
+File appDir = new File(webappDir, "manager");
+tomcat.addWebapp(null, "/manager", appDir.getAbsolutePath());
+
+appDir = new File(webappDir, "examples");
+Context ctxt  = tomcat.addWebapp(null, "/examples", 
appDir.getAbsolutePath());
+ctxt.addApplicationListener(WsContextListener.class.getName());
+
+TesterSupport.initSsl(tomcat);
+TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, useOpenSSL);
+
+tomcat.start();
+
+ByteChunk res = getUrl("https://localhost:"; + getPort() +
+"/examples/servlets/servlet/HelloWorldExample");
+Assert

(tomcat) branch 11.0.x updated: Add manager certificate handling testing

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 762485c581 Add manager certificate handling testing
762485c581 is described below

commit 762485c5813994f2f85661e4a241bfd2fdb1ff36
Author: remm 
AuthorDate: Wed Sep 25 14:47:53 2024 +0200

Add manager certificate handling testing
---
 .../catalina/manager/TestManagerWebappSsl.java | 180 +
 1 file changed, 180 insertions(+)

diff --git a/test/org/apache/catalina/manager/TestManagerWebappSsl.java 
b/test/org/apache/catalina/manager/TestManagerWebappSsl.java
new file mode 100644
index 00..19d19c619c
--- /dev/null
+++ b/test/org/apache/catalina/manager/TestManagerWebappSsl.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.manager;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import jakarta.servlet.http.HttpServletResponse;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import static org.apache.catalina.startup.SimpleHttpClient.CRLF;
+import org.apache.catalina.Context;
+import org.apache.catalina.authenticator.TestBasicAuthParser.BasicAuthHeader;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.startup.SimpleHttpClient;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.net.TesterSupport;
+import org.apache.tomcat.websocket.server.WsContextListener;
+
+/**
+ * The keys and certificates used in this file are all available in svn and 
were
+ * generated using a test CA the files for which are in the Tomcat PMC private
+ * repository since not all of them are AL2 licensed.
+ */
+@RunWith(Parameterized.class)
+public class TestManagerWebappSsl extends TomcatBaseTest {
+
+@Parameterized.Parameters(name = "{0}")
+public static Collection parameters() {
+List parameterSets = new ArrayList<>();
+parameterSets.add(new Object[] {
+"JSSE", Boolean.FALSE, 
"org.apache.tomcat.util.net.jsse.JSSEImplementation"});
+parameterSets.add(new Object[] {
+"OpenSSL-FFM", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"});
+parameterSets.add(new Object[] {
+"OpenSSL", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.OpenSSLImplementation"});
+
+return parameterSets;
+}
+
+@Parameter(0)
+public String connectorName;
+
+@Parameter(1)
+public boolean useOpenSSL;
+
+@Parameter(2)
+public String sslImplementationName;
+
+
+@Test
+public void testConnectors() throws Exception {
+TesterSupport.configureClientSsl();
+
+Tomcat tomcat = getTomcatInstance();
+tomcat.addUser("admin", "sekr3t");
+tomcat.addRole("admin", "manager-gui");
+tomcat.addRole("admin", "manager-script");
+tomcat.addRole("admin", "manager-jmx");
+tomcat.addRole("admin", "manager-status");
+
+File webappDir = new File(getBuildDirectory(), "webapps");
+
+// Add manager webapp
+File appDir = new File(webappDir, "manager");
+tomcat.addWebapp(null, "/manager", appDir.getAbsolutePath());
+
+appDir = new File(webappDir, "examples");
+Context ctxt  = tomcat.addWebapp(null, "/examples", 
appDir.getAbsolutePath());
+ctxt.addApplicationListener(WsContextListener.class.getName());
+
+TesterSupport.initSsl(tomcat);
+TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, useOpenSSL);
+
+tomcat.start();
+
+ByteChunk res = getUrl("https://localhost:"; + getPort() +
+"/examples/servlets/servlet/HelloWorldExample");
+Assert.assertTrue(res.toString().indexOf("") > 0);
+
+// Add a regula

(tomcat) branch 10.1.x updated: Add manager certificate handling testing

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 8ce050ba2a Add manager certificate handling testing
8ce050ba2a is described below

commit 8ce050ba2a4e9e9c96306fe8c7e9b486b9a9f165
Author: remm 
AuthorDate: Wed Sep 25 14:47:53 2024 +0200

Add manager certificate handling testing
---
 .../catalina/manager/TestManagerWebappSsl.java | 180 +
 1 file changed, 180 insertions(+)

diff --git a/test/org/apache/catalina/manager/TestManagerWebappSsl.java 
b/test/org/apache/catalina/manager/TestManagerWebappSsl.java
new file mode 100644
index 00..19d19c619c
--- /dev/null
+++ b/test/org/apache/catalina/manager/TestManagerWebappSsl.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.manager;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import jakarta.servlet.http.HttpServletResponse;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import static org.apache.catalina.startup.SimpleHttpClient.CRLF;
+import org.apache.catalina.Context;
+import org.apache.catalina.authenticator.TestBasicAuthParser.BasicAuthHeader;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.startup.SimpleHttpClient;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.net.TesterSupport;
+import org.apache.tomcat.websocket.server.WsContextListener;
+
+/**
+ * The keys and certificates used in this file are all available in svn and 
were
+ * generated using a test CA the files for which are in the Tomcat PMC private
+ * repository since not all of them are AL2 licensed.
+ */
+@RunWith(Parameterized.class)
+public class TestManagerWebappSsl extends TomcatBaseTest {
+
+@Parameterized.Parameters(name = "{0}")
+public static Collection parameters() {
+List parameterSets = new ArrayList<>();
+parameterSets.add(new Object[] {
+"JSSE", Boolean.FALSE, 
"org.apache.tomcat.util.net.jsse.JSSEImplementation"});
+parameterSets.add(new Object[] {
+"OpenSSL-FFM", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"});
+parameterSets.add(new Object[] {
+"OpenSSL", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.OpenSSLImplementation"});
+
+return parameterSets;
+}
+
+@Parameter(0)
+public String connectorName;
+
+@Parameter(1)
+public boolean useOpenSSL;
+
+@Parameter(2)
+public String sslImplementationName;
+
+
+@Test
+public void testConnectors() throws Exception {
+TesterSupport.configureClientSsl();
+
+Tomcat tomcat = getTomcatInstance();
+tomcat.addUser("admin", "sekr3t");
+tomcat.addRole("admin", "manager-gui");
+tomcat.addRole("admin", "manager-script");
+tomcat.addRole("admin", "manager-jmx");
+tomcat.addRole("admin", "manager-status");
+
+File webappDir = new File(getBuildDirectory(), "webapps");
+
+// Add manager webapp
+File appDir = new File(webappDir, "manager");
+tomcat.addWebapp(null, "/manager", appDir.getAbsolutePath());
+
+appDir = new File(webappDir, "examples");
+Context ctxt  = tomcat.addWebapp(null, "/examples", 
appDir.getAbsolutePath());
+ctxt.addApplicationListener(WsContextListener.class.getName());
+
+TesterSupport.initSsl(tomcat);
+TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, useOpenSSL);
+
+tomcat.start();
+
+ByteChunk res = getUrl("https://localhost:"; + getPort() +
+"/examples/servlets/servlet/HelloWorldExample");
+Assert.assertTrue(res.toString().indexOf("") > 0);
+
+// Add a regula

[Bug 69338] Overhead in El processing (AST*)

2024-09-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69338

--- Comment #3 from Mark Thomas  ---
I've been looking at the handling for multiple && and ||. The performance
numbers are clear it is worth doing. There is no noticeable change for 2
operands and obvious improvements from 3 operands upwards. The more operands,
the clearer the benefit. At 10 operands the new approach is roughly twice as
fast.

I need to do some more testing to make sure the changes to the parser are
correct. I should have something to commit for this tomorrow.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot failure in on tomcat-12.0.x

2024-09-25 Thread buildbot
Build status: BUILD FAILED: failed compile (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/120/builds/78
Blamelist: remm 
Build Text: failed compile (failure)
Status Detected: new failure
Build Source Stamp: [branch main] ce70a1780bfac04034f8361e81d968eedac6410a


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 0

  shell_10: 0

  Rsync docs to nightlies.apache.org: 0

  shell_11: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 2

  shell_12: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



(tomcat) branch 10.1.x updated: Allow getting certificates for OpenSSL

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 7534ba628d Allow getting certificates for OpenSSL
7534ba628d is described below

commit 7534ba628de5c6aa035105136ad508bc3beb488c
Author: remm 
AuthorDate: Wed Sep 25 14:20:38 2024 +0200

Allow getting certificates for OpenSSL

This reverts the fix for 62712 which was only for the APR connector
(OpenSSL seems to work properly for me). I will test again on Tomcat
9.0.
---
 .../apache/catalina/manager/ManagerServlet.java| 63 +-
 1 file changed, 25 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/manager/ManagerServlet.java 
b/java/org/apache/catalina/manager/ManagerServlet.java
index b1fea500c6..50204b6050 100644
--- a/java/org/apache/catalina/manager/ManagerServlet.java
+++ b/java/org/apache/catalina/manager/ManagerServlet.java
@@ -1554,32 +1554,24 @@ public class ManagerServlet extends HttpServlet 
implements ContainerServlet {
 if (Boolean.TRUE.equals(connector.getProperty("SSLEnabled"))) {
 SSLHostConfig[] sslHostConfigs = 
connector.getProtocolHandler().findSslHostConfigs();
 for (SSLHostConfig sslHostConfig : sslHostConfigs) {
-if (sslHostConfig.getOpenSslContext().longValue() == 0) {
-// Not set. Must be JSSE based.
-Set sslHostConfigCerts = 
sslHostConfig.getCertificates();
-for (SSLHostConfigCertificate sslHostConfigCert : 
sslHostConfigCerts) {
-String name = connector.toString() + "-" + 
sslHostConfig.getHostName() + "-" +
-sslHostConfigCert.getType();
-List certList = new ArrayList<>();
-SSLContext sslContext = 
sslHostConfigCert.getSslContext();
-String alias = 
sslHostConfigCert.getCertificateKeyAlias();
-if (alias == null) {
-alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
-}
-X509Certificate[] certs = 
sslContext.getCertificateChain(alias);
-if (certs == null) {
-
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
-} else {
-for (Certificate cert : certs) {
-certList.add(cert.toString());
-}
+Set sslHostConfigCerts = 
sslHostConfig.getCertificates();
+for (SSLHostConfigCertificate sslHostConfigCert : 
sslHostConfigCerts) {
+String name = connector.toString() + "-" + 
sslHostConfig.getHostName() + "-" +
+sslHostConfigCert.getType();
+List certList = new ArrayList<>();
+SSLContext sslContext = 
sslHostConfigCert.getSslContext();
+String alias = 
sslHostConfigCert.getCertificateKeyAlias();
+if (alias == null) {
+alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+}
+X509Certificate[] certs = 
sslContext.getCertificateChain(alias);
+if (certs == null) {
+
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
+} else {
+for (Certificate cert : certs) {
+certList.add(cert.toString());
 }
-result.put(name, certList);
 }
-} else {
-List certList = new ArrayList<>();
-
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
-String name = connector.toString() + "-" + 
sslHostConfig.getHostName();
 result.put(name, certList);
 }
 }
@@ -1604,21 +1596,16 @@ public class ManagerServlet extends HttpServlet 
implements ContainerServlet {
 for (SSLHostConfig sslHostConfig : sslHostConfigs) {
 String name = connector.toString() + "-" + 
sslHostConfig.getHostName();
 List certList = new ArrayList<>();
-if (sslHostConfig.getOpenSslContext().longValue() == 0) {
-// Not set. Must be JSSE based.
-SSLContext sslContext = 
sslHostConfig.getCertificates().iterator().next().getSslContext();
-X509Certificate[] certs = 
sslContext.getAccept

(tomcat) branch 11.0.x updated: Allow getting certificates for OpenSSL

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 0dafa8dcfc Allow getting certificates for OpenSSL
0dafa8dcfc is described below

commit 0dafa8dcfc33e70464b8528f98bd5e491e1c1c9a
Author: remm 
AuthorDate: Wed Sep 25 14:20:38 2024 +0200

Allow getting certificates for OpenSSL

This reverts the fix for 62712 which was only for the APR connector
(OpenSSL seems to work properly for me). I will test again on Tomcat
9.0.
---
 .../apache/catalina/manager/ManagerServlet.java| 63 +-
 1 file changed, 25 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/manager/ManagerServlet.java 
b/java/org/apache/catalina/manager/ManagerServlet.java
index b1fea500c6..50204b6050 100644
--- a/java/org/apache/catalina/manager/ManagerServlet.java
+++ b/java/org/apache/catalina/manager/ManagerServlet.java
@@ -1554,32 +1554,24 @@ public class ManagerServlet extends HttpServlet 
implements ContainerServlet {
 if (Boolean.TRUE.equals(connector.getProperty("SSLEnabled"))) {
 SSLHostConfig[] sslHostConfigs = 
connector.getProtocolHandler().findSslHostConfigs();
 for (SSLHostConfig sslHostConfig : sslHostConfigs) {
-if (sslHostConfig.getOpenSslContext().longValue() == 0) {
-// Not set. Must be JSSE based.
-Set sslHostConfigCerts = 
sslHostConfig.getCertificates();
-for (SSLHostConfigCertificate sslHostConfigCert : 
sslHostConfigCerts) {
-String name = connector.toString() + "-" + 
sslHostConfig.getHostName() + "-" +
-sslHostConfigCert.getType();
-List certList = new ArrayList<>();
-SSLContext sslContext = 
sslHostConfigCert.getSslContext();
-String alias = 
sslHostConfigCert.getCertificateKeyAlias();
-if (alias == null) {
-alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
-}
-X509Certificate[] certs = 
sslContext.getCertificateChain(alias);
-if (certs == null) {
-
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
-} else {
-for (Certificate cert : certs) {
-certList.add(cert.toString());
-}
+Set sslHostConfigCerts = 
sslHostConfig.getCertificates();
+for (SSLHostConfigCertificate sslHostConfigCert : 
sslHostConfigCerts) {
+String name = connector.toString() + "-" + 
sslHostConfig.getHostName() + "-" +
+sslHostConfigCert.getType();
+List certList = new ArrayList<>();
+SSLContext sslContext = 
sslHostConfigCert.getSslContext();
+String alias = 
sslHostConfigCert.getCertificateKeyAlias();
+if (alias == null) {
+alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+}
+X509Certificate[] certs = 
sslContext.getCertificateChain(alias);
+if (certs == null) {
+
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
+} else {
+for (Certificate cert : certs) {
+certList.add(cert.toString());
 }
-result.put(name, certList);
 }
-} else {
-List certList = new ArrayList<>();
-
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
-String name = connector.toString() + "-" + 
sslHostConfig.getHostName();
 result.put(name, certList);
 }
 }
@@ -1604,21 +1596,16 @@ public class ManagerServlet extends HttpServlet 
implements ContainerServlet {
 for (SSLHostConfig sslHostConfig : sslHostConfigs) {
 String name = connector.toString() + "-" + 
sslHostConfig.getHostName();
 List certList = new ArrayList<>();
-if (sslHostConfig.getOpenSslContext().longValue() == 0) {
-// Not set. Must be JSSE based.
-SSLContext sslContext = 
sslHostConfig.getCertificates().iterator().next().getSslContext();
-X509Certificate[] certs = 
sslContext.getAccept

(tomcat) branch main updated: Allow getting certificates for OpenSSL

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new fb8c682663 Allow getting certificates for OpenSSL
fb8c682663 is described below

commit fb8c68266377a6fc713e2b19da3a465e738b321a
Author: remm 
AuthorDate: Wed Sep 25 14:20:38 2024 +0200

Allow getting certificates for OpenSSL

This reverts the fix for 62712 which was only for the APR connector
(OpenSSL seems to work properly for me). I will test again on Tomcat
9.0.
---
 .../apache/catalina/manager/ManagerServlet.java| 63 +-
 1 file changed, 25 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/manager/ManagerServlet.java 
b/java/org/apache/catalina/manager/ManagerServlet.java
index b1fea500c6..50204b6050 100644
--- a/java/org/apache/catalina/manager/ManagerServlet.java
+++ b/java/org/apache/catalina/manager/ManagerServlet.java
@@ -1554,32 +1554,24 @@ public class ManagerServlet extends HttpServlet 
implements ContainerServlet {
 if (Boolean.TRUE.equals(connector.getProperty("SSLEnabled"))) {
 SSLHostConfig[] sslHostConfigs = 
connector.getProtocolHandler().findSslHostConfigs();
 for (SSLHostConfig sslHostConfig : sslHostConfigs) {
-if (sslHostConfig.getOpenSslContext().longValue() == 0) {
-// Not set. Must be JSSE based.
-Set sslHostConfigCerts = 
sslHostConfig.getCertificates();
-for (SSLHostConfigCertificate sslHostConfigCert : 
sslHostConfigCerts) {
-String name = connector.toString() + "-" + 
sslHostConfig.getHostName() + "-" +
-sslHostConfigCert.getType();
-List certList = new ArrayList<>();
-SSLContext sslContext = 
sslHostConfigCert.getSslContext();
-String alias = 
sslHostConfigCert.getCertificateKeyAlias();
-if (alias == null) {
-alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
-}
-X509Certificate[] certs = 
sslContext.getCertificateChain(alias);
-if (certs == null) {
-
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
-} else {
-for (Certificate cert : certs) {
-certList.add(cert.toString());
-}
+Set sslHostConfigCerts = 
sslHostConfig.getCertificates();
+for (SSLHostConfigCertificate sslHostConfigCert : 
sslHostConfigCerts) {
+String name = connector.toString() + "-" + 
sslHostConfig.getHostName() + "-" +
+sslHostConfigCert.getType();
+List certList = new ArrayList<>();
+SSLContext sslContext = 
sslHostConfigCert.getSslContext();
+String alias = 
sslHostConfigCert.getCertificateKeyAlias();
+if (alias == null) {
+alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+}
+X509Certificate[] certs = 
sslContext.getCertificateChain(alias);
+if (certs == null) {
+
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
+} else {
+for (Certificate cert : certs) {
+certList.add(cert.toString());
 }
-result.put(name, certList);
 }
-} else {
-List certList = new ArrayList<>();
-
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
-String name = connector.toString() + "-" + 
sslHostConfig.getHostName();
 result.put(name, certList);
 }
 }
@@ -1604,21 +1596,16 @@ public class ManagerServlet extends HttpServlet 
implements ContainerServlet {
 for (SSLHostConfig sslHostConfig : sslHostConfigs) {
 String name = connector.toString() + "-" + 
sslHostConfig.getHostName();
 List certList = new ArrayList<>();
-if (sslHostConfig.getOpenSslContext().longValue() == 0) {
-// Not set. Must be JSSE based.
-SSLContext sslContext = 
sslHostConfig.getCertificates().iterator().next().getSslContext();
-X509Certificate[] certs = 
sslContext.getAcceptedIs

(tomcat) branch 9.0.x updated: Allow getting certificates for OpenSSL

2024-09-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 6a091d15d0 Allow getting certificates for OpenSSL
6a091d15d0 is described below

commit 6a091d15d080427638bb58ec3a1b5618e730f398
Author: remm 
AuthorDate: Wed Sep 25 14:20:38 2024 +0200

Allow getting certificates for OpenSSL

This reverts the fix for 62712 which was only for the APR connector
(OpenSSL seems to work properly for me). I will test again on Tomcat
9.0.
---
 .../apache/catalina/manager/ManagerServlet.java| 63 +-
 1 file changed, 25 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/manager/ManagerServlet.java 
b/java/org/apache/catalina/manager/ManagerServlet.java
index dab198ea2c..1cdc5173e5 100644
--- a/java/org/apache/catalina/manager/ManagerServlet.java
+++ b/java/org/apache/catalina/manager/ManagerServlet.java
@@ -1611,32 +1611,24 @@ public class ManagerServlet extends HttpServlet 
implements ContainerServlet {
 if (Boolean.TRUE.equals(connector.getProperty("SSLEnabled"))) {
 SSLHostConfig[] sslHostConfigs = 
connector.getProtocolHandler().findSslHostConfigs();
 for (SSLHostConfig sslHostConfig : sslHostConfigs) {
-if (sslHostConfig.getOpenSslContext().longValue() == 0) {
-// Not set. Must be JSSE based.
-Set sslHostConfigCerts = 
sslHostConfig.getCertificates();
-for (SSLHostConfigCertificate sslHostConfigCert : 
sslHostConfigCerts) {
-String name = connector.toString() + "-" + 
sslHostConfig.getHostName() + "-" +
-sslHostConfigCert.getType();
-List certList = new ArrayList<>();
-SSLContext sslContext = 
sslHostConfigCert.getSslContext();
-String alias = 
sslHostConfigCert.getCertificateKeyAlias();
-if (alias == null) {
-alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
-}
-X509Certificate[] certs = 
sslContext.getCertificateChain(alias);
-if (certs == null) {
-
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
-} else {
-for (Certificate cert : certs) {
-certList.add(cert.toString());
-}
+Set sslHostConfigCerts = 
sslHostConfig.getCertificates();
+for (SSLHostConfigCertificate sslHostConfigCert : 
sslHostConfigCerts) {
+String name = connector.toString() + "-" + 
sslHostConfig.getHostName() + "-" +
+sslHostConfigCert.getType();
+List certList = new ArrayList<>();
+SSLContext sslContext = 
sslHostConfigCert.getSslContext();
+String alias = 
sslHostConfigCert.getCertificateKeyAlias();
+if (alias == null) {
+alias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+}
+X509Certificate[] certs = 
sslContext.getCertificateChain(alias);
+if (certs == null) {
+
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
+} else {
+for (Certificate cert : certs) {
+certList.add(cert.toString());
 }
-result.put(name, certList);
 }
-} else {
-List certList = new ArrayList<>();
-
certList.add(smClient.getString("managerServlet.certsNotAvailable"));
-String name = connector.toString() + "-" + 
sslHostConfig.getHostName();
 result.put(name, certList);
 }
 }
@@ -1661,21 +1653,16 @@ public class ManagerServlet extends HttpServlet 
implements ContainerServlet {
 for (SSLHostConfig sslHostConfig : sslHostConfigs) {
 String name = connector.toString() + "-" + 
sslHostConfig.getHostName();
 List certList = new ArrayList<>();
-if (sslHostConfig.getOpenSslContext().longValue() == 0) {
-// Not set. Must be JSSE based.
-SSLContext sslContext = 
sslHostConfig.getCertificates().iterator().next().getSslContext();
-X509Certificate[] certs = 
sslContext.getAccepted

(tomcat) branch 10.1.x updated: Expand unit tests ready for BZ 69338 fix

2024-09-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 145c6d1af1 Expand unit tests ready for BZ 69338 fix
145c6d1af1 is described below

commit 145c6d1af1e93917ce3b48ec95ff10da98303a3a
Author: Mark Thomas 
AuthorDate: Wed Sep 25 19:23:21 2024 +0100

Expand unit tests ready for BZ 69338 fix
---
 test/org/apache/el/parser/TestAstAnd.java | 43 +++
 test/org/apache/el/parser/TestAstOr.java  | 42 ++
 2 files changed, 85 insertions(+)

diff --git a/test/org/apache/el/parser/TestAstAnd.java 
b/test/org/apache/el/parser/TestAstAnd.java
index 8303eaf92e..54078cc89d 100644
--- a/test/org/apache/el/parser/TestAstAnd.java
+++ b/test/org/apache/el/parser/TestAstAnd.java
@@ -50,4 +50,47 @@ public class TestAstAnd {
 Boolean result = processor.eval("null && null");
 Assert.assertEquals(Boolean.FALSE, result);
 }
+
+@Test
+public void test05() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && true && 
true");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test06() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && true && 
false");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test07() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false && true && true && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test08() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && false && true && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test09() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && false && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test10() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && false &&  
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
 }
diff --git a/test/org/apache/el/parser/TestAstOr.java 
b/test/org/apache/el/parser/TestAstOr.java
index bb7a2bdd9a..d6f63d8779 100644
--- a/test/org/apache/el/parser/TestAstOr.java
+++ b/test/org/apache/el/parser/TestAstOr.java
@@ -50,4 +50,46 @@ public class TestAstOr {
 Boolean result = processor.eval("null || null");
 Assert.assertEquals(Boolean.FALSE, result);
 }
+
+@Test
+public void test05() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || false || 
false");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test06() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || false || 
true");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test07() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true || false || false || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test08() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || true || false || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test09() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || true || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test10() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || true ||  
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
 }


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



(tomcat) branch 11.0.x updated: Expand unit tests ready for BZ 69338 fix

2024-09-25 Thread markt
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 1e77d5c0df Expand unit tests ready for BZ 69338 fix
1e77d5c0df is described below

commit 1e77d5c0df5ef91d966a1829c7a57f1ea639da8b
Author: Mark Thomas 
AuthorDate: Wed Sep 25 19:23:21 2024 +0100

Expand unit tests ready for BZ 69338 fix
---
 test/org/apache/el/parser/TestAstAnd.java | 43 +++
 test/org/apache/el/parser/TestAstOr.java  | 42 ++
 2 files changed, 85 insertions(+)

diff --git a/test/org/apache/el/parser/TestAstAnd.java 
b/test/org/apache/el/parser/TestAstAnd.java
index 8303eaf92e..54078cc89d 100644
--- a/test/org/apache/el/parser/TestAstAnd.java
+++ b/test/org/apache/el/parser/TestAstAnd.java
@@ -50,4 +50,47 @@ public class TestAstAnd {
 Boolean result = processor.eval("null && null");
 Assert.assertEquals(Boolean.FALSE, result);
 }
+
+@Test
+public void test05() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && true && 
true");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test06() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && true && 
false");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test07() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false && true && true && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test08() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && false && true && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test09() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && false && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test10() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && false &&  
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
 }
diff --git a/test/org/apache/el/parser/TestAstOr.java 
b/test/org/apache/el/parser/TestAstOr.java
index bb7a2bdd9a..d6f63d8779 100644
--- a/test/org/apache/el/parser/TestAstOr.java
+++ b/test/org/apache/el/parser/TestAstOr.java
@@ -50,4 +50,46 @@ public class TestAstOr {
 Boolean result = processor.eval("null || null");
 Assert.assertEquals(Boolean.FALSE, result);
 }
+
+@Test
+public void test05() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || false || 
false");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test06() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || false || 
true");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test07() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true || false || false || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test08() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || true || false || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test09() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || true || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test10() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || true ||  
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
 }


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



(tomcat) branch main updated: Expand unit tests ready for BZ 69338 fix

2024-09-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 047c671c56 Expand unit tests ready for BZ 69338 fix
047c671c56 is described below

commit 047c671c566426e928a1d420e765f44796de7f2f
Author: Mark Thomas 
AuthorDate: Wed Sep 25 19:23:21 2024 +0100

Expand unit tests ready for BZ 69338 fix
---
 test/org/apache/el/parser/TestAstAnd.java | 43 +++
 test/org/apache/el/parser/TestAstOr.java  | 42 ++
 2 files changed, 85 insertions(+)

diff --git a/test/org/apache/el/parser/TestAstAnd.java 
b/test/org/apache/el/parser/TestAstAnd.java
index 8303eaf92e..54078cc89d 100644
--- a/test/org/apache/el/parser/TestAstAnd.java
+++ b/test/org/apache/el/parser/TestAstAnd.java
@@ -50,4 +50,47 @@ public class TestAstAnd {
 Boolean result = processor.eval("null && null");
 Assert.assertEquals(Boolean.FALSE, result);
 }
+
+@Test
+public void test05() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && true && 
true");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test06() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && true && 
false");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test07() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false && true && true && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test08() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && false && true && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test09() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && false && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test10() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && false &&  
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
 }
diff --git a/test/org/apache/el/parser/TestAstOr.java 
b/test/org/apache/el/parser/TestAstOr.java
index bb7a2bdd9a..d6f63d8779 100644
--- a/test/org/apache/el/parser/TestAstOr.java
+++ b/test/org/apache/el/parser/TestAstOr.java
@@ -50,4 +50,46 @@ public class TestAstOr {
 Boolean result = processor.eval("null || null");
 Assert.assertEquals(Boolean.FALSE, result);
 }
+
+@Test
+public void test05() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || false || 
false");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test06() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || false || 
true");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test07() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true || false || false || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test08() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || true || false || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test09() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || true || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test10() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || true ||  
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
 }


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



(tomcat) branch 9.0.x updated: Expand unit tests ready for BZ 69338 fix

2024-09-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 8aa82e075a Expand unit tests ready for BZ 69338 fix
8aa82e075a is described below

commit 8aa82e075ae7d6f8c38d9dbca9c541a2f080edba
Author: Mark Thomas 
AuthorDate: Wed Sep 25 19:23:21 2024 +0100

Expand unit tests ready for BZ 69338 fix
---
 test/org/apache/el/parser/TestAstAnd.java | 43 +++
 test/org/apache/el/parser/TestAstOr.java  | 42 ++
 2 files changed, 85 insertions(+)

diff --git a/test/org/apache/el/parser/TestAstAnd.java 
b/test/org/apache/el/parser/TestAstAnd.java
index 0969d5d37c..905fe22415 100644
--- a/test/org/apache/el/parser/TestAstAnd.java
+++ b/test/org/apache/el/parser/TestAstAnd.java
@@ -50,4 +50,47 @@ public class TestAstAnd {
 Object result = processor.eval("null && null");
 Assert.assertEquals(Boolean.FALSE, result);
 }
+
+@Test
+public void test05() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && true && 
true");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test06() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && true && 
false");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test07() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false && true && true && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test08() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && false && true && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test09() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && false && true && 
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test10() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true && true && true && false &&  
true");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
 }
diff --git a/test/org/apache/el/parser/TestAstOr.java 
b/test/org/apache/el/parser/TestAstOr.java
index b055ce16b3..5a61fec4aa 100644
--- a/test/org/apache/el/parser/TestAstOr.java
+++ b/test/org/apache/el/parser/TestAstOr.java
@@ -50,4 +50,46 @@ public class TestAstOr {
 Object result = processor.eval("null || null");
 Assert.assertEquals(Boolean.FALSE, result);
 }
+
+@Test
+public void test05() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || false || 
false");
+Assert.assertEquals(Boolean.FALSE, result);
+}
+
+@Test
+public void test06() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || false || 
true");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test07() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("true || false || false || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test08() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || true || false || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test09() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || true || false || 
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
+
+@Test
+public void test10() {
+ELProcessor processor = new ELProcessor();
+Boolean result = processor.eval("false || false || false || true ||  
false");
+Assert.assertEquals(Boolean.TRUE, result);
+}
 }


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



(tomcat) branch main updated: Partial fix for BZ 69338. Better performance for >2 operand And/Or

2024-09-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


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

commit 9ab668b2e9b21d5259acca3221a4554a6d41f158
Author: Mark Thomas 
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| 743 +++--
 java/org/apache/el/parser/ELParser.jjt |   4 +-
 .../apache/el/parser/TestELParserPerformance.java  |  51 ++
 5 files changed, 466 insertions(+), 366 deletions(-)

diff --git a/java/org/apache/el/parser/AstAnd.java 
b/java/org/apache/el/parser/AstAnd.java
index 8a87fe..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 6cf7168afe..6ba979629e 100644
--- a/java/org/apache/el/parser/ELParser.java
+++ b/java/org/apache/el/parser/ELParser.java
@@ -594,7 +594,7 @@ public class ELParser/* @bgen(jjtree) */ implements 
ELParserTreeConstants, ELPar
 jj_la1[10] = jj_gen;
 break label_6;
 }
-if (jj_2_5(2)) {
+if (jj_2_5(3)) {
 jj_consume_token(QUESTIONMARK);
 jj_consume_token(COLON);
 AstElvis jjtn001 = new AstElvis(JJTELVIS);
@@ -691,67 +691,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[12] = 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[13] = 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)

(tomcat) branch 11.0.x updated: Partial fix for BZ 69338. Better performance for >2 operand And/Or

2024-09-25 Thread markt
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 
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 8a87fe..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 (RuntimeE

(tomcat) branch main updated: Code clean-up - no functional change

2024-09-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new d034e9ebfd Code clean-up - no functional change
d034e9ebfd is described below

commit d034e9ebfd2ff3fdad71448e11588f31c19252a6
Author: Mark Thomas 
AuthorDate: Wed Sep 25 20:25:07 2024 +0100

Code clean-up - no functional change
---
 java/org/apache/el/parser/ELParserTokenManager.java | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/java/org/apache/el/parser/ELParserTokenManager.java 
b/java/org/apache/el/parser/ELParserTokenManager.java
index a70d4b3e9a..cc51f5a573 100644
--- a/java/org/apache/el/parser/ELParserTokenManager.java
+++ b/java/org/apache/el/parser/ELParserTokenManager.java
@@ -2,9 +2,6 @@
 /* Generated By:JJTree&JavaCC: Do not edit this line. 
ELParserTokenManager.java */
 package org.apache.el.parser;
 
-import java.io.StringReader;
-import jakarta.el.ELException;
-
 /** Token Manager. */
 @SuppressWarnings("all") // Ignore warnings in generated code
 public class ELParserTokenManager implements ELParserConstants {


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



(tomcat) branch 10.1.x updated: Code clean-up - no functional change

2024-09-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 51be28b1c8 Code clean-up - no functional change
51be28b1c8 is described below

commit 51be28b1c8a9732205579091a6ce0623910c1a7b
Author: Mark Thomas 
AuthorDate: Wed Sep 25 20:25:51 2024 +0100

Code clean-up - no functional change
---
 java/org/apache/el/parser/AstLambdaExpression.java |   4 +-
 java/org/apache/el/parser/JJTELParserState.java|  45 
 java/org/apache/el/parser/Node.java|  26 +++--
 java/org/apache/el/parser/ParseException.java  | 123 +
 java/org/apache/el/parser/SimpleCharStream.java|  38 ---
 java/org/apache/el/parser/SimpleNode.java  |   7 +-
 java/org/apache/el/parser/Token.java   |  65 +--
 java/org/apache/el/parser/TokenMgrError.java   | 107 --
 8 files changed, 193 insertions(+), 222 deletions(-)

diff --git a/java/org/apache/el/parser/AstLambdaExpression.java 
b/java/org/apache/el/parser/AstLambdaExpression.java
index 152dab9d29..079ce6a2d6 100644
--- a/java/org/apache/el/parser/AstLambdaExpression.java
+++ b/java/org/apache/el/parser/AstLambdaExpression.java
@@ -100,8 +100,8 @@ public class AstLambdaExpression extends SimpleNode {
 methodParameterIndex++;
 
 while (result instanceof LambdaExpression && methodParameterIndex < 
jjtGetNumChildren()) {
-result = ((LambdaExpression) result).invoke(
-((AstMethodParameters) 
children[methodParameterIndex]).getParameters(ctx));
+result = ((LambdaExpression) result)
+.invoke(((AstMethodParameters) 
children[methodParameterIndex]).getParameters(ctx));
 methodParameterIndex++;
 }
 
diff --git a/java/org/apache/el/parser/JJTELParserState.java 
b/java/org/apache/el/parser/JJTELParserState.java
index 4315ef769b..7dc18ded58 100644
--- a/java/org/apache/el/parser/JJTELParserState.java
+++ b/java/org/apache/el/parser/JJTELParserState.java
@@ -23,16 +23,18 @@ public class JJTELParserState {
 }
 
 
-/* Determines whether the current node was actually closed and
- pushed.  This should only be called in the final user action of a
- node scope.  */
+/*
+ * Determines whether the current node was actually closed and pushed. 
This should only be called in the final user
+ * action of a node scope.
+ */
 public boolean nodeCreated() {
 return node_created;
 }
 
 
-/* Call this to reinitialize the node stack.  It is called
- automatically by the parser's ReInit() method. */
+/*
+ * Call this to reinitialize the node stack. It is called automatically by 
the parser's ReInit() method.
+ */
 public void reset() {
 nodes.clear();
 marks.clear();
@@ -41,8 +43,9 @@ public class JJTELParserState {
 }
 
 
-/* Returns the root node of the AST.  It only makes sense to call
- this after a successful parse. */
+/*
+ * Returns the root node of the AST. It only makes sense to call this 
after a successful parse.
+ */
 public Node rootNode() {
 return nodes.get(0);
 }
@@ -55,8 +58,9 @@ public class JJTELParserState {
 }
 
 
-/* Returns the node on the top of the stack, and remove it from the
- stack.  */
+/*
+ * Returns the node on the top of the stack, and remove it from the stack.
+ */
 public Node popNode() {
 if (--sp < mk) {
 mk = marks.remove(marks.size() - 1);
@@ -71,8 +75,9 @@ public class JJTELParserState {
 }
 
 
-/* Returns the number of children on the stack in the current node
- scope. */
+/*
+ * Returns the number of children on the stack in the current node scope.
+ */
 public int nodeArity() {
 return sp - mk;
 }
@@ -93,10 +98,10 @@ public class JJTELParserState {
 }
 
 
-/* A definite node is constructed from a specified number of
- children.  That number of nodes are popped from the stack and
- made the children of the definite node.  Then the definite node
- is pushed on to the stack. */
+/*
+ * A definite node is constructed from a specified number of children. 
That number of nodes are popped from the
+ * stack and made the children of the definite node. Then the definite 
node is pushed on to the stack.
+ */
 public void closeNodeScope(Node n, int num) {
 mk = marks.remove(marks.size() - 1);
 while (num-- > 0) {
@@ -110,11 +115,11 @@ public class JJTELParserState {
 }
 
 
-/* A conditional node is constructed if its condition is true.  All
- the nodes that have been pushed since the node was opened are
- made children of the conditional node, which is then pushed
- on to the stack.  If the condition is false the no