[Bug 69245] Tomcat.addWebapp() doesn't expire sessions after Tomcat.start()

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

--- Comment #14 from Mark Thomas  ---
ASF Infra test comment - please ignore

-- 
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



svn commit: r70769 - in /dev/tomcat/tomcat-connectors/jk/binaries/windows: ./ symbols/

2024-08-09 Thread markt
Author: markt
Date: Fri Aug  9 11:03:00 2024
New Revision: 70769

Log:
Update zips to add LICENSE and NOTICE files

Modified:

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip.asc

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip.sha512

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-x86_64-symbols.zip

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-x86_64-symbols.zip.asc

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-x86_64-symbols.zip.sha512

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.50-windows-i386-iis.zip

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.50-windows-i386-iis.zip.asc

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.50-windows-i386-iis.zip.sha512

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.50-windows-x86_64-iis.zip

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.50-windows-x86_64-iis.zip.asc

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.50-windows-x86_64-iis.zip.sha512

Modified: 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip
==
Binary files - no diff available.

Modified: 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip.asc
==
--- 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip.asc
 (original)
+++ 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip.asc
 Fri Aug  9 11:03:00 2024
@@ -1,16 +1,16 @@
 -BEGIN PGP SIGNATURE-
 
-iQIzBAABCgAdFiEEqcXfTSLpmZjZh1pREMAcWi9gWecFAma0z3QACgkQEMAcWi9g
-WedkABAAgNtSIWXvflroTbWpYhQDDP3I2l7aYdJfOjbjw7YULRNwOo0+vGgIaRF8
-0pyNf7hWmkianhb7/YAlnSUSmaiZUDQAtIY9tuRH1CxZEhhnl199vL+DIlb6QgFI
-btIOdXb7hjrxv/1acPoJdxAD0HIWtBHsIf4sHe8iLDvBrS9pucaLp8jRoqDah4Cb
-qJb0iCxy9xLlIEhIvVbpmvPkBGRq+Bz9EnhWK5J3kZL/1lZo6oaonCSJ/0tQ/4eJ
-ZwKNB/rAZW+y+JJU7PYrlXgVkAAXiHS6heaN64hhQdTVwr0M5JyS4eY76lEsNq8+
-bC6dLBWvIqubxoch/hoMpKFTfNCc2DAFk5ls5T0DG0jpYbFuWfglZt8cq9bLl029
-Oqa94C5OECXdy9lH5hj+n2obyI8JluuUSD2tZ2fqcK5/9GiPQLP6Sh812TAtpmZH
-495hr5Po59yXsqHlAqW2kX0b8axj8zheBGTzdlCnTIwia1MLfAPyn5Cj+bp/QMMi
-x3zXZh1knDiK/kM/j2AgAL6vjSOsIGhrQUcW0SRBfQWj6UcCyILlMKqvxzCIVu9I
-9eN5+E89yfkkTErRAlCQqgxpkE7+Da4n7CLsEORPgm/iHt7BdSxZjxHx6x9M5YUn
-8uyOxppi1ijGdiJS8Tqx4YAVxVcdblROkMZQYoTnrAzAxrnqVao=
-=IhJ3
+iQIzBAABCgAdFiEEqcXfTSLpmZjZh1pREMAcWi9gWecFAma19yoACgkQEMAcWi9g
+Wee3YxAAvThJYiP/VrTjxWVls64rFhnWWAiUEzmICVJOPMCyV7gQ0QFR5v6HoMeR
+uguMESri25hjPcGzpsqhZJJbExb/aOscNgTUX7Pyc2OrQcu5Oe1PmFkpRGeJoA+p
+bJbMkozmD7FjS7iC66joiVr10OCBc3PKnXrvVxhyMsOBe2Xb0f74i41scpvqI4J5
+EeQxkm6LXippEtBWZSQqPTg3znxnWK+Pr9uhyeBRrrqG8SpbChvvcWqGLzWJRR9u
+Uq55O/0zaBivJTIHWrjyiuCID/9IV5+wAF6lWgcJ+bwA4NdNFeZ2wb0FFVWYsfuz
+1qLDhFU5qeKf6kDvCRTvNyDu5cTNrilzZzrMgAo8OMjC18VJgFmzLRpPNIBf9lsr
+5j9raOOBouVoSOl9JnDS5MYsa0IObwZ7W37T+y5IrhphleJ2F8vPBwbzANURcDo/
+Jefywhe8EV3fJrmYHP2CALlzEbzgmYieley61f8/8zgHkSc9MXwFGjTkFoYR6Btk
+Q3dCsZP6/Z2gFk9fjXgzFwz7qJI3F7KyWl4STnGHbEfaJ975txAIvyaGb9Yf1nAX
+Upi9RymudGhYA9T7FdSqp4hAEEoRfONJdY7vvKflLGH6u3MYYkJ6vIGkYtPurmw0
+b06XFTJiGzbLfbQKZgZyddQI05bpSvWYoYcRzGP/JRxmPhTkIcY=
+=DzzX
 -END PGP SIGNATURE-

Modified: 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip.sha512
==
--- 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip.sha512
 (original)
+++ 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-i386-symbols.zip.sha512
 Fri Aug  9 11:03:00 2024
@@ -1 +1 @@
-5f9a0e23098a7e28bef5bea5fd047d6d5324bb63d7a59180f39116a8ae434f4fe73bfe839bdf3f3f4432bfa71fdd5260d478ee9e7a83fc9e8c75d0687244fdc1
 *tomcat-connectors-1.2.50-windows-i386-symbols.zip
\ No newline at end of file
+ba3a129e40d8c1f2a03c059085ba14dba99efc50c237a67d24dbaac923467c6df781ac212ce1f5c44e6ba0430ec26d6894ee3915fcb8a3a252901496ebafff27
 *tomcat-connectors-1.2.50-windows-i386-symbols.zip
\ No newline at end of file

Modified: 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.50-windows-x86_64-symbols.zip
==
Binary files - no diff available.

Modified: 
dev/tomcat/tomcat-connectors

Re: [VOTE] Release Apache Tomcat Connectors (JK) 1.2.50

2024-08-09 Thread Mark Thomas

On 09/08/2024 02:08, Rainer Jung wrote:

Am 08.08.24 um 16:13 schrieb Mark Thomas:

Tag:
https://github.com/apache/tomcat-connectors/tree/JK_1_2_50

Source:
https://github.com/apache/tomcat-connectors/tree/JK_1_2_50

Dist:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-connectors/jk/


This is a maintenance release with a handful of dependency updates and 
bug fixes (compared to 1.2.49). It also includes Windows binaries for 
IIS.


The significant changes are:
- Improve shared memory handling on non-Windows

The proposed JK 1.2.50 release is:
[ ] Broken - do not release
[ ] Stable - go ahead and release as 1.2.50


I still need to do some more checks but currently looks good except for 
the binary zip files: for 1.2.49 they contained LICENSE and NOTICE, for 
1.2.50 these are missing from the binaries zip files. Maybe there is an 
easy way to add them and redo the sha512 and gpg signature.


I figured out what I did wrong. I built the binaries from the source 
bundle rather than a checkout. The paths are slightly different and the 
scripts are configured for the checkout.


I've updated the zips and regenerated the hashes and signatures. The 
actual binaries remain unchanged.


Mark

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



[Bug 69255] New: SQL Connection throws java.lang.reflect.UndeclaredThrowableException instead of SQLException

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

Bug ID: 69255
   Summary: SQL Connection throws
java.lang.reflect.UndeclaredThrowableException instead
of SQLException
   Product: Tomcat Modules
   Version: unspecified
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P5
 Component: jdbc-pool
  Assignee: dev@tomcat.apache.org
  Reporter: mcla...@apache.org
  Target Milestone: ---

Following the change for https://bz.apache.org/bugzilla/show_bug.cgi?id=69206,
an execution of a statement that causes an SQLException to be thrown (e.g.
attempting to run a query with a syntax error) is resulting in an
java.lang.reflect.UndeclaredThrowableException being thrown rather than the
expected java.sql.SQLException.

--- Comment #1 from Michael Clarke  ---
Proposed fix: https://github.com/apache/tomcat/pull/744

-- 
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



Re: [PR] Unwrap InvocationTargetException from underlying statement execution [tomcat]

2024-08-09 Thread via GitHub


markt-asf merged PR #744:
URL: https://github.com/apache/tomcat/pull/744


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



(tomcat) branch main updated: Unwrap InvocationTargetException from underlying statement execution

2024-08-09 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 2953661adc Unwrap InvocationTargetException from underlying statement 
execution
2953661adc is described below

commit 2953661adcc871fe319b9ffbaf65655b8ff50ae4
Author: Michael Clarke 
AuthorDate: Thu Aug 8 20:26:58 2024 +0100

Unwrap InvocationTargetException from underlying statement execution

When executing a wrapped statement, any resulting SQLException is
wrapped in an InvocationTargetException by the reflective invocation,
which is rethrown by the InvocationHandler as an
UndeclaredThrowableException. To ensure the expected SQLException is
thrown, the invocation of the wrapped object is being moved into the
existing try-catch block, thereby ensuring the InvocationTargetException
is unwrapped and the underlying exception thrown by the handler.
---
 .../apache/tomcat/jdbc/pool/StatementFacade.java   | 22 
 .../tomcat/jdbc/test/ProxiedStatementTest.java | 30 ++
 .../apache/tomcat/jdbc/test/driver/Connection.java |  2 +-
 .../apache/tomcat/jdbc/test/driver/Statement.java  | 22 +++-
 4 files changed, 63 insertions(+), 13 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
index e9cae3a734..600ff80d82 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
@@ -117,21 +117,21 @@ public class StatementFacade extends 
AbstractCreateStatementInterceptor {
 throw new SQLException("Statement closed.");
 }
 
