Re: Running cipher-suite tests without failure

2022-02-25 Thread Rainer Jung
Forgot to mention: I do also test with Adoptium, Zulu and RedHat based 
JDK builds. Latest patch levels, results have been stable for all 
combination for a long time now, not only current latest patch levels.


Controlling which test classes are executed is possible via test.name 
and test.exclude in the build.properties. Default value ist:


test.name=**/Test*.java

and test.exclude is empty. The possible syntax for the values comes from 
the use in build.xml:




Multiple values can be separated by commas. Examples (analogous for 
test.exclude, not tested):


test.name=org/apache/coyote/http2/TestCancelledUpload.java,org/apache/coyote/http2/TestFlowControl.java

test.name=**/TestWebSocketFrameClientSSL.java,**/TestWsWebSocketContainer.java,**/util/net/

test.name=org/apache/tomcat/util/net/openssl/**

Some clases which are not actually unit test classes but match the 
default test.name are always excluded:


  

And (see build.xml):

  
  name="org/apache/tomcat/util/net/openssl/ciphers/**" 
unless="${test.openssl.exists}" />
  if="${test.excludePerformance}" />


The ant junit batchtest element used in our build.xml IMHO only allows 
test selection (include and exclude) by test class, not individual 
methods. The "test" element would allow inclusion by method name but 
would only run tests from a single class.


Best regards,

Rainer

Am 26.02.2022 um 05:22 schrieb Rainer Jung:

Hi Chris,

I don't get any unit test failures. I set in build.properties:

test.apr.loc=/path/to/tcnative/lib
test.openssl.path=/path/to/openssl/bin/openssl

Plus when testing with JSSE:

test.sslImplementation=org.apache.tomcat.util.net.jsse.JSSEImplementation

resp. OpenSSL:

test.sslImplementation=org.apache.tomcat.util.net.openssl.OpenSSLImplementation 



I do test with all Java LTS releases plus 18 plus for TC 8.5.0 Java 
1.7.0. All in combination with self-compiled OpenSSL 1.1.1 plus tcnative 
and I did not get any such failures for quite some time (probably more 
than a year). Have not tried OpenSSL 3.0.0 during the last months though.


Wild guess: maybe test.openssl.path is missing in your setup and the 
unit tests use the platform OpenSSL commandline binary in these tests, 
but on the server (Tomcat) side a newer one which you used to compile 
tcnative? Or platform OpenSSL misses some default OpenSSL ciphers? As 
said: using test.openssl.path makes sure, both sides use the same OpenSSL.


For the sake of completeness (not related to OpenSSL):

- testing with pre Java 11 needs the following lines in your own 
build.properties file:


opens.javalang=-Dnop
opens.javaio=-Dnop
opens.sunrmi=-Dnop
opens.javautil=-Dnop
opens.javautilconcurrent=-Dnop

You can add them before building or also just before running the test. 
They only apply to the unit test runs. The "nop" was chosen as any 
system property name that is likely not actually being used. It should 
remind one of a "no-operation".


- testing with Java 1.7.0 for TC 8.5 in addition needs older easymock 
and objenesis versions. You would have to set


easymock.version=3.6
objenesis.version=2.6

plus appropriate checksum lines for the download check:

easymock.checksum.value=1e6943105a21a336a874140e82b1a406|276883daaf2230e6f1e07c78ad695d2a18c7170b 

objenesis.checksum.value=5ffac3f51405ca9b2915970a224b3e8f|639033469776fd37c08358c6b92a4761feb2af4b 



Best regards,

Rainer

Am 24.02.2022 um 21:23 schrieb Christopher Schultz:

All,

My cipher-suite tests usually fail due to missing support for either 
certain OpenSSL ciphersuites or JSSE, depending upon the JVM used to 
tun run the tests.


I checked the testing code, but I don't see any documented way to 
customize what gets tested.


I seem to remember @isapir giving instructions for how to ignore 
certain cipher suites in specific environments so that all the tests 
would pass.


Is that officially documented anywhere?

Thanks,
-chris


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



Re: Running cipher-suite tests without failure

2022-02-25 Thread Rainer Jung

Hi Chris,

I don't get any unit test failures. I set in build.properties:

test.apr.loc=/path/to/tcnative/lib
test.openssl.path=/path/to/openssl/bin/openssl

Plus when testing with JSSE:

test.sslImplementation=org.apache.tomcat.util.net.jsse.JSSEImplementation

resp. OpenSSL:

test.sslImplementation=org.apache.tomcat.util.net.openssl.OpenSSLImplementation

I do test with all Java LTS releases plus 18 plus for TC 8.5.0 Java 
1.7.0. All in combination with self-compiled OpenSSL 1.1.1 plus tcnative 
and I did not get any such failures for quite some time (probably more 
than a year). Have not tried OpenSSL 3.0.0 during the last months though.


Wild guess: maybe test.openssl.path is missing in your setup and the 
unit tests use the platform OpenSSL commandline binary in these tests, 
but on the server (Tomcat) side a newer one which you used to compile 
tcnative? Or platform OpenSSL misses some default OpenSSL ciphers? As 
said: using test.openssl.path makes sure, both sides use the same OpenSSL.


For the sake of completeness (not related to OpenSSL):

- testing with pre Java 11 needs the following lines in your own 
build.properties file:


opens.javalang=-Dnop
opens.javaio=-Dnop
opens.sunrmi=-Dnop
opens.javautil=-Dnop
opens.javautilconcurrent=-Dnop

You can add them before building or also just before running the test. 
They only apply to the unit test runs. The "nop" was chosen as any 
system property name that is likely not actually being used. It should 
remind one of a "no-operation".


- testing with Java 1.7.0 for TC 8.5 in addition needs older easymock 
and objenesis versions. You would have to set


easymock.version=3.6
objenesis.version=2.6

plus appropriate checksum lines for the download check:

easymock.checksum.value=1e6943105a21a336a874140e82b1a406|276883daaf2230e6f1e07c78ad695d2a18c7170b
objenesis.checksum.value=5ffac3f51405ca9b2915970a224b3e8f|639033469776fd37c08358c6b92a4761feb2af4b

Best regards,

Rainer

Am 24.02.2022 um 21:23 schrieb Christopher Schultz:

All,

My cipher-suite tests usually fail due to missing support for either 
certain OpenSSL ciphersuites or JSSE, depending upon the JVM used to tun 
run the tests.


I checked the testing code, but I don't see any documented way to 
customize what gets tested.


I seem to remember @isapir giving instructions for how to ignore certain 
cipher suites in specific environments so that all the tests would pass.


Is that officially documented anywhere?

Thanks,
-chris


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



Re: [VOTE] Release Apache Tomcat 9.0.59

2022-02-25 Thread jean-frederic clere

On 25/02/2022 18:14, Rainer Jung wrote:

Hi Jean-Frederic,

Am 25.02.2022 um 17:27 schrieb jean-frederic clere:

On 21/02/2022 22:20, Rémy Maucherat wrote:

[X] Stable - go ahead and release as 9.0.59 (stable)


Tested on fedora fc35 with openjdk version "11.0.14.1"

My tests failed with openjdk version "1.8.0_322"
test-nio:
 [junit] Unrecognized option: 
--add-opens=java.base/java.lang=ALL-UNNAMED

 [junit] Error: Could not create the Java Virtual Machine.
The problem is to compile the tests with java11 and test with java8 I 
need to fix my tests :-(


we had this discussion in another thread. It should suffice to add the 
following lines to your own build.properties file:


opens.javalang=-Dnop
opens.javaio=-Dnop
opens.sunrmi=-Dnop
opens.javautil=-Dnop
opens.javautilconcurrent=-Dnop

You can add them before building or also just before running the test. 
They only apply to the unit test runs. The "nop" was chosen as any 
system property name that is likely not actually being used. It should 
remind one of a "no-operation".


Yes that helps
+++
BUILD SUCCESSFUL
Total time: 76 minutes 39 seconds

DONE: All OK
+++

So tested: with openjdk version "1.8.0_322" too.



Best regards,

Rainer




--
Cheers

Jean-Frederic


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



Re: [VOTE] Release Apache Tomcat 10.1.0-M11

2022-02-25 Thread jean-frederic clere

On 21/02/2022 19:42, Mark Thomas wrote:

[X] Alpha - go ahead and release as 10.1.0-M11 (alpha)


Tested on fedora35 with openjdk version "11.0.14.1" 2022-02-08

--
Cheers

Jean-Frederic


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



Re: [VOTE] Release Apache Tomcat 9.0.59

2022-02-25 Thread Rainer Jung

Hi Jean-Frederic,

Am 25.02.2022 um 17:27 schrieb jean-frederic clere:

On 21/02/2022 22:20, Rémy Maucherat wrote:

[X] Stable - go ahead and release as 9.0.59 (stable)


Tested on fedora fc35 with openjdk version "11.0.14.1"

My tests failed with openjdk version "1.8.0_322"
test-nio:
     [junit] Unrecognized option: 
--add-opens=java.base/java.lang=ALL-UNNAMED

     [junit] Error: Could not create the Java Virtual Machine.
The problem is to compile the tests with java11 and test with java8 I 
need to fix my tests :-(


we had this discussion in another thread. It should suffice to add the 
following lines to your own build.properties file:


opens.javalang=-Dnop
opens.javaio=-Dnop
opens.sunrmi=-Dnop
opens.javautil=-Dnop
opens.javautilconcurrent=-Dnop

You can add them before building or also just before running the test. 
They only apply to the unit test runs. The "nop" was chosen as any 
system property name that is likely not actually being used. It should 
remind one of a "no-operation".


Best regards,

Rainer


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



Re: [VOTE] Release Apache Tomcat 9.0.59

2022-02-25 Thread jean-frederic clere

On 21/02/2022 22:20, Rémy Maucherat wrote:

[X] Stable - go ahead and release as 9.0.59 (stable)


Tested on fedora fc35 with openjdk version "11.0.14.1"

My tests failed with openjdk version "1.8.0_322"
test-nio:
[junit] Unrecognized option: 
--add-opens=java.base/java.lang=ALL-UNNAMED

[junit] Error: Could not create the Java Virtual Machine.
The problem is to compile the tests with java11 and test with java8 I 
need to fix my tests :-(


--
Cheers

Jean-Frederic


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



Re: [VOTE] Release Apache Tomcat 9.0.59

2022-02-25 Thread Coty Sutherland
On Mon, Feb 21, 2022 at 4:21 PM Rémy Maucherat  wrote:

> The proposed Apache Tomcat 9.0.59 release is now available for voting.
>
> The notable changes compared to 9.0.58 are:
>
> - Add support for additional user attributes to TomcatPrincipal and
>GenericPrincipal
>
> - Correct a regression in the fix for 65454 that meant that
>minSpareThreads and maxThreads settings were ignored when the
>Connector used an internal executor
>
> - Improve the detection of the Linux duplicate accept bug and reduce
>(hopefully avoid) instances of false positives.
>
> Along with lots of other bug fixes and improvements.
>
> For full details, see the changelog:
> https://nightlies.apache.org/tomcat/tomcat-9.0.x/docs/changelog.html
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-9/v9.0.59/
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1358
> The tag is:
> https://github.com/apache/tomcat/tree/9.0.59
> 020f955044c1f9b512ee3da477eaa018da87e71a
>
> The proposed 9.0.59 release is:
> [ ] Broken - do not release
> [x] Stable - go ahead and release as 9.0.59 (stable)
>

+1


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


[GitHub] [tomcat] markt-asf commented on pull request #479: Fix Response#sendRedirect() if no request context exists.

2022-02-25 Thread GitBox


markt-asf commented on pull request #479:
URL: https://github.com/apache/tomcat/pull/479#issuecomment-1050857542


   This looks like invalid configuration at this point.
   
   Generally, an NPE is preferable to a change that masks a configuration issue.


-- 
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: Refer to correct log4j web jar

2022-02-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 1de8896  Refer to correct log4j web jar
1de8896 is described below

commit 1de88961ba73e191bae629142d8ec26a9adf9c88
Author: Michael Seele 
AuthorDate: Tue Feb 22 08:26:18 2022 +0100

Refer to correct log4j web jar

log4j-jakarta-web*.jar is the jar that supports Jakarta EE 9+ web servlet 
containers
---
 conf/catalina.properties   | 2 +-
 webapps/docs/changelog.xml | 9 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/conf/catalina.properties b/conf/catalina.properties
index 6a31180..dd35d24 100644
--- a/conf/catalina.properties
+++ b/conf/catalina.properties
@@ -200,7 +200,7 @@ xom-*.jar
 # scan types by configuring a JarScanner with a nested JarScanFilter.
 tomcat.util.scan.StandardJarScanFilter.jarsToScan=\
 log4j-taglib*.jar,\
-log4j-web*.jar,\
+log4j-jakarta-web*.jar,\
 log4javascript*.jar,\
 slf4j-taglib*.jar
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4b6f9dc..5743ab7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+477: Update the default list of JARs to skip to include the
+Apache Log4j JAR for Jakarta EE platforms. Pull request by Michael
+Seele. (markt)
+  
+
+  
   
 
   

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



[tomcat] branch 10.0.x updated: Add chnagelog entry

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

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new e8512bd  Add chnagelog entry
e8512bd is described below

commit e8512bddfd5531fcd83838e0aa443b4af835a3c9
Author: Mark Thomas 
AuthorDate: Fri Feb 25 13:13:23 2022 +

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

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2ffb734..f19fa5b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+477: Update the default list of JARs to skip to include the
+Apache Log4j JAR for Jakarta EE platforms. Pull request by Michael
+Seele. (markt)
+  
+
+  
   
 
   

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



[GitHub] [tomcat] markt-asf merged pull request #477: Refer to correct log4j web jar

2022-02-25 Thread GitBox


markt-asf merged pull request #477:
URL: https://github.com/apache/tomcat/pull/477


   


-- 
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 10.0.x updated: Refer to correct log4j web jar

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

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new e271979  Refer to correct log4j web jar
e271979 is described below

commit e27197977e0791c430b5b07a603635676e744ee3
Author: Michael Seele 
AuthorDate: Tue Feb 22 08:26:18 2022 +0100

Refer to correct log4j web jar

log4j-jakarta-web*.jar is the jar that supports Jakarta EE 9+ web servlet 
containers
---
 conf/catalina.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conf/catalina.properties b/conf/catalina.properties
index 9f0c046..ddb8f5f 100644
--- a/conf/catalina.properties
+++ b/conf/catalina.properties
@@ -199,7 +199,7 @@ xom-*.jar
 # scan types by configuring a JarScanner with a nested JarScanFilter.
 tomcat.util.scan.StandardJarScanFilter.jarsToScan=\
 log4j-taglib*.jar,\
-log4j-web*.jar,\
+log4j-jakarta-web*.jar,\
 log4javascript*.jar,\
 slf4j-taglib*.jar
 

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



Re: [VOTE] Release Apache Tomcat 10.0.17

2022-02-25 Thread Mladen Turk




On 21/02/2022 20:58, Mark Thomas wrote:


The proposed 10.0.17 release is:
[ ] Broken - do not release
[x] Stable - go ahead and release as 10.0.17 (stable)



Tested on Windows Server 2019/OpenJDK

Regards
--
^TM

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



Re: [VOTE] Release Apache Tomcat 9.0.59

2022-02-25 Thread Mladen Turk



On 21/02/2022 22:20, Rémy Maucherat wrote:


The proposed 9.0.59 release is:
[ ] Broken - do not release
[x] Stable - go ahead and release as 9.0.59 (stable)



Tested on Windows Server 2019/OpenJDK

Regards
--
^TM

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



[tomcat] branch 8.5.x updated: Fix edge case in EL method matching

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new f52d3a5  Fix edge case in EL method matching
f52d3a5 is described below

commit f52d3a5a7d0adb0d2d002868bf65bd5ffa7f5f7c
Author: Mark Thomas 
AuthorDate: Fri Feb 25 10:20:49 2022 +

Fix edge case in EL method matching

When resolving methods in EL expressions that use beans and/or static
fields, ensure that any custom type conversion is considered when
identifying the method to call.
---
 java/javax/el/BeanELResolver.java|  6 +--
 java/javax/el/StaticFieldELResolver.java |  9 ++--
 java/javax/el/Util.java  | 31 ++---
 test/javax/el/TestBeanELResolver.java| 78 
 webapps/docs/changelog.xml   |  9 
 5 files changed, 106 insertions(+), 27 deletions(-)

diff --git a/java/javax/el/BeanELResolver.java 
b/java/javax/el/BeanELResolver.java
index 3e7e1cf..bf77219 100644
--- a/java/javax/el/BeanELResolver.java
+++ b/java/javax/el/BeanELResolver.java
@@ -143,12 +143,10 @@ public class BeanELResolver extends ELResolver {
 String methodName = (String) factory.coerceToType(method, 
String.class);
 
 // Find the matching method
-Method matchingMethod =
-Util.findMethod(base.getClass(), base, methodName, paramTypes, 
params);
+Method matchingMethod = Util.findMethod(context, base.getClass(), 
base, methodName, paramTypes, params);
 
 Object[] parameters = Util.buildParameters(
-matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(),
-params);
+context, matchingMethod.getParameterTypes(), 
matchingMethod.isVarArgs(), params);
 
 Object result = null;
 try {
diff --git a/java/javax/el/StaticFieldELResolver.java 
b/java/javax/el/StaticFieldELResolver.java
index 717cba7..678724a 100644
--- a/java/javax/el/StaticFieldELResolver.java
+++ b/java/javax/el/StaticFieldELResolver.java
@@ -93,11 +93,10 @@ public class StaticFieldELResolver extends ELResolver {
 String methodName = (String) method;
 
 if ("".equals(methodName)) {
-Constructor match =
-Util.findConstructor(clazz, paramTypes, params);
+Constructor match = Util.findConstructor(context, clazz, 
paramTypes, params);
 
 Object[] parameters = Util.buildParameters(
-match.getParameterTypes(), match.isVarArgs(), params);
+context, match.getParameterTypes(), match.isVarArgs(), 
params);
 
 Object result = null;
 
@@ -114,7 +113,7 @@ public class StaticFieldELResolver extends ELResolver {
 
 } else {
 // Static method so base should be null
-Method match = Util.findMethod(clazz, null, methodName, 
paramTypes, params);
+Method match = Util.findMethod(context, clazz, null, 
methodName, paramTypes, params);
 
 // Note: On Java 9 and above, the isStatic check becomes
 // unnecessary because the canAccess() call in 
Util.findMethod()
@@ -126,7 +125,7 @@ public class StaticFieldELResolver extends ELResolver {
 }
 
 Object[] parameters = Util.buildParameters(
-match.getParameterTypes(), match.isVarArgs(), params);
+context, match.getParameterTypes(), match.isVarArgs(), 
params);
 
 Object result = null;
 try {
diff --git a/java/javax/el/Util.java b/java/javax/el/Util.java
index 0b41196..d169839 100644
--- a/java/javax/el/Util.java
+++ b/java/javax/el/Util.java
@@ -199,7 +199,7 @@ class Util {
  * This method duplicates code in org.apache.el.util.ReflectionUtil. When
  * making changes keep the code in sync.
  */