-if (compare(GET_RESULTSET, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
+Object result;
+try {
+if (compare(GET_RESULTSET, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
 .newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
-if (compare(GET_GENERATED_KEYS, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
+}
+if (compare(GET_GENERATED_KEYS, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
 .newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
-if (compare(EXECUTE_QUERY, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
+}
+if (compare(EXECUTE_QUERY, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
 .newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
+}
 
-Object result = null;
-try {
 // invoke next
 result = method.invoke(delegate, args);
 } catch (Throwable t) {
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
index 2c76115c06..0f07663b0e 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
@@ -58,4 +58,34 @@ public class ProxiedStatementTest extends DefaultTestCase {
 Assert.assertNotEquals(statement, new 
org.apache.tomcat.jdbc.test.driver.Statement());
 }
 }
+
+@Test
+public void shouldUnwrapInvocationTargetExceptionFromGetResultSet() throws 
SQLException {
+this.datasource.setDriverClassName(Driver.class.getName());
+this.datasource.setUrl("jdbc:tomcat:test");
+try (Connection con = this.datasource.getConnection();
+ Statement statement = con.prepareStatement("sql", 
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, 
ResultSet.HOLD_CURSORS_OVER_COMMIT)) {
+Assert.assertThrows("Throwing exception on execute", 
SQLException.class, statement::getResultSet);
+}
+}
+
+@Test
+public void shouldUnwrapInvocationTargetExceptionFromExecute() throws 
SQLException {
+this.datasource.setDriverClassName(Driver.class.getName());
+this.datasource.setUrl("jdbc:tomcat:test");
+try (Connection con = this.datasource.getConnection();
+ Statement statement = con.prepareStatement("sql", 
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, 
ResultSet.HOLD_CURSORS_OVER_COMMIT)) {
+

Re: [PR] Unwrap InvocationTargetException from underlying statement execution [tomcat]

2024-08-09 Thread via GitHub


VRBogdanov commented on PR #744:
URL: https://github.com/apache/tomcat/pull/744#issuecomment-2277924088

   Hello @markt-asf, is there any possible chance of having pre-release 
snapshot with this change to validate it or we should wait for official build ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Unwrap InvocationTargetException from underlying statement execution [tomcat]

2024-08-09 Thread via GitHub


markt-asf commented on PR #744:
URL: https://github.com/apache/tomcat/pull/744#issuecomment-2277929769

   There will be one in the [snapshot 
repo](https://repository.apache.org/content/repositories/snapshots/org/apache/tomcat/tomcat/11.0.0-M25-SNAPSHOT/)
 in about 40 mins once the CI system finishes testing it. (There is a snapshot 
build after ~every commit).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Unwrap InvocationTargetException from underlying statement execution [tomcat]

2024-08-09 Thread via GitHub


markt-asf commented on PR #744:
URL: https://github.com/apache/tomcat/pull/744#issuecomment-2277931556

   It isn't an official release. It is for testing purposes only. Use it at 
your own risk. If your server catches fire don't blame us ;)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Unwrap InvocationTargetException from underlying statement execution [tomcat]

2024-08-09 Thread via GitHub


VRBogdanov commented on PR #744:
URL: https://github.com/apache/tomcat/pull/744#issuecomment-2277932891

   Of course, thanks a lot!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



(tomcat) branch main updated (2953661adc -> 7bd548c38e)

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

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


from 2953661adc Unwrap InvocationTargetException from underlying statement 
execution
 new d5ade63e32 Fix indent
 new 7bd548c38e Add change log entry

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/tomcat/jdbc/pool/StatementFacade.java |  6 +++---
 webapps/docs/changelog.xml| 11 +++
 2 files changed, 14 insertions(+), 3 deletions(-)


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



(tomcat) 02/02: Add change log entry

2024-08-09 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

commit 7bd548c38e48794881479fed750af72915dcf8da
Author: Mark Thomas 
AuthorDate: Fri Aug 9 14:25:39 2024 +0100

Add change log entry
---
 webapps/docs/changelog.xml | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 109ea3eafb..683bac69ed 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -135,6 +135,17 @@
   
 
   
+  
+
+  
+69255: Correct a regression in the fix for 69206
+that meant exceptions executing statements were wrapped in an
+java.lang.reflect.UndeclaredThrowableException rather than
+the applicaiton seeing the original SQLException. Fixed
+by pull request 744 provided by Michael Clarke. (markt)
+  
+
+  
   
 
   


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



(tomcat) 01/02: Fix indent

2024-08-09 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

commit d5ade63e325189857f9a2bde60d9494e0dba1fdf
Author: Mark Thomas 
AuthorDate: Fri Aug 9 14:11:46 2024 +0100

Fix indent
---
 .../src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
index 600ff80d82..ea32d619c5 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
@@ -121,15 +121,15 @@ public class StatementFacade extends 
AbstractCreateStatementInterceptor {
 try {
 if (compare(GET_RESULTSET, method)) {
 return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
 }
 if (compare(GET_GENERATED_KEYS, method)) {
 return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
 }
 if (compare(EXECUTE_QUERY, method)) {
 return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
 }
 
 // invoke next


-
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: Unwrap InvocationTargetException from underlying statement execution

2024-08-09 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 dbd80da75a Unwrap InvocationTargetException from underlying statement 
execution
dbd80da75a is described below

commit dbd80da75a54432aa714f46d50d4b7b4c0e4895f
Author: Michael Clarke 
AuthorDate: Thu Aug 8 20:26:58 2024 +0100

Unwrap InvocationTargetException from underlying statement execution

When executing a wrapped statement, any resulting SQLException is
wrapped in an InvocationTargetException by the reflective invocation,
which is rethrown by the InvocationHandler as an
UndeclaredThrowableException. To ensure the expected SQLException is
thrown, the invocation of the wrapped object is being moved into the
existing try-catch block, thereby ensuring the InvocationTargetException
is unwrapped and the underlying exception thrown by the handler.
---
 .../apache/tomcat/jdbc/pool/StatementFacade.java   | 28 ++--
 .../tomcat/jdbc/test/ProxiedStatementTest.java | 30 ++
 .../apache/tomcat/jdbc/test/driver/Connection.java |  2 +-
 .../apache/tomcat/jdbc/test/driver/Statement.java  | 22 +++-
 webapps/docs/changelog.xml | 11 
 5 files changed, 77 insertions(+), 16 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
index e9cae3a734..ea32d619c5 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
@@ -117,21 +117,21 @@ public class StatementFacade extends 
AbstractCreateStatementInterceptor {
 throw new SQLException("Statement closed.");
 }
 
-if (compare(GET_RESULTSET, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
-if (compare(GET_GENERATED_KEYS, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
-if (compare(EXECUTE_QUERY, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
-
-Object result = null;
+Object result;
 try {
+if (compare(GET_RESULTSET, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+}
+if (compare(GET_GENERATED_KEYS, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+}
+if (compare(EXECUTE_QUERY, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+}
+
 // invoke next
 result = method.invoke(delegate, args);
 } catch (Throwable t) {
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
index 2c76115c06..0f07663b0e 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
@@ -58,4 +58,34 @@ public class ProxiedStatementTest extends DefaultTestCase {
 Assert.assertNotEquals(statement, new 
org.apache.tomcat.jdbc.test.driver.Statement());
 }
 }
+
+@Test
+public void shouldUnwrapInvocationTargetExceptionFromGetResultSet() throws 
SQLException {
+this.datasource.setDriverClassName(Driver.class.getName());
+this.datasource.setUrl("jdbc:tomcat:test");
+try (Connection con = this.datasource.getConnection();
+ Statement statement = con.prepareStatement("sql", 
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, 
ResultSet.HOLD_CURSORS_OVER_COMMIT)) {
+Assert.assertThrows("Throwing exception on execute", 
SQLException.class, statement::getResultSet);
+}
+}
+
+@Test
+public void shouldUnwrapInvocationTargetExceptionFromExecute() throws 
SQLExce

(tomcat) branch 10.1.x updated: Unwrap InvocationTargetException from underlying statement execution

2024-08-09 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 cfbaea4704 Unwrap InvocationTargetException from underlying statement 
execution
cfbaea4704 is described below

commit cfbaea4704474b2883214197a2634a0fec2c2a74
Author: Michael Clarke 
AuthorDate: Thu Aug 8 20:26:58 2024 +0100

Unwrap InvocationTargetException from underlying statement execution

When executing a wrapped statement, any resulting SQLException is
wrapped in an InvocationTargetException by the reflective invocation,
which is rethrown by the InvocationHandler as an
UndeclaredThrowableException. To ensure the expected SQLException is
thrown, the invocation of the wrapped object is being moved into the
existing try-catch block, thereby ensuring the InvocationTargetException
is unwrapped and the underlying exception thrown by the handler.
---
 .../apache/tomcat/jdbc/pool/StatementFacade.java   | 28 ++--
 .../tomcat/jdbc/test/ProxiedStatementTest.java | 30 ++
 .../apache/tomcat/jdbc/test/driver/Connection.java |  2 +-
 .../apache/tomcat/jdbc/test/driver/Statement.java  | 22 +++-
 webapps/docs/changelog.xml | 11 
 5 files changed, 77 insertions(+), 16 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
index e9cae3a734..ea32d619c5 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/StatementFacade.java
@@ -117,21 +117,21 @@ public class StatementFacade extends 
AbstractCreateStatementInterceptor {
 throw new SQLException("Statement closed.");
 }
 
-if (compare(GET_RESULTSET, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
-if (compare(GET_GENERATED_KEYS, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
-if (compare(EXECUTE_QUERY, method)) {
-return getConstructor(RESULTSET_IDX, ResultSet.class)
-.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
-}
-
-Object result = null;
+Object result;
 try {
+if (compare(GET_RESULTSET, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+}
+if (compare(GET_GENERATED_KEYS, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+}
+if (compare(EXECUTE_QUERY, method)) {
+return getConstructor(RESULTSET_IDX, ResultSet.class)
+.newInstance(new 
ResultSetProxy(method.invoke(delegate, args), proxy));
+}
+
 // invoke next
 result = method.invoke(delegate, args);
 } catch (Throwable t) {
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
index 2c76115c06..0f07663b0e 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/ProxiedStatementTest.java
@@ -58,4 +58,34 @@ public class ProxiedStatementTest extends DefaultTestCase {
 Assert.assertNotEquals(statement, new 
org.apache.tomcat.jdbc.test.driver.Statement());
 }
 }
+
+@Test
+public void shouldUnwrapInvocationTargetExceptionFromGetResultSet() throws 
SQLException {
+this.datasource.setDriverClassName(Driver.class.getName());
+this.datasource.setUrl("jdbc:tomcat:test");
+try (Connection con = this.datasource.getConnection();
+ Statement statement = con.prepareStatement("sql", 
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, 
ResultSet.HOLD_CURSORS_OVER_COMMIT)) {
+Assert.assertThrows("Throwing exception on execute", 
SQLException.class, statement::getResultSet);
+}
+}
+
+@Test
+public void shouldUnwrapInvocationTargetExceptionFromExecute() throws 
SQLEx

(tomcat) branch main updated: Fix typo (thanks to n828cl for pointing it out)

2024-08-09 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 e279bf51cf Fix typo (thanks to n828cl for pointing it out)
e279bf51cf is described below

commit e279bf51cf84b3366c03d6d3e951591e0bffdc60
Author: Mark Thomas 
AuthorDate: Fri Aug 9 14:31:25 2024 +0100

Fix typo (thanks to n828cl for pointing it out)
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 683bac69ed..9baf253535 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -141,7 +141,7 @@
 69255: Correct a regression in the fix for 69206
 that meant exceptions executing statements were wrapped in an
 java.lang.reflect.UndeclaredThrowableException rather than
-the applicaiton seeing the original SQLException. Fixed
+the application seeing the original SQLException. Fixed
 by pull request 744 provided by Michael Clarke. (markt)
   
 


-
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: Fix typo (thanks to n828cl for pointing it out)

2024-08-09 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 2d2c4fbd1a Fix typo (thanks to n828cl for pointing it out)
2d2c4fbd1a is described below

commit 2d2c4fbd1ad523546b85e3c69f165c7e9d8804e1
Author: Mark Thomas 
AuthorDate: Fri Aug 9 14:31:25 2024 +0100

Fix typo (thanks to n828cl for pointing it out)
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 12668d0383..5ba613df47 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -141,7 +141,7 @@
 69255: Correct a regression in the fix for 69206
 that meant exceptions executing statements were wrapped in an
 java.lang.reflect.UndeclaredThrowableException rather than
-the applicaiton seeing the original SQLException. Fixed
+the application seeing the original SQLException. Fixed
 by pull request 744 provided by Michael Clarke. (markt)
   
 


-
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: Fix typo (thanks to n828cl for pointing it out)

2024-08-09 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 53fc5bb9d7 Fix typo (thanks to n828cl for pointing it out)
53fc5bb9d7 is described below

commit 53fc5bb9d7778e3124be1360b324f661dde3c05d
Author: Mark Thomas 
AuthorDate: Fri Aug 9 14:31:25 2024 +0100

Fix typo (thanks to n828cl for pointing it out)
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 1dcf124728..85e6ab0c8c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -141,7 +141,7 @@
 69255: Correct a regression in the fix for 69206
 that meant exceptions executing statements were wrapped in an
 java.lang.reflect.UndeclaredThrowableException rather than
-the applicaiton seeing the original SQLException. Fixed
+the application seeing the original SQLException. Fixed
 by pull request 744 provided by Michael Clarke. (markt)
   
 


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



[Bug 69255] SQL Connection throws java.lang.reflect.UndeclaredThrowableException instead of SQLException

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

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #2 from Mark Thomas  ---
Fixed in:
- 11.0.x for 11.0.0-M25 onwards
- 10.1.x for 10.1.29 onwards
-  9.0.x for  9.0.94 onwards

-- 
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-11.0.x

2024-08-09 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/1224
Blamelist: Mark Thomas 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch main] e279bf51cf84b3366c03d6d3e951591e0bffdc60


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: 2


-- ASF Buildbot


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



Buildbot failure in on tomcat-10.1.x

2024-08-09 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/44/builds/1354
Blamelist: Mark Thomas , Michael Clarke 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch 10.1.x] 2d2c4fbd1ad523546b85e3c69f165c7e9d8804e1


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: 2


-- ASF Buildbot


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



(tomcat) 04/06: Code clean-up - formatting. No functional change.

2024-08-09 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

commit 4822de7ed821b4a23b90e81924b2719caadfe770
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:18:43 2024 +0100

Code clean-up - formatting. No functional change.
---
 java/org/apache/el/stream/Stream.java  | 26 --
 .../org/apache/el/stream/StreamELResolverImpl.java |  6 ++---
 2 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/java/org/apache/el/stream/Stream.java 
b/java/org/apache/el/stream/Stream.java
index 4f9241e488..f419f1dca5 100644
--- a/java/org/apache/el/stream/Stream.java
+++ b/java/org/apache/el/stream/Stream.java
@@ -48,8 +48,7 @@ public class Stream {
 protected void findNext() {
 while (iterator.hasNext()) {
 Object obj = iterator.next();
-if (ELSupport.coerceToBoolean(null, le.invoke(obj),
-true).booleanValue()) {
+if (ELSupport.coerceToBoolean(null, le.invoke(obj), 
true).booleanValue()) {
 next = obj;
 foundNext = true;
 break;
@@ -83,8 +82,7 @@ public class Stream {
 
 @Override
 protected void findNext() {
-while (iterator.hasNext() ||
-(inner != null && inner.hasNext())) {
+while (iterator.hasNext() || (inner != null && 
inner.hasNext())) {
 if (inner == null || !inner.hasNext()) {
 inner = ((Stream) le.invoke(iterator.next())).iterator;
 }
@@ -343,7 +341,7 @@ public class Stream {
 
 while (iterator.hasNext()) {
 iterator.next();
-count ++;
+count++;
 }
 
 return Long.valueOf(count);
@@ -413,8 +411,7 @@ public class Stream {
 if ((obj instanceof Comparable)) {
 result = (Comparable) obj;
 } else {
-throw new ELException(
-MessageFactory.get("stream.compare.notComparable"));
+throw new 
ELException(MessageFactory.get("stream.compare.notComparable"));
 }
 }
 
@@ -427,8 +424,7 @@ public class Stream {
 result = (Comparable) obj;
 }
 } else {
-throw new ELException(
-MessageFactory.get("stream.compare.notComparable"));
+throw new 
ELException(MessageFactory.get("stream.compare.notComparable"));
 }
 }
 
@@ -450,11 +446,9 @@ public class Stream {
 
 while (iterator.hasNext()) {
 Object obj = iterator.next();
-if (isMax && ELSupport.coerceToNumber(null, le.invoke(obj, result),
-Integer.class).intValue() > 0) {
+if (isMax && ELSupport.coerceToNumber(null, le.invoke(obj, 
result), Integer.class).intValue() > 0) {
 result = obj;
-} else if (!isMax && ELSupport.coerceToNumber(null, le.invoke(obj, 
result),
-Integer.class).intValue() < 0) {
+} else if (!isMax && ELSupport.coerceToNumber(null, le.invoke(obj, 
result), Integer.class).intValue() < 0) {
 result = obj;
 }
 }
@@ -467,8 +461,7 @@ public class Stream {
 }
 
 
-private static class LambdaExpressionComparator
-implements Comparator {
+private static class LambdaExpressionComparator implements 
Comparator {
 
 private final LambdaExpression le;
 
@@ -478,8 +471,7 @@ public class Stream {
 
 @Override
 public int compare(Object o1, Object o2) {
-return ELSupport.coerceToNumber(
-null, le.invoke(o1, o2), Integer.class).intValue();
+return ELSupport.coerceToNumber(null, le.invoke(o1, o2), 
Integer.class).intValue();
 }
 }
 
diff --git a/java/org/apache/el/stream/StreamELResolverImpl.java 
b/java/org/apache/el/stream/StreamELResolverImpl.java
index dd26066372..c4531b5680 100644
--- a/java/org/apache/el/stream/StreamELResolverImpl.java
+++ b/java/org/apache/el/stream/StreamELResolverImpl.java
@@ -37,8 +37,7 @@ public class StreamELResolverImpl extends ELResolver {
 }
 
 @Override
-public void setValue(ELContext context, Object base, Object property,
-Object value) {
+public void setValue(ELContext context, Object base, Object property, 
Object value) {
 // NO-OP
 }
 
@@ -53,8 +52,7 @@ public class StreamELResolverImpl extends ELResolver {
 }
 
 @Override
-public Object invoke(ELContext context, Object base, Object method,
-Class[] paramTypes, Object[] params) {
+public Object invoke(ELContext context, Object base, Object method, 
Class[] paramTypes, Object[] params) {
 
 if ("st

(tomcat) 02/06: Code clean-up - formatting. No functional change.

2024-08-09 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

commit 69a171c68eba3367ea6982e7e17847054c93c6d2
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:13:03 2024 +0100

Code clean-up - formatting. No functional change.
---
 java/org/apache/el/lang/ELArithmetic.java  |  20 +-
 java/org/apache/el/lang/ELSupport.java | 206 +
 java/org/apache/el/lang/EvaluationContext.java |  15 +-
 java/org/apache/el/lang/ExpressionBuilder.java |  61 +++---
 java/org/apache/el/lang/FunctionMapperImpl.java|  13 +-
 .../el/lang/LambdaExpressionNestedState.java   |  13 +-
 java/org/apache/el/lang/VariableMapperImpl.java|  10 +-
 7 files changed, 136 insertions(+), 202 deletions(-)

diff --git a/java/org/apache/el/lang/ELArithmetic.java 
b/java/org/apache/el/lang/ELArithmetic.java
index de7dacae1b..17182c1fe3 100644
--- a/java/org/apache/el/lang/ELArithmetic.java
+++ b/java/org/apache/el/lang/ELArithmetic.java
@@ -27,6 +27,7 @@ import org.apache.el.util.MessageFactory;
 
 /**
  * A helper class of Arithmetic defined by the EL Specification
+ *
  * @author Jacob Hookom [ja...@hookom.net]
  */
 public abstract class ELArithmetic {
@@ -56,8 +57,7 @@ public abstract class ELArithmetic {
 
 @Override
 protected Number divide(Number num0, Number num1) {
-return ((BigDecimal) num0).divide((BigDecimal) num1,
-RoundingMode.HALF_UP);
+return ((BigDecimal) num0).divide((BigDecimal) num1, 
RoundingMode.HALF_UP);
 }
 
 @Override
@@ -190,13 +190,9 @@ public abstract class ELArithmetic {
 
 @Override
 public boolean matches(Object obj0, Object obj1) {
-return (obj0 instanceof Double
-|| obj1 instanceof Double
-|| obj0 instanceof Float
-|| obj1 instanceof Float
-|| (obj0 instanceof String && ELSupport
-.isStringFloat((String) obj0)) || (obj1 instanceof 
String && ELSupport
-.isStringFloat((String) obj1)));
+return (obj0 instanceof Double || obj1 instanceof Double || obj0 
instanceof Float ||
+obj1 instanceof Float || (obj0 instanceof String && 
ELSupport.isStringFloat((String) obj0)) ||
+(obj1 instanceof String && 
ELSupport.isStringFloat((String) obj1)));
 }
 }
 
@@ -359,10 +355,8 @@ public abstract class ELArithmetic {
 }
 
 public static final boolean isNumberType(final Class type) {
-return type == Long.TYPE || type == Double.TYPE ||
-type == Byte.TYPE || type == Short.TYPE ||
-type == Integer.TYPE || type == Float.TYPE ||
-Number.class.isAssignableFrom(type);
+return type == Long.TYPE || type == Double.TYPE || type == Byte.TYPE 
|| type == Short.TYPE ||
+type == Integer.TYPE || type == Float.TYPE || 
Number.class.isAssignableFrom(type);
 }
 
 protected ELArithmetic() {
diff --git a/java/org/apache/el/lang/ELSupport.java 
b/java/org/apache/el/lang/ELSupport.java
index d03fd39aed..8ab1c57e7a 100644
--- a/java/org/apache/el/lang/ELSupport.java
+++ b/java/org/apache/el/lang/ELSupport.java
@@ -52,18 +52,17 @@ public class ELSupport {
 /**
  * Compare two objects, after coercing to the same type if appropriate.
  * 
- * If the objects are identical, or they are equal according to
- * {@link #equals(ELContext, Object, Object)} then return 0.
+ * If the objects are identical, or they are equal according to {@link 
#equals(ELContext, Object, Object)} then
+ * return 0.
  * 
- * If either object is a BigDecimal, then coerce both to BigDecimal first.
- * Similarly for Double(Float), BigInteger, and Long(Integer, Char, Short, 
Byte).
+ * If either object is a BigDecimal, then coerce both to BigDecimal first. 
Similarly for Double(Float), BigInteger,
+ * and Long(Integer, Char, Short, Byte).
  * 
- * Otherwise, check that the first object is an instance of Comparable, 
and compare
- * against the second object. If that is null, return 1, otherwise
- * return the result of comparing against the second object.
+ * Otherwise, check that the first object is an instance of Comparable, 
and compare against the second object. If
+ * that is null, return 1, otherwise return the result of comparing 
against the second object.
  * 
- * Similarly, if the second object is Comparable, if the first is null, 
return -1,
- * else return the result of comparing against the first object.
+ * Similarly, if the second object is Comparable, if the first is null, 
return -1, else return the result of
+ * comparing against the first object.
  * 
  * A null object is considered as:
  * 
@@ -72,15 +71,16 @@ public class ELSupport {

(tomcat) 01/06: Add explicit line breaks in Javadoc

2024-08-09 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

commit 00fb2b393f7c43560ff2cbb6a5fea2b89c5c4409
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:12:43 2024 +0100

Add explicit line breaks in Javadoc
---
 java/org/apache/el/lang/ELSupport.java | 23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/el/lang/ELSupport.java 
b/java/org/apache/el/lang/ELSupport.java
index 52385ca4c0..d03fd39aed 100644
--- a/java/org/apache/el/lang/ELSupport.java
+++ b/java/org/apache/el/lang/ELSupport.java
@@ -51,20 +51,20 @@ public class ELSupport {
 
 /**
  * Compare two objects, after coercing to the same type if appropriate.
- *
+ * 
  * If the objects are identical, or they are equal according to
  * {@link #equals(ELContext, Object, Object)} then return 0.
- *
+ * 
  * If either object is a BigDecimal, then coerce both to BigDecimal first.
  * Similarly for Double(Float), BigInteger, and Long(Integer, Char, Short, 
Byte).
- *
+ * 
  * Otherwise, check that the first object is an instance of Comparable, 
and compare
  * against the second object. If that is null, return 1, otherwise
  * return the result of comparing against the second object.
- *
+ * 
  * Similarly, if the second object is Comparable, if the first is null, 
return -1,
  * else return the result of comparing against the first object.
- *
+ * 
  * A null object is considered as:
  * 
  * ZERO when compared with Numbers
@@ -122,11 +122,15 @@ public class ELSupport {
 
 /**
  * Compare two objects for equality, after coercing to the same type if 
appropriate.
- *
+ * 
  * If the objects are identical (including both null) return true.
+ * 
  * If either object is null, return false.
+ * 
  * If either object is Boolean, coerce both to Boolean and check equality.
+ * 
  * Similarly for Enum, String, BigDecimal, Double(Float), Long(Integer, 
Short, Byte, Character)
+ * 
  * Otherwise default to using Object.equals().
  *
  * @param ctx the context in which this equality test is taking place
@@ -171,9 +175,10 @@ public class ELSupport {
 }
 }
 
-// Going to have to have some casts /raw types somewhere so doing it here
-// keeps them all in one place. There might be a neater / better solution
-// but I couldn't find it
+/*
+ *  Going to have to have some casts /raw types somewhere so doing it here 
keeps them all in one place. There might
+ *  be a neater / better solution but I couldn't find it.
+ */
 @SuppressWarnings("unchecked")
 public static final Enum coerceToEnum(final ELContext ctx, final Object 
obj,
 @SuppressWarnings("rawtypes") Class type) {


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



(tomcat) 06/06: Code clean-up - formatting. No functional change.

2024-08-09 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

commit 809618a540b002e82d7c58567b058f6acda406e6
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:21:16 2024 +0100

Code clean-up - formatting. No functional change.
---
 java/org/apache/el/ExpressionFactoryImpl.java   |  20 +--
 java/org/apache/el/MethodExpressionImpl.java| 212 ++--
 java/org/apache/el/MethodExpressionLiteral.java |   9 +-
 java/org/apache/el/ValueExpressionImpl.java | 105 +---
 java/org/apache/el/ValueExpressionLiteral.java  |  19 +--
 5 files changed, 143 insertions(+), 222 deletions(-)

diff --git a/java/org/apache/el/ExpressionFactoryImpl.java 
b/java/org/apache/el/ExpressionFactoryImpl.java
index 82f5cf123b..4a13adb591 100644
--- a/java/org/apache/el/ExpressionFactoryImpl.java
+++ b/java/org/apache/el/ExpressionFactoryImpl.java
@@ -34,7 +34,7 @@ import org.apache.el.util.MessageFactory;
  *
  * @author Jacob Hookom [ja...@hookom.net]
  */
-@aQute.bnd.annotation.spi.ServiceProvider(value=ExpressionFactory.class)
+@aQute.bnd.annotation.spi.ServiceProvider(value = ExpressionFactory.class)
 public class ExpressionFactoryImpl extends ExpressionFactory {
 
 static {
@@ -47,31 +47,25 @@ public class ExpressionFactoryImpl extends 
ExpressionFactory {
 }
 
 @Override
-public MethodExpression createMethodExpression(ELContext context,
-String expression, Class expectedReturnType,
+public MethodExpression createMethodExpression(ELContext context, String 
expression, Class expectedReturnType,
 Class[] expectedParamTypes) {
 ExpressionBuilder builder = new ExpressionBuilder(expression, context);
-return builder.createMethodExpression(expectedReturnType,
-expectedParamTypes);
+return builder.createMethodExpression(expectedReturnType, 
expectedParamTypes);
 }
 
 @Override
-public ValueExpression createValueExpression(ELContext context,
-String expression, Class expectedType) {
+public ValueExpression createValueExpression(ELContext context, String 
expression, Class expectedType) {
 if (expectedType == null) {
-throw new NullPointerException(MessageFactory
-.get("error.value.expectedType"));
+throw new 
NullPointerException(MessageFactory.get("error.value.expectedType"));
 }
 ExpressionBuilder builder = new ExpressionBuilder(expression, context);
 return builder.createValueExpression(expectedType);
 }
 
 @Override
-public ValueExpression createValueExpression(Object instance,
-Class expectedType) {
+public ValueExpression createValueExpression(Object instance, Class 
expectedType) {
 if (expectedType == null) {
-throw new NullPointerException(MessageFactory
-.get("error.value.expectedType"));
+throw new 
NullPointerException(MessageFactory.get("error.value.expectedType"));
 }
 return new ValueExpressionLiteral(instance, expectedType);
 }
diff --git a/java/org/apache/el/MethodExpressionImpl.java 
b/java/org/apache/el/MethodExpressionImpl.java
index 5981465348..c9174d5796 100644
--- a/java/org/apache/el/MethodExpressionImpl.java
+++ b/java/org/apache/el/MethodExpressionImpl.java
@@ -39,32 +39,25 @@ import org.apache.el.util.ReflectionUtil;
 
 /**
  * An Expression that refers to a method on an object.
- *
  * 
- * The {@link jakarta.el.ExpressionFactory#createMethodExpression} method
- * can be used to parse an expression string and return a concrete instance
- * of MethodExpression that encapsulates the parsed expression.
- * The {@link FunctionMapper} is used at parse time, not evaluation time,
- * so one is not needed to evaluate an expression using this class.
- * However, the {@link ELContext} is needed at evaluation time.
- *
- * The {@link #getMethodInfo} and {@link #invoke} methods will evaluate the
- * expression each time they are called. The {@link jakarta.el.ELResolver} in 
the
- * ELContext is used to resolve the top-level variables and to
- * determine the behavior of the . and []
- * operators. For any of the two methods, the
- * {@link jakarta.el.ELResolver#getValue} method is used to resolve all 
properties
- * up to but excluding the last one. This provides the base object
- * on which the method appears. If the base object is null, a
- * NullPointerException must be thrown. At the last resolution,
- * the final property is then coerced to a String,
- * which provides the name of the method to be found. A method matching the
- * name and expected parameters provided at parse time is found and it is
- * either queried or invoked (depending on the method called on this
- * MethodExpression).
- *
- * See the notes about comparison, serialization and immutability in
- * the {@link jakarta.el.Expression} j

(tomcat) branch main updated (e279bf51cf -> 809618a540)

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

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


from e279bf51cf Fix typo (thanks to n828cl for pointing it out)
 new 00fb2b393f Add explicit line breaks in Javadoc
 new 69a171c68e Code clean-up - formatting. No functional change.
 new f9e377e7f3 Code clean-up - formatting. No functional change.
 new 4822de7ed8 Code clean-up - formatting. No functional change.
 new 27d25ec254 Code clean-up - no functional change
 new 809618a540 Code clean-up - formatting. No functional change.

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/el/ExpressionFactoryImpl.java  |  20 +-
 java/org/apache/el/MethodExpressionImpl.java   | 212 ---
 java/org/apache/el/MethodExpressionLiteral.java|   9 +-
 java/org/apache/el/ValueExpressionImpl.java| 105 --
 java/org/apache/el/ValueExpressionLiteral.java |  19 +-
 java/org/apache/el/lang/ELArithmetic.java  |  20 +-
 java/org/apache/el/lang/ELSupport.java | 225 +
 java/org/apache/el/lang/EvaluationContext.java |  15 +-
 java/org/apache/el/lang/ExpressionBuilder.java |  61 ++
 java/org/apache/el/lang/FunctionMapperImpl.java|  13 +-
 .../el/lang/LambdaExpressionNestedState.java   |  13 +-
 java/org/apache/el/lang/VariableMapperImpl.java|  10 +-
 java/org/apache/el/parser/ArithmeticNode.java  |   3 +-
 java/org/apache/el/parser/AstAnd.java  |   3 +-
 java/org/apache/el/parser/AstBracketSuffix.java|   3 +-
 java/org/apache/el/parser/AstChoice.java   |   6 +-
 .../apache/el/parser/AstCompositeExpression.java   |   6 +-
 .../apache/el/parser/AstDeferredExpression.java|  12 +-
 java/org/apache/el/parser/AstDiv.java  |   3 +-
 java/org/apache/el/parser/AstDotSuffix.java|   6 +-
 .../org/apache/el/parser/AstDynamicExpression.java |  12 +-
 java/org/apache/el/parser/AstEmpty.java|   6 +-
 java/org/apache/el/parser/AstEqual.java|   3 +-
 java/org/apache/el/parser/AstFalse.java|   3 +-
 java/org/apache/el/parser/AstFloatingPoint.java|   6 +-
 java/org/apache/el/parser/AstFunction.java |   3 +-
 java/org/apache/el/parser/AstGreaterThan.java  |   3 +-
 java/org/apache/el/parser/AstGreaterThanEqual.java |   3 +-
 java/org/apache/el/parser/AstIdentifier.java   |  44 ++--
 java/org/apache/el/parser/AstInteger.java  |   6 +-
 java/org/apache/el/parser/AstLambdaExpression.java |  31 ++-
 java/org/apache/el/parser/AstLessThan.java |   3 +-
 java/org/apache/el/parser/AstLessThanEqual.java|   3 +-
 .../org/apache/el/parser/AstLiteralExpression.java |   2 +-
 java/org/apache/el/parser/AstMapEntry.java |   9 +-
 java/org/apache/el/parser/AstMinus.java|   3 +-
 java/org/apache/el/parser/AstMod.java  |   3 +-
 java/org/apache/el/parser/AstMult.java |   3 +-
 java/org/apache/el/parser/AstNegative.java |   6 +-
 java/org/apache/el/parser/AstNot.java  |   6 +-
 java/org/apache/el/parser/AstNotEqual.java |   3 +-
 java/org/apache/el/parser/AstNull.java |   6 +-
 java/org/apache/el/parser/AstOr.java   |   3 +-
 java/org/apache/el/parser/AstPlus.java |   3 +-
 java/org/apache/el/parser/AstString.java   |   6 +-
 java/org/apache/el/parser/AstTrue.java |   3 +-
 java/org/apache/el/parser/AstValue.java| 102 --
 java/org/apache/el/parser/BooleanNode.java |   3 +-
 java/org/apache/el/stream/Stream.java  |  26 +--
 .../org/apache/el/stream/StreamELResolverImpl.java |   6 +-
 java/org/apache/el/util/ConcurrentCache.java   |   2 +-
 java/org/apache/el/util/ExceptionUtils.java|  11 +-
 java/org/apache/el/util/ReflectionUtil.java| 146 ++---
 java/org/apache/el/util/Validation.java|  24 +--
 54 files changed, 503 insertions(+), 763 deletions(-)


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



(tomcat) 05/06: Code clean-up - no functional change

2024-08-09 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

commit 27d25ec2545a45abb02e64c392b7176af1a8e96b
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:19:52 2024 +0100

Code clean-up - no functional change
---
 java/org/apache/el/util/ConcurrentCache.java |   2 +-
 java/org/apache/el/util/ExceptionUtils.java  |  11 +-
 java/org/apache/el/util/ReflectionUtil.java  | 146 ---
 java/org/apache/el/util/Validation.java  |  24 ++---
 4 files changed, 82 insertions(+), 101 deletions(-)

diff --git a/java/org/apache/el/util/ConcurrentCache.java 
b/java/org/apache/el/util/ConcurrentCache.java
index 1be17abaa8..ae37cfb9e6 100644
--- a/java/org/apache/el/util/ConcurrentCache.java
+++ b/java/org/apache/el/util/ConcurrentCache.java
@@ -20,7 +20,7 @@ import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
 
-public final class ConcurrentCache {
+public final class ConcurrentCache {
 
 private final int size;
 
diff --git a/java/org/apache/el/util/ExceptionUtils.java 
b/java/org/apache/el/util/ExceptionUtils.java
index 7c3c054d9f..f8e7dafb10 100644
--- a/java/org/apache/el/util/ExceptionUtils.java
+++ b/java/org/apache/el/util/ExceptionUtils.java
@@ -25,8 +25,8 @@ package org.apache.el.util;
 public class ExceptionUtils {
 
 /**
- * Checks whether the supplied Throwable is one that needs to be
- * rethrown and swallows all others.
+ * Checks whether the supplied Throwable is one that needs to be rethrown 
and swallows all others.
+ *
  * @param t the Throwable to check
  */
 public static void handleThrowable(Throwable t) {
@@ -42,10 +42,9 @@ public class ExceptionUtils {
 
 
 /**
- * NO-OP method provided to enable simple pre-loading of this class. Since
- * the class is used extensively in error handling, it is prudent to
- * pre-load it to avoid any failure to load this class masking the true
- * problem during error handling.
+ * NO-OP method provided to enable simple pre-loading of this class. Since 
the class is used extensively in error
+ * handling, it is prudent to pre-load it to avoid any failure to load 
this class masking the true problem during
+ * error handling.
  */
 public static void preload() {
 // NO-OP
diff --git a/java/org/apache/el/util/ReflectionUtil.java 
b/java/org/apache/el/util/ReflectionUtil.java
index 9d9d0f4d93..6693d46648 100644
--- a/java/org/apache/el/util/ReflectionUtil.java
+++ b/java/org/apache/el/util/ReflectionUtil.java
@@ -38,12 +38,11 @@ import org.apache.el.lang.EvaluationContext;
  */
 public class ReflectionUtil {
 
-protected static final String[] PRIMITIVE_NAMES = new String[] { "boolean",
-"byte", "char", "double", "float", "int", "long", "short", "void" 
};
+protected static final String[] PRIMITIVE_NAMES =
+new String[] { "boolean", "byte", "char", "double", "float", 
"int", "long", "short", "void" };
 
-protected static final Class[] PRIMITIVES = new Class[] { boolean.class,
-byte.class, char.class, double.class, float.class, int.class,
-long.class, short.class, Void.TYPE };
+protected static final Class[] PRIMITIVES = new Class[] { 
boolean.class, byte.class, char.class, double.class,
+float.class, int.class, long.class, short.class, Void.TYPE };
 
 private ReflectionUtil() {
 super();
@@ -78,10 +77,12 @@ public class ReflectionUtil {
 
 /**
  * Converts an array of Class names to Class types.
- * @param s  The array of class names
- * @return An array of Class instance where the element at index i in the
- * result is an instance of the class with the name at index i in
- * the input
+ *
+ * @param s The array of class names
+ *
+ * @return An array of Class instance where the element at index i in the 
result is an instance of the class with
+ * the name at index i in the input
+ *
  * @throws ClassNotFoundException If a class of a given name cannot be 
found
  */
 public static Class[] toTypeArray(String[] s) throws 
ClassNotFoundException {
@@ -97,9 +98,11 @@ public class ReflectionUtil {
 
 /**
  * Converts an array of Class types to Class names.
+ *
  * @param c The array of class instances
- * @return An array of Class names where the element at index i in the
- * result is the name of the class instance at index i in the input
+ *
+ * @return An array of Class names where the element at index i in the 
result is the name of the class instance at
+ * index i in the input
  */
 public static String[] toTypeNameArray(Class[] c) {
 if (c == null) {
@@ -114,32 +117,30 @@ public class ReflectionUtil {
 
 /**
  * Returns a method based on the criteria.

(tomcat) 03/06: Code clean-up - formatting. No functional change.

2024-08-09 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

commit f9e377e7f3992e4cc0559cd8e0197e074d110337
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:17:54 2024 +0100

Code clean-up - formatting. No functional change.
---
 java/org/apache/el/parser/ArithmeticNode.java  |   3 +-
 java/org/apache/el/parser/AstAnd.java  |   3 +-
 java/org/apache/el/parser/AstBracketSuffix.java|   3 +-
 java/org/apache/el/parser/AstChoice.java   |   6 +-
 .../apache/el/parser/AstCompositeExpression.java   |   6 +-
 .../apache/el/parser/AstDeferredExpression.java|  12 +--
 java/org/apache/el/parser/AstDiv.java  |   3 +-
 java/org/apache/el/parser/AstDotSuffix.java|   6 +-
 .../org/apache/el/parser/AstDynamicExpression.java |  12 +--
 java/org/apache/el/parser/AstEmpty.java|   6 +-
 java/org/apache/el/parser/AstEqual.java|   3 +-
 java/org/apache/el/parser/AstFalse.java|   3 +-
 java/org/apache/el/parser/AstFloatingPoint.java|   6 +-
 java/org/apache/el/parser/AstFunction.java |   3 +-
 java/org/apache/el/parser/AstGreaterThan.java  |   3 +-
 java/org/apache/el/parser/AstGreaterThanEqual.java |   3 +-
 java/org/apache/el/parser/AstIdentifier.java   |  44 -
 java/org/apache/el/parser/AstInteger.java  |   6 +-
 java/org/apache/el/parser/AstLambdaExpression.java |  31 +++
 java/org/apache/el/parser/AstLessThan.java |   3 +-
 java/org/apache/el/parser/AstLessThanEqual.java|   3 +-
 .../org/apache/el/parser/AstLiteralExpression.java |   2 +-
 java/org/apache/el/parser/AstMapEntry.java |   9 +-
 java/org/apache/el/parser/AstMinus.java|   3 +-
 java/org/apache/el/parser/AstMod.java  |   3 +-
 java/org/apache/el/parser/AstMult.java |   3 +-
 java/org/apache/el/parser/AstNegative.java |   6 +-
 java/org/apache/el/parser/AstNot.java  |   6 +-
 java/org/apache/el/parser/AstNotEqual.java |   3 +-
 java/org/apache/el/parser/AstNull.java |   6 +-
 java/org/apache/el/parser/AstOr.java   |   3 +-
 java/org/apache/el/parser/AstPlus.java |   3 +-
 java/org/apache/el/parser/AstString.java   |   6 +-
 java/org/apache/el/parser/AstTrue.java |   3 +-
 java/org/apache/el/parser/AstValue.java| 102 -
 java/org/apache/el/parser/BooleanNode.java |   3 +-
 36 files changed, 119 insertions(+), 210 deletions(-)

diff --git a/java/org/apache/el/parser/ArithmeticNode.java 
b/java/org/apache/el/parser/ArithmeticNode.java
index 2a665d1d30..69dacaa4ec 100644
--- a/java/org/apache/el/parser/ArithmeticNode.java
+++ b/java/org/apache/el/parser/ArithmeticNode.java
@@ -30,8 +30,7 @@ public abstract class ArithmeticNode extends SimpleNode {
 }
 
 @Override
-public Class getType(EvaluationContext ctx)
-throws ELException {
+public Class getType(EvaluationContext ctx) throws ELException {
 return Number.class;
 }
 }
diff --git a/java/org/apache/el/parser/AstAnd.java 
b/java/org/apache/el/parser/AstAnd.java
index 85d268e99f..8a87fe 100644
--- a/java/org/apache/el/parser/AstAnd.java
+++ b/java/org/apache/el/parser/AstAnd.java
@@ -32,8 +32,7 @@ public final class AstAnd extends BooleanNode {
 }
 
 @Override
-public Object getValue(EvaluationContext ctx)
-throws ELException {
+public Object getValue(EvaluationContext ctx) throws ELException {
 Object obj = children[0].getValue(ctx);
 Boolean b = ELSupport.coerceToBoolean(ctx, obj, true);
 if (!b.booleanValue()) {
diff --git a/java/org/apache/el/parser/AstBracketSuffix.java 
b/java/org/apache/el/parser/AstBracketSuffix.java
index 16f2e01700..48e47181d8 100644
--- a/java/org/apache/el/parser/AstBracketSuffix.java
+++ b/java/org/apache/el/parser/AstBracketSuffix.java
@@ -31,8 +31,7 @@ public final class AstBracketSuffix extends SimpleNode {
 }
 
 @Override
-public Object getValue(EvaluationContext ctx)
-throws ELException {
+public Object getValue(EvaluationContext ctx) throws ELException {
 return this.children[0].getValue(ctx);
 }
 }
diff --git a/java/org/apache/el/parser/AstChoice.java 
b/java/org/apache/el/parser/AstChoice.java
index 173ea22b3b..3981a97704 100644
--- a/java/org/apache/el/parser/AstChoice.java
+++ b/java/org/apache/el/parser/AstChoice.java
@@ -32,15 +32,13 @@ public final class AstChoice extends SimpleNode {
 }
 
 @Override
-public Class getType(EvaluationContext ctx)
-throws ELException {
+public Class getType(EvaluationContext ctx) throws ELException {
 Object val = this.getValue(ctx);
 return (val != null) ? val.getClass() : null;
 }
 
 @Override
-public Object getValue(EvaluationContext ctx)
-   

(tomcat) branch 10.1.x updated (2d2c4fbd1a -> bc85743c1e)

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

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


from 2d2c4fbd1a Fix typo (thanks to n828cl for pointing it out)
 new 7b8731c96a Add explicit line breaks in Javadoc
 new bc85743c1e Code clean-up - formatting. No functional change.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/el/ExpressionFactoryImpl.java  |  20 +-
 java/org/apache/el/MethodExpressionImpl.java   | 212 --
 java/org/apache/el/MethodExpressionLiteral.java|   9 +-
 java/org/apache/el/ValueExpressionImpl.java| 105 -
 java/org/apache/el/ValueExpressionLiteral.java |  19 +-
 java/org/apache/el/lang/ELArithmetic.java  |  20 +-
 java/org/apache/el/lang/ELSupport.java | 236 +
 java/org/apache/el/lang/EvaluationContext.java |  15 +-
 java/org/apache/el/lang/ExpressionBuilder.java |  65 +++---
 java/org/apache/el/lang/FunctionMapperImpl.java|  13 +-
 .../el/lang/LambdaExpressionNestedState.java   |  13 +-
 java/org/apache/el/lang/VariableMapperImpl.java|  10 +-
 java/org/apache/el/parser/ArithmeticNode.java  |   3 +-
 java/org/apache/el/parser/AstAnd.java  |   3 +-
 java/org/apache/el/parser/AstBracketSuffix.java|   3 +-
 java/org/apache/el/parser/AstChoice.java   |   6 +-
 .../apache/el/parser/AstCompositeExpression.java   |   6 +-
 .../apache/el/parser/AstDeferredExpression.java|  12 +-
 java/org/apache/el/parser/AstDiv.java  |   3 +-
 java/org/apache/el/parser/AstDotSuffix.java|   6 +-
 .../org/apache/el/parser/AstDynamicExpression.java |  12 +-
 java/org/apache/el/parser/AstEmpty.java|   6 +-
 java/org/apache/el/parser/AstEqual.java|   3 +-
 java/org/apache/el/parser/AstFalse.java|   3 +-
 java/org/apache/el/parser/AstFloatingPoint.java|   6 +-
 java/org/apache/el/parser/AstFunction.java |   3 +-
 java/org/apache/el/parser/AstGreaterThan.java  |   3 +-
 java/org/apache/el/parser/AstGreaterThanEqual.java |   3 +-
 java/org/apache/el/parser/AstIdentifier.java   |  44 ++--
 java/org/apache/el/parser/AstInteger.java  |   6 +-
 java/org/apache/el/parser/AstLambdaExpression.java |  31 ++-
 java/org/apache/el/parser/AstLessThan.java |   3 +-
 java/org/apache/el/parser/AstLessThanEqual.java|   3 +-
 .../org/apache/el/parser/AstLiteralExpression.java |   2 +-
 java/org/apache/el/parser/AstMapEntry.java |   9 +-
 java/org/apache/el/parser/AstMinus.java|   3 +-
 java/org/apache/el/parser/AstMod.java  |   3 +-
 java/org/apache/el/parser/AstMult.java |   3 +-
 java/org/apache/el/parser/AstNegative.java |   6 +-
 java/org/apache/el/parser/AstNot.java  |   6 +-
 java/org/apache/el/parser/AstNotEqual.java |   3 +-
 java/org/apache/el/parser/AstNull.java |   6 +-
 java/org/apache/el/parser/AstOr.java   |   3 +-
 java/org/apache/el/parser/AstPlus.java |   3 +-
 java/org/apache/el/parser/AstString.java   |   6 +-
 java/org/apache/el/parser/AstTrue.java |   3 +-
 java/org/apache/el/parser/AstValue.java| 102 -
 java/org/apache/el/parser/BooleanNode.java |   3 +-
 java/org/apache/el/stream/Stream.java  |  26 +--
 .../org/apache/el/stream/StreamELResolverImpl.java |   9 +-
 java/org/apache/el/util/ConcurrentCache.java   |   2 +-
 java/org/apache/el/util/ExceptionUtils.java|  11 +-
 java/org/apache/el/util/ReflectionUtil.java| 146 ++---
 java/org/apache/el/util/Validation.java|  31 ++-
 54 files changed, 512 insertions(+), 779 deletions(-)


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



(tomcat) 01/02: Add explicit line breaks in Javadoc

2024-08-09 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

commit 7b8731c96a91018fcf06d6373151ff8620f9b8ce
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:12:43 2024 +0100

Add explicit line breaks in Javadoc
---
 java/org/apache/el/lang/ELSupport.java | 23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/el/lang/ELSupport.java 
b/java/org/apache/el/lang/ELSupport.java
index cd7a38130d..402ed20dbb 100644
--- a/java/org/apache/el/lang/ELSupport.java
+++ b/java/org/apache/el/lang/ELSupport.java
@@ -67,20 +67,20 @@ public class ELSupport {
 
 /**
  * Compare two objects, after coercing to the same type if appropriate.
- *
+ * 
  * If the objects are identical, or they are equal according to
  * {@link #equals(ELContext, Object, Object)} then return 0.
- *
+ * 
  * If either object is a BigDecimal, then coerce both to BigDecimal first.
  * Similarly for Double(Float), BigInteger, and Long(Integer, Char, Short, 
Byte).
- *
+ * 
  * Otherwise, check that the first object is an instance of Comparable, 
and compare
  * against the second object. If that is null, return 1, otherwise
  * return the result of comparing against the second object.
- *
+ * 
  * Similarly, if the second object is Comparable, if the first is null, 
return -1,
  * else return the result of comparing against the first object.
- *
+ * 
  * A null object is considered as:
  * 
  * ZERO when compared with Numbers
@@ -138,11 +138,15 @@ public class ELSupport {
 
 /**
  * Compare two objects for equality, after coercing to the same type if 
appropriate.
- *
+ * 
  * If the objects are identical (including both null) return true.
+ * 
  * If either object is null, return false.
+ * 
  * If either object is Boolean, coerce both to Boolean and check equality.
+ * 
  * Similarly for Enum, String, BigDecimal, Double(Float), Long(Integer, 
Short, Byte, Character)
+ * 
  * Otherwise default to using Object.equals().
  *
  * @param ctx the context in which this equality test is taking place
@@ -187,9 +191,10 @@ public class ELSupport {
 }
 }
 
-// Going to have to have some casts /raw types somewhere so doing it here
-// keeps them all in one place. There might be a neater / better solution
-// but I couldn't find it
+/*
+ *  Going to have to have some casts /raw types somewhere so doing it here 
keeps them all in one place. There might
+ *  be a neater / better solution but I couldn't find it.
+ */
 @SuppressWarnings("unchecked")
 public static final Enum coerceToEnum(final ELContext ctx, final Object 
obj,
 @SuppressWarnings("rawtypes") Class type) {


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



(tomcat) 02/02: Code clean-up - formatting. No functional change.

2024-08-09 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

commit bc85743c1e15bb536c593ac43b634357731b3ea9
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:23:43 2024 +0100

Code clean-up - formatting. No functional change.
---
 java/org/apache/el/ExpressionFactoryImpl.java  |  20 +-
 java/org/apache/el/MethodExpressionImpl.java   | 212 
 java/org/apache/el/MethodExpressionLiteral.java|   9 +-
 java/org/apache/el/ValueExpressionImpl.java| 105 --
 java/org/apache/el/ValueExpressionLiteral.java |  19 +-
 java/org/apache/el/lang/ELArithmetic.java  |  20 +-
 java/org/apache/el/lang/ELSupport.java | 217 +
 java/org/apache/el/lang/EvaluationContext.java |  15 +-
 java/org/apache/el/lang/ExpressionBuilder.java |  65 +++---
 java/org/apache/el/lang/FunctionMapperImpl.java|  13 +-
 .../el/lang/LambdaExpressionNestedState.java   |  13 +-
 java/org/apache/el/lang/VariableMapperImpl.java|  10 +-
 java/org/apache/el/parser/ArithmeticNode.java  |   3 +-
 java/org/apache/el/parser/AstAnd.java  |   3 +-
 java/org/apache/el/parser/AstBracketSuffix.java|   3 +-
 java/org/apache/el/parser/AstChoice.java   |   6 +-
 .../apache/el/parser/AstCompositeExpression.java   |   6 +-
 .../apache/el/parser/AstDeferredExpression.java|  12 +-
 java/org/apache/el/parser/AstDiv.java  |   3 +-
 java/org/apache/el/parser/AstDotSuffix.java|   6 +-
 .../org/apache/el/parser/AstDynamicExpression.java |  12 +-
 java/org/apache/el/parser/AstEmpty.java|   6 +-
 java/org/apache/el/parser/AstEqual.java|   3 +-
 java/org/apache/el/parser/AstFalse.java|   3 +-
 java/org/apache/el/parser/AstFloatingPoint.java|   6 +-
 java/org/apache/el/parser/AstFunction.java |   3 +-
 java/org/apache/el/parser/AstGreaterThan.java  |   3 +-
 java/org/apache/el/parser/AstGreaterThanEqual.java |   3 +-
 java/org/apache/el/parser/AstIdentifier.java   |  44 ++---
 java/org/apache/el/parser/AstInteger.java  |   6 +-
 java/org/apache/el/parser/AstLambdaExpression.java |  31 ++-
 java/org/apache/el/parser/AstLessThan.java |   3 +-
 java/org/apache/el/parser/AstLessThanEqual.java|   3 +-
 .../org/apache/el/parser/AstLiteralExpression.java |   2 +-
 java/org/apache/el/parser/AstMapEntry.java |   9 +-
 java/org/apache/el/parser/AstMinus.java|   3 +-
 java/org/apache/el/parser/AstMod.java  |   3 +-
 java/org/apache/el/parser/AstMult.java |   3 +-
 java/org/apache/el/parser/AstNegative.java |   6 +-
 java/org/apache/el/parser/AstNot.java  |   6 +-
 java/org/apache/el/parser/AstNotEqual.java |   3 +-
 java/org/apache/el/parser/AstNull.java |   6 +-
 java/org/apache/el/parser/AstOr.java   |   3 +-
 java/org/apache/el/parser/AstPlus.java |   3 +-
 java/org/apache/el/parser/AstString.java   |   6 +-
 java/org/apache/el/parser/AstTrue.java |   3 +-
 java/org/apache/el/parser/AstValue.java| 102 --
 java/org/apache/el/parser/BooleanNode.java |   3 +-
 java/org/apache/el/stream/Stream.java  |  26 +--
 .../org/apache/el/stream/StreamELResolverImpl.java |   9 +-
 java/org/apache/el/util/ConcurrentCache.java   |   2 +-
 java/org/apache/el/util/ExceptionUtils.java|  11 +-
 java/org/apache/el/util/ReflectionUtil.java| 146 +++---
 java/org/apache/el/util/Validation.java|  31 ++-
 54 files changed, 500 insertions(+), 772 deletions(-)

diff --git a/java/org/apache/el/ExpressionFactoryImpl.java 
b/java/org/apache/el/ExpressionFactoryImpl.java
index 82f5cf123b..4a13adb591 100644
--- a/java/org/apache/el/ExpressionFactoryImpl.java
+++ b/java/org/apache/el/ExpressionFactoryImpl.java
@@ -34,7 +34,7 @@ import org.apache.el.util.MessageFactory;
  *
  * @author Jacob Hookom [ja...@hookom.net]
  */
-@aQute.bnd.annotation.spi.ServiceProvider(value=ExpressionFactory.class)
+@aQute.bnd.annotation.spi.ServiceProvider(value = ExpressionFactory.class)
 public class ExpressionFactoryImpl extends ExpressionFactory {
 
 static {
@@ -47,31 +47,25 @@ public class ExpressionFactoryImpl extends 
ExpressionFactory {
 }
 
 @Override
-public MethodExpression createMethodExpression(ELContext context,
-String expression, Class expectedReturnType,
+public MethodExpression createMethodExpression(ELContext context, String 
expression, Class expectedReturnType,
 Class[] expectedParamTypes) {
 ExpressionBuilder builder = new ExpressionBuilder(expression, context);
-return builder.createMethodExpression(expectedReturnType,
-expectedParamTypes);
+return builder.createMethodExpression(expectedRetur

(tomcat) 01/02: Add explicit line breaks in Javadoc

2024-08-09 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

commit 7d7e32489a709c900f9d024385ae50e95fc648a8
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:12:43 2024 +0100

Add explicit line breaks in Javadoc
---
 java/org/apache/el/lang/ELSupport.java | 23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/el/lang/ELSupport.java 
b/java/org/apache/el/lang/ELSupport.java
index 0a97b3f9cd..f42034d5f1 100644
--- a/java/org/apache/el/lang/ELSupport.java
+++ b/java/org/apache/el/lang/ELSupport.java
@@ -62,20 +62,20 @@ public class ELSupport {
 
 /**
  * Compare two objects, after coercing to the same type if appropriate.
- *
+ * 
  * If the objects are identical, or they are equal according to
  * {@link #equals(ELContext, Object, Object)} then return 0.
- *
+ * 
  * If either object is a BigDecimal, then coerce both to BigDecimal first.
  * Similarly for Double(Float), BigInteger, and Long(Integer, Char, Short, 
Byte).
- *
+ * 
  * Otherwise, check that the first object is an instance of Comparable, 
and compare
  * against the second object. If that is null, return 1, otherwise
  * return the result of comparing against the second object.
- *
+ * 
  * Similarly, if the second object is Comparable, if the first is null, 
return -1,
  * else return the result of comparing against the first object.
- *
+ * 
  * A null object is considered as:
  * 
  * ZERO when compared with Numbers
@@ -133,11 +133,15 @@ public class ELSupport {
 
 /**
  * Compare two objects for equality, after coercing to the same type if 
appropriate.
- *
+ * 
  * If the objects are identical (including both null) return true.
+ * 
  * If either object is null, return false.
+ * 
  * If either object is Boolean, coerce both to Boolean and check equality.
+ * 
  * Similarly for Enum, String, BigDecimal, Double(Float), Long(Integer, 
Short, Byte, Character)
+ * 
  * Otherwise default to using Object.equals().
  *
  * @param ctx the context in which this equality test is taking place
@@ -182,9 +186,10 @@ public class ELSupport {
 }
 }
 
-// Going to have to have some casts /raw types somewhere so doing it here
-// keeps them all in one place. There might be a neater / better solution
-// but I couldn't find it
+/*
+ *  Going to have to have some casts /raw types somewhere so doing it here 
keeps them all in one place. There might
+ *  be a neater / better solution but I couldn't find it.
+ */
 @SuppressWarnings("unchecked")
 public static final Enum coerceToEnum(final ELContext ctx, final Object 
obj,
 @SuppressWarnings("rawtypes") Class type) {


-
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 (53fc5bb9d7 -> f0ffcb0b9b)

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

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


from 53fc5bb9d7 Fix typo (thanks to n828cl for pointing it out)
 new 7d7e32489a Add explicit line breaks in Javadoc
 new f0ffcb0b9b Code clean-up - formatting. No functional change.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/el/ExpressionFactoryImpl.java  |  20 +-
 java/org/apache/el/MethodExpressionImpl.java   | 218 +
 java/org/apache/el/MethodExpressionLiteral.java|  12 +-
 java/org/apache/el/ValueExpressionImpl.java| 103 --
 java/org/apache/el/ValueExpressionLiteral.java |  19 +-
 java/org/apache/el/lang/ELArithmetic.java  |  20 +-
 java/org/apache/el/lang/ELSupport.java | 210 +---
 java/org/apache/el/lang/EvaluationContext.java |  18 +-
 java/org/apache/el/lang/ExpressionBuilder.java |  65 +++---
 java/org/apache/el/lang/FunctionMapperImpl.java|  13 +-
 .../el/lang/LambdaExpressionNestedState.java   |  13 +-
 java/org/apache/el/lang/VariableMapperImpl.java|  10 +-
 java/org/apache/el/parser/ArithmeticNode.java  |   3 +-
 java/org/apache/el/parser/AstAnd.java  |   3 +-
 java/org/apache/el/parser/AstBracketSuffix.java|   3 +-
 java/org/apache/el/parser/AstChoice.java   |   6 +-
 .../apache/el/parser/AstCompositeExpression.java   |   6 +-
 .../apache/el/parser/AstDeferredExpression.java|  12 +-
 java/org/apache/el/parser/AstDiv.java  |   3 +-
 java/org/apache/el/parser/AstDotSuffix.java|   6 +-
 .../org/apache/el/parser/AstDynamicExpression.java |  12 +-
 java/org/apache/el/parser/AstEmpty.java|   6 +-
 java/org/apache/el/parser/AstEqual.java|   3 +-
 java/org/apache/el/parser/AstFalse.java|   3 +-
 java/org/apache/el/parser/AstFloatingPoint.java|   6 +-
 java/org/apache/el/parser/AstFunction.java |   3 +-
 java/org/apache/el/parser/AstGreaterThan.java  |   3 +-
 java/org/apache/el/parser/AstGreaterThanEqual.java |   3 +-
 java/org/apache/el/parser/AstIdentifier.java   |  44 ++---
 java/org/apache/el/parser/AstInteger.java  |   6 +-
 java/org/apache/el/parser/AstLambdaExpression.java |  31 ++-
 java/org/apache/el/parser/AstLessThan.java |   3 +-
 java/org/apache/el/parser/AstLessThanEqual.java|   3 +-
 .../org/apache/el/parser/AstLiteralExpression.java |   2 +-
 java/org/apache/el/parser/AstMapEntry.java |   9 +-
 java/org/apache/el/parser/AstMinus.java|   3 +-
 java/org/apache/el/parser/AstMod.java  |   3 +-
 java/org/apache/el/parser/AstMult.java |   3 +-
 java/org/apache/el/parser/AstNegative.java |   6 +-
 java/org/apache/el/parser/AstNot.java  |   6 +-
 java/org/apache/el/parser/AstNotEqual.java |   3 +-
 java/org/apache/el/parser/AstNull.java |   6 +-
 java/org/apache/el/parser/AstOr.java   |   3 +-
 java/org/apache/el/parser/AstPlus.java |   3 +-
 java/org/apache/el/parser/AstString.java   |   6 +-
 java/org/apache/el/parser/AstTrue.java |   3 +-
 java/org/apache/el/parser/AstValue.java|  99 --
 java/org/apache/el/parser/BooleanNode.java |   3 +-
 java/org/apache/el/stream/Stream.java  |  26 +--
 .../org/apache/el/stream/StreamELResolverImpl.java |   9 +-
 java/org/apache/el/util/ConcurrentCache.java   |   2 +-
 java/org/apache/el/util/ExceptionUtils.java|  11 +-
 java/org/apache/el/util/JreCompat.java |  10 +-
 java/org/apache/el/util/ReflectionUtil.java| 148 +++---
 java/org/apache/el/util/Validation.java|  31 ++-
 55 files changed, 506 insertions(+), 778 deletions(-)


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



(tomcat) 02/02: Code clean-up - formatting. No functional change.

2024-08-09 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

commit f0ffcb0b9b9d8328d3223ae6d8b97129c07f4a1e
Author: Mark Thomas 
AuthorDate: Fri Aug 9 15:25:42 2024 +0100

Code clean-up - formatting. No functional change.
---
 java/org/apache/el/ExpressionFactoryImpl.java  |  20 +-
 java/org/apache/el/MethodExpressionImpl.java   | 218 +
 java/org/apache/el/MethodExpressionLiteral.java|  12 +-
 java/org/apache/el/ValueExpressionImpl.java| 103 --
 java/org/apache/el/ValueExpressionLiteral.java |  19 +-
 java/org/apache/el/lang/ELArithmetic.java  |  20 +-
 java/org/apache/el/lang/ELSupport.java | 191 --
 java/org/apache/el/lang/EvaluationContext.java |  18 +-
 java/org/apache/el/lang/ExpressionBuilder.java |  65 +++---
 java/org/apache/el/lang/FunctionMapperImpl.java|  13 +-
 .../el/lang/LambdaExpressionNestedState.java   |  13 +-
 java/org/apache/el/lang/VariableMapperImpl.java|  10 +-
 java/org/apache/el/parser/ArithmeticNode.java  |   3 +-
 java/org/apache/el/parser/AstAnd.java  |   3 +-
 java/org/apache/el/parser/AstBracketSuffix.java|   3 +-
 java/org/apache/el/parser/AstChoice.java   |   6 +-
 .../apache/el/parser/AstCompositeExpression.java   |   6 +-
 .../apache/el/parser/AstDeferredExpression.java|  12 +-
 java/org/apache/el/parser/AstDiv.java  |   3 +-
 java/org/apache/el/parser/AstDotSuffix.java|   6 +-
 .../org/apache/el/parser/AstDynamicExpression.java |  12 +-
 java/org/apache/el/parser/AstEmpty.java|   6 +-
 java/org/apache/el/parser/AstEqual.java|   3 +-
 java/org/apache/el/parser/AstFalse.java|   3 +-
 java/org/apache/el/parser/AstFloatingPoint.java|   6 +-
 java/org/apache/el/parser/AstFunction.java |   3 +-
 java/org/apache/el/parser/AstGreaterThan.java  |   3 +-
 java/org/apache/el/parser/AstGreaterThanEqual.java |   3 +-
 java/org/apache/el/parser/AstIdentifier.java   |  44 ++---
 java/org/apache/el/parser/AstInteger.java  |   6 +-
 java/org/apache/el/parser/AstLambdaExpression.java |  31 ++-
 java/org/apache/el/parser/AstLessThan.java |   3 +-
 java/org/apache/el/parser/AstLessThanEqual.java|   3 +-
 .../org/apache/el/parser/AstLiteralExpression.java |   2 +-
 java/org/apache/el/parser/AstMapEntry.java |   9 +-
 java/org/apache/el/parser/AstMinus.java|   3 +-
 java/org/apache/el/parser/AstMod.java  |   3 +-
 java/org/apache/el/parser/AstMult.java |   3 +-
 java/org/apache/el/parser/AstNegative.java |   6 +-
 java/org/apache/el/parser/AstNot.java  |   6 +-
 java/org/apache/el/parser/AstNotEqual.java |   3 +-
 java/org/apache/el/parser/AstNull.java |   6 +-
 java/org/apache/el/parser/AstOr.java   |   3 +-
 java/org/apache/el/parser/AstPlus.java |   3 +-
 java/org/apache/el/parser/AstString.java   |   6 +-
 java/org/apache/el/parser/AstTrue.java |   3 +-
 java/org/apache/el/parser/AstValue.java|  99 --
 java/org/apache/el/parser/BooleanNode.java |   3 +-
 java/org/apache/el/stream/Stream.java  |  26 +--
 .../org/apache/el/stream/StreamELResolverImpl.java |   9 +-
 java/org/apache/el/util/ConcurrentCache.java   |   2 +-
 java/org/apache/el/util/ExceptionUtils.java|  11 +-
 java/org/apache/el/util/JreCompat.java |  10 +-
 java/org/apache/el/util/ReflectionUtil.java| 148 +++---
 java/org/apache/el/util/Validation.java|  31 ++-
 55 files changed, 494 insertions(+), 771 deletions(-)

diff --git a/java/org/apache/el/ExpressionFactoryImpl.java 
b/java/org/apache/el/ExpressionFactoryImpl.java
index 3a6690a7ab..8ac4f3fdaf 100644
--- a/java/org/apache/el/ExpressionFactoryImpl.java
+++ b/java/org/apache/el/ExpressionFactoryImpl.java
@@ -34,7 +34,7 @@ import org.apache.el.util.MessageFactory;
  *
  * @author Jacob Hookom [ja...@hookom.net]
  */
-@aQute.bnd.annotation.spi.ServiceProvider(value=ExpressionFactory.class)
+@aQute.bnd.annotation.spi.ServiceProvider(value = ExpressionFactory.class)
 public class ExpressionFactoryImpl extends ExpressionFactory {
 
 static {
@@ -47,31 +47,25 @@ public class ExpressionFactoryImpl extends 
ExpressionFactory {
 }
 
 @Override
-public MethodExpression createMethodExpression(ELContext context,
-String expression, Class expectedReturnType,
+public MethodExpression createMethodExpression(ELContext context, String 
expression, Class expectedReturnType,
 Class[] expectedParamTypes) {
 ExpressionBuilder builder = new ExpressionBuilder(expression, context);
-return builder.createMethodExpression(expectedReturnType,
-expectedParamTypes);
+ 

Buildbot success in on tomcat-11.0.x

2024-08-09 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/1225
Blamelist: Mark Thomas 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch main] 809618a540b002e82d7c58567b058f6acda406e6


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: 1

  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



Buildbot success in on tomcat-10.1.x

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


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



Buildbot failure in on tomcat-9.0.x

2024-08-09 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/1039
Blamelist: Mark Thomas 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch 9.0.x] f0ffcb0b9b9d8328d3223ae6d8b97129c07f4a1e


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: 2


-- ASF Buildbot


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



(tomcat) branch main updated: Simplify logic

2024-08-09 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 043e9b3b33 Simplify logic
043e9b3b33 is described below

commit 043e9b3b3382ce8a2055b486d75d8eb9b4f9f6e6
Author: Mark Thomas 
AuthorDate: Fri Aug 9 19:26:23 2024 +0100

Simplify logic
---
 java/jakarta/el/OptionalELResolver.java | 6 +-
 webapps/docs/changelog.xml  | 3 +++
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/java/jakarta/el/OptionalELResolver.java 
b/java/jakarta/el/OptionalELResolver.java
index 5a6880278e..0d82293039 100644
--- a/java/jakarta/el/OptionalELResolver.java
+++ b/java/jakarta/el/OptionalELResolver.java
@@ -58,11 +58,7 @@ public class OptionalELResolver extends ELResolver {
 
 if (base instanceof Optional) {
 context.setPropertyResolved(base, property);
-if (((Optional) base).isEmpty()) {
-if (property == null) {
-return null;
-}
-} else {
+if (((Optional) base).isPresent()) {
 if (property == null) {
 return ((Optional) base).get();
 } else {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9baf253535..7c4042e438 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -111,6 +111,9 @@
 Switch the TldScanner back to logging detailed scan
 results at debug level rather than trace level. (markt)
   
+  
+Simplify the implementation of OptionalELResolver. (markt)
+  
 
   
   


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