-static Method findMethod(Class clazz, Object base, String methodName,
+static Method findMethod(ELContext context, Class clazz, Object base, 
String methodName,
 Class[] paramTypes, Object[] paramValues) {
 
 if (clazz == null || methodName == null) {
@@ -216,7 +216,7 @@ class Util {
 
 List> wrappers = Wrapper.wrap(methods, methodName);
 
-Wrapper result = findWrapper(clazz, wrappers, methodName, 
paramTypes, paramValues);
+Wrapper result = findWrapper(context, clazz, wrappers, 
methodName, paramTypes, paramValues);
 
 return getMethod(clazz, base, result.unWrap());
 }
@@ -226,7 +226,7 @@ class Util {
  * making changes keep the code in sync.
  */
 @SuppressWarnings("null")
-private static  Wrapper findWrapper(Class clazz, List> 
wrappers,
+private static  Wrapper findWrapper(ELContext context, Class 
clazz, List> wrappers,
 String name, 

[tomcat] branch 9.0.x updated: Fix edge case in EL method matching

2022-02-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 d4050b4  Fix edge case in EL method matching
d4050b4 is described below

commit d4050b4cc979302c5f5cc9237609e1564fa367c4
Author: Mark Thomas 
AuthorDate: Fri Feb 25 10:20:49 2022 +

Fix edge case in EL method matching

When resolving methods in EL expressions that use beans and/or static
fields, ensure that any custom type conversion is considered when
identifying the method to call.
---
 java/javax/el/BeanELResolver.java|  6 +--
 java/javax/el/StaticFieldELResolver.java |  9 ++--
 java/javax/el/Util.java  | 31 ++---
 test/javax/el/TestBeanELResolver.java| 78 
 webapps/docs/changelog.xml   |  9 
 5 files changed, 106 insertions(+), 27 deletions(-)

diff --git a/java/javax/el/BeanELResolver.java 
b/java/javax/el/BeanELResolver.java
index b4372e0..e6e0de6 100644
--- a/java/javax/el/BeanELResolver.java
+++ b/java/javax/el/BeanELResolver.java
@@ -137,12 +137,10 @@ public class BeanELResolver extends ELResolver {
 String methodName = (String) factory.coerceToType(method, 
String.class);
 
 // Find the matching method
-Method matchingMethod =
-Util.findMethod(base.getClass(), base, methodName, paramTypes, 
params);
+Method matchingMethod = Util.findMethod(context, base.getClass(), 
base, methodName, paramTypes, params);
 
 Object[] parameters = Util.buildParameters(
-matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(),
-params);
+context, matchingMethod.getParameterTypes(), 
matchingMethod.isVarArgs(), params);
 
 Object result = null;
 try {
diff --git a/java/javax/el/StaticFieldELResolver.java 
b/java/javax/el/StaticFieldELResolver.java
index 717cba7..678724a 100644
--- a/java/javax/el/StaticFieldELResolver.java
+++ b/java/javax/el/StaticFieldELResolver.java
@@ -93,11 +93,10 @@ public class StaticFieldELResolver extends ELResolver {
 String methodName = (String) method;
 
 if ("".equals(methodName)) {
-Constructor match =
-Util.findConstructor(clazz, paramTypes, params);
+Constructor match = Util.findConstructor(context, clazz, 
paramTypes, params);
 
 Object[] parameters = Util.buildParameters(
-match.getParameterTypes(), match.isVarArgs(), params);
+context, match.getParameterTypes(), match.isVarArgs(), 
params);
 
 Object result = null;
 
@@ -114,7 +113,7 @@ public class StaticFieldELResolver extends ELResolver {
 
 } else {
 // Static method so base should be null
-Method match = Util.findMethod(clazz, null, methodName, 
paramTypes, params);
+Method match = Util.findMethod(context, clazz, null, 
methodName, paramTypes, params);
 
 // Note: On Java 9 and above, the isStatic check becomes
 // unnecessary because the canAccess() call in 
Util.findMethod()
@@ -126,7 +125,7 @@ public class StaticFieldELResolver extends ELResolver {
 }
 
 Object[] parameters = Util.buildParameters(
-match.getParameterTypes(), match.isVarArgs(), params);
+context, match.getParameterTypes(), match.isVarArgs(), 
params);
 
 Object result = null;
 try {
diff --git a/java/javax/el/Util.java b/java/javax/el/Util.java
index b659796..bb1601e 100644
--- a/java/javax/el/Util.java
+++ b/java/javax/el/Util.java
@@ -197,7 +197,7 @@ class Util {
  * This method duplicates code in org.apache.el.util.ReflectionUtil. When
  * making changes keep the code in sync.
  */
-static Method findMethod(Class clazz, Object base, String methodName,
+static Method findMethod(ELContext context, Class clazz, Object base, 
String methodName,
 Class[] paramTypes, Object[] paramValues) {
 
 if (clazz == null || methodName == null) {
@@ -214,7 +214,7 @@ class Util {
 
 List> wrappers = Wrapper.wrap(methods, methodName);
 
-Wrapper result = findWrapper(clazz, wrappers, methodName, 
paramTypes, paramValues);
+Wrapper result = findWrapper(context, clazz, wrappers, 
methodName, paramTypes, paramValues);
 
 return getMethod(clazz, base, result.unWrap());
 }
@@ -224,7 +224,7 @@ class Util {
  * making changes keep the code in sync.
  */
 @SuppressWarnings("null")
-private static  Wrapper findWrapper(Class clazz, List> 
wrappers,
+private static  Wrapper findWrapper(ELContext context, Class 
clazz, List> wrappers,
 String name, 

[tomcat] branch 10.0.x updated: Fix edge case in EL method matching

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

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 44e88ee  Fix edge case in EL method matching
44e88ee is described below

commit 44e88ee4abab74e4caebd863d549b85806ba85d2
Author: Mark Thomas 
AuthorDate: Fri Feb 25 10:20:49 2022 +

Fix edge case in EL method matching

When resolving methods in EL expressions that use beans and/or static
fields, ensure that any custom type conversion is considered when
identifying the method to call.
---
 java/jakarta/el/BeanELResolver.java|  6 +--
 java/jakarta/el/StaticFieldELResolver.java |  9 ++--
 java/jakarta/el/Util.java  | 31 +---
 test/jakarta/el/TestBeanELResolver.java| 78 ++
 webapps/docs/changelog.xml |  9 
 5 files changed, 106 insertions(+), 27 deletions(-)

diff --git a/java/jakarta/el/BeanELResolver.java 
b/java/jakarta/el/BeanELResolver.java
index 8057784..4836a56 100644
--- a/java/jakarta/el/BeanELResolver.java
+++ b/java/jakarta/el/BeanELResolver.java
@@ -137,12 +137,10 @@ public class BeanELResolver extends ELResolver {
 String methodName = (String) factory.coerceToType(method, 
String.class);
 
 // Find the matching method
-Method matchingMethod =
-Util.findMethod(base.getClass(), base, methodName, paramTypes, 
params);
+Method matchingMethod = Util.findMethod(context, base.getClass(), 
base, methodName, paramTypes, params);
 
 Object[] parameters = Util.buildParameters(
-matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(),
-params);
+context, matchingMethod.getParameterTypes(), 
matchingMethod.isVarArgs(), params);
 
 Object result = null;
 try {
diff --git a/java/jakarta/el/StaticFieldELResolver.java 
b/java/jakarta/el/StaticFieldELResolver.java
index d723a7a..c111921 100644
--- a/java/jakarta/el/StaticFieldELResolver.java
+++ b/java/jakarta/el/StaticFieldELResolver.java
@@ -93,11 +93,10 @@ public class StaticFieldELResolver extends ELResolver {
 String methodName = (String) method;
 
 if ("".equals(methodName)) {
-Constructor match =
-Util.findConstructor(clazz, paramTypes, params);
+Constructor match = Util.findConstructor(context, clazz, 
paramTypes, params);
 
 Object[] parameters = Util.buildParameters(
-match.getParameterTypes(), match.isVarArgs(), params);
+context, match.getParameterTypes(), match.isVarArgs(), 
params);
 
 Object result = null;
 
@@ -114,7 +113,7 @@ public class StaticFieldELResolver extends ELResolver {
 
 } else {
 // Static method so base should be null
-Method match = Util.findMethod(clazz, null, methodName, 
paramTypes, params);
+Method match = Util.findMethod(context, clazz, null, 
methodName, paramTypes, params);
 
 // Note: On Java 9 and above, the isStatic check becomes
 // unnecessary because the canAccess() call in 
Util.findMethod()
@@ -126,7 +125,7 @@ public class StaticFieldELResolver extends ELResolver {
 }
 
 Object[] parameters = Util.buildParameters(
-match.getParameterTypes(), match.isVarArgs(), params);
+context, match.getParameterTypes(), match.isVarArgs(), 
params);
 
 Object result = null;
 try {
diff --git a/java/jakarta/el/Util.java b/java/jakarta/el/Util.java
index 80a6ee0..826f0ca 100644
--- a/java/jakarta/el/Util.java
+++ b/java/jakarta/el/Util.java
@@ -197,7 +197,7 @@ class Util {
  * This method duplicates code in org.apache.el.util.ReflectionUtil. When
  * making changes keep the code in sync.
  */
-static Method findMethod(Class clazz, Object base, String methodName,
+static Method findMethod(ELContext context, Class clazz, Object base, 
String methodName,
 Class[] paramTypes, Object[] paramValues) {
 
 if (clazz == null || methodName == null) {
@@ -214,7 +214,7 @@ class Util {
 
 List> wrappers = Wrapper.wrap(methods, methodName);
 
-Wrapper result = findWrapper(clazz, wrappers, methodName, 
paramTypes, paramValues);
+Wrapper result = findWrapper(context, clazz, wrappers, 
methodName, paramTypes, paramValues);
 
 return getMethod(clazz, base, result.unWrap());
 }
@@ -224,7 +224,7 @@ class Util {
  * making changes keep the code in sync.
  */
 @SuppressWarnings("null")
-private static  Wrapper findWrapper(Class clazz, List> 
wrappers,
+private static  Wrapper findWrapper(ELContext context, Class 
clazz, List> 

[tomcat] branch main updated: Fix edge case in EL method matching

2022-02-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 afa662d  Fix edge case in EL method matching
afa662d is described below

commit afa662d7d71747769d1a97c999d696883859a5d0
Author: Mark Thomas 
AuthorDate: Fri Feb 25 10:20:49 2022 +

Fix edge case in EL method matching

When resolving methods in EL expressions that use beans and/or static
fields, ensure that any custom type conversion is considered when
identifying the method to call.
---
 java/jakarta/el/BeanELResolver.java|  6 +--
 java/jakarta/el/StaticFieldELResolver.java |  9 ++--
 java/jakarta/el/Util.java  | 31 ++---
 test/jakarta/el/TestBeanELResolver.java| 74 ++
 webapps/docs/changelog.xml |  9 
 5 files changed, 102 insertions(+), 27 deletions(-)

diff --git a/java/jakarta/el/BeanELResolver.java 
b/java/jakarta/el/BeanELResolver.java
index b39fa6d..8d41119 100644
--- a/java/jakarta/el/BeanELResolver.java
+++ b/java/jakarta/el/BeanELResolver.java
@@ -143,12 +143,10 @@ public class BeanELResolver extends ELResolver {
 String methodName = factory.coerceToType(method, String.class);
 
 // Find the matching method
-Method matchingMethod =
-Util.findMethod(base.getClass(), base, methodName, paramTypes, 
params);
+Method matchingMethod = Util.findMethod(context, base.getClass(), 
base, methodName, paramTypes, params);
 
 Object[] parameters = Util.buildParameters(
-matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(),
-params);
+context, matchingMethod.getParameterTypes(), 
matchingMethod.isVarArgs(), params);
 
 Object result = null;
 try {
diff --git a/java/jakarta/el/StaticFieldELResolver.java 
b/java/jakarta/el/StaticFieldELResolver.java
index 365b979..831309a 100644
--- a/java/jakarta/el/StaticFieldELResolver.java
+++ b/java/jakarta/el/StaticFieldELResolver.java
@@ -92,11 +92,10 @@ public class StaticFieldELResolver extends ELResolver {
 String methodName = (String) method;
 
 if ("".equals(methodName)) {
-Constructor match =
-Util.findConstructor(clazz, paramTypes, params);
+Constructor match = Util.findConstructor(context, clazz, 
paramTypes, params);
 
 Object[] parameters = Util.buildParameters(
-match.getParameterTypes(), match.isVarArgs(), params);
+context, match.getParameterTypes(), match.isVarArgs(), 
params);
 
 Object result = null;
 
@@ -113,7 +112,7 @@ public class StaticFieldELResolver extends ELResolver {
 
 } else {
 // Static method so base should be null
-Method match = Util.findMethod(clazz, null, methodName, 
paramTypes, params);
+Method match = Util.findMethod(context, clazz, null, 
methodName, paramTypes, params);
 
 if (match == null) {
 throw new MethodNotFoundException(Util.message(context,
@@ -122,7 +121,7 @@ public class StaticFieldELResolver extends ELResolver {
 }
 
 Object[] parameters = Util.buildParameters(
-match.getParameterTypes(), match.isVarArgs(), params);
+context, match.getParameterTypes(), match.isVarArgs(), 
params);
 
 Object result = null;
 try {
diff --git a/java/jakarta/el/Util.java b/java/jakarta/el/Util.java
index 880c1db..badccfb 100644
--- a/java/jakarta/el/Util.java
+++ b/java/jakarta/el/Util.java
@@ -198,7 +198,7 @@ class Util {
  * This method duplicates code in org.apache.el.util.ReflectionUtil. When
  * making changes keep the code in sync.
  */
-static Method findMethod(Class clazz, Object base, String methodName,
+static Method findMethod(ELContext context, Class clazz, Object base, 
String methodName,
 Class[] paramTypes, Object[] paramValues) {
 
 if (clazz == null || methodName == null) {
@@ -215,7 +215,7 @@ class Util {
 
 List> wrappers = Wrapper.wrap(methods, methodName);
 
-Wrapper result = findWrapper(clazz, wrappers, methodName, 
paramTypes, paramValues);
+Wrapper result = findWrapper(context, clazz, wrappers, 
methodName, paramTypes, paramValues);
 
 return getMethod(clazz, base, result.unWrap());
 }
@@ -225,7 +225,7 @@ class Util {
  * making changes keep the code in sync.
  */
 @SuppressWarnings("null")
-private static  Wrapper findWrapper(Class clazz, List> 
wrappers,
+private static  Wrapper findWrapper(ELContext context, Class 
clazz, List> wrappers,
 String name, Class[] paramTypes,