Re: JDK 19 first Release Candidates!

2022-08-24 Thread Martin Grigorov
Hi David,

Apache Tomcat's build and tests pass successfully with JDK 19 b36 and 20
b11 on both Ubuntu x86_64 and openEuler OS ARM64.

Regards,
Martin

On Mon, Aug 22, 2022 at 4:23 PM David Delabassee <
david.delabas...@oracle.com> wrote:

> Greetings!
>
> I hope you had a chance to take some time off. On our side, and despite
> the summer vacation, everything is on track for the Java 19 GA release
> on September 20th with JDK 19 now in the Release Candidate Phase [1]. If
> you haven't done so yet, it is time to start testing your project(s)
> using JDK 20 Early-Access builds. Speaking of Early-Access builds, there
> is now a new set of EA builds, i.e., the jextract EA builds. jextract is
> a tool developed under the Project Panama umbrella whose goal is to
> mechanically generates Java bindings from native library headers. If you
> are using the Foreign Function & Memory API (Preview Feature in JDK 19),
> make sure to check jextract too (see the jextract section below).
>
> [1] https://mail.openjdk.org/pipermail/jdk-dev/2022-August/006861.html
>
>
> ## Heads-up - New system properties for `System.out` and `System.err` in
> JDK 19
>
> Two new system properties, `stdout.encoding` and `stderr.encoding`, have
> been introduced. The value of these system properties is the encoding
> used by the standard output (`System.out`) and standard error
> (`System.err`) streams. The default values of these system properties
> depend on the platform. The values take on the value of the
> `native.encoding` property when the platform does not provide streams
> for the console. The properties can be overridden on the launcher's
> command line option, with `-D`, to set them to UTF-8 where required. For
> more details see https://bugs.openjdk.org/browse/JDK-8283620
>
>
> ## Heads-up - SSLSocketImpl finalizer implementation removed in JDK 19
>
> The finalizer implementation in SSLSocket has been removed, with the
> underlying native resource releases now done by the Socket
> implementation. With this update, the TLS close_notify messages will no
> longer be emitted if SSLSocket is not explicitly closed. Not closing
> Sockets properly is an error condition that should be avoided.
> Applications should always close sockets and not rely on garbage
> collection. For more details see
> https://bugs.openjdk.org/browse/JDK-8212136
>
>
> ## Heads-up - New providerPath jarsigner option in JDK 19
>
> A new `-providerPath` option has been added to the jarsigner. This
> option is used to specify the class path of an alternate keystore
> implementation, it can be used together with the -providerClass option.
> For more details see https://bugs.openjdk.org/browse/JDK-8281175
>
>
> ## JDK 19 Release Candidate builds
>
> JDK 19 first Release Candidates (builds 36) are now available [2], and
> are provided under the GNU General Public License v2, with the Classpath
> Exception. The Release Notes are available here [3].
>
> [2] https://jdk.java.net/19/
> [3] https://jdk.java.net/19/release-notes
>
>
> ## JDK 20 Early-Access builds
>
> JDK 20 Early-Access builds 11 are now available [4], and are provided
> under the GNU General Public License v2, with the Classpath Exception.
> The Release Notes are available here [5].
>
> [4] https://jdk.java.net/20/
> [5] https://jdk.java.net/20/release-notes
>
> ### Recent changes that maybe of interest:
>
> - JDK-8282730: LdapLoginModule throw NPE from logout method after login
> failure
> - JDK-8290706: Remove the support for inline contiguous allocations
> - JDK-8289551: Conversions between bit representations of half precision
> values and floats
> - JDK-8290485: [vector] REVERSE_BYTES for byte type should not emit any
> instructions
> - JDK-8289137: Automatically adapt Young/OldPLABSize and when setting
> only MinTLABSize
> - JDK-8290034: Auto vectorize reverse bit operations.
> - JDK-8290868: NMT: MallocSiteTable statistics improvements
> - JDK-8291822: ARM32: Build errors with GCC 11 in
> frame::saved_oop_result [Reported by JaCoCo]
> - JDK-8289249: Add methods to Elements for record constructors
> - JDK-8283232: x86: Improve vector broadcast operations
> - JDK-8288327: Executable.hasRealParameterData should not be volatile
> - JDK-8291360: Create entry points to expose low-level class file
> information
> - JDK-8290840: Refactor the "os" class
> - JDK-8292327: InflaterInputStream.read throws EOFException
> - JDK-8155246: Throw error if default java.security file is missing
> - JDK-8289332: Auto-generate ids for user-defined headings
> - JDK-8292153: x86: Represent Registers as values
>
>
> ## Jextract Early-Access Builds
>
> Early Access Builds 19-jextract+2-3 (2022/7/19) are now available [6].
> These open-source builds are provided under the GNU General Public
> License, version 2, with the Classpath Exception.
>
> These builds are from the OpenJDK jextract project [7] which is part of
> Code Tools [8]. jextract is a tool developed under the Panama umbrealla
> whose goal is to mechanically generate 

[GitHub] [tomcat] aooohan closed pull request #531: Bugfix for 63080 - Support rfc7239 Forwarded header

2022-08-24 Thread GitBox


aooohan closed pull request #531: Bugfix for 63080 - Support rfc7239 Forwarded 
header
URL: https://github.com/apache/tomcat/pull/531


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



[GitHub] [tomcat] aooohan commented on pull request #531: Bugfix for 63080 - Support rfc7239 Forwarded header

2022-08-24 Thread GitBox


aooohan commented on PR #531:
URL: https://github.com/apache/tomcat/pull/531#issuecomment-1226801420

   The implementation is  a bit ugly, continue to optimize later, close first.


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



[GitHub] [tomcat-jakartaee-migration] aooohan commented on a diff in pull request #33: fixes #32 check if file name ends with manifest name

2022-08-24 Thread GitBox


aooohan commented on code in PR #33:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/33#discussion_r954498342


##
src/test/java/org/apache/tomcat/jakartaee/ManifestConverterTest.java:
##
@@ -0,0 +1,16 @@
+package org.apache.tomcat.jakartaee;
+
+import static org.junit.Assert.assertTrue;

Review Comment:
   You're right, But the reason it's not recommended is that it's not very 
intuitive because we don't know if it's a junit method or a custom method when 
the test has many code.



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



[GitHub] [tomcat] aooohan commented on pull request #542: Bugfix for 66210 - Some unit tests are failing on a non-English PC

2022-08-24 Thread GitBox


aooohan commented on PR #542:
URL: https://github.com/apache/tomcat/pull/542#issuecomment-1226672348

   If there are no problems, I will merge it today.


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



Patch for mod_jk bug 65901 - request for comment

2022-08-24 Thread Stefan Mayr

Hi,

some time ago I reported a mod_jk bug for HEAD requests (#65901). This
week we found another application thats runs into exactly the same issue
for a different response code. So I repeated some tests and updated my
patch/pull request to match the current main branch.

Since I did not get any feedback (bz,github) yet I want to ask you if
anyone could have a look at my patch. Am I doing the right thing or is
my approach completely wrong?

Thank you,

 Stefan

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



[Bug 65901] HTTP 401 response for a HEAD request violates HTTP spec by including a body

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65901

--- Comment #4 from Stefan Mayr  ---
Github pull request was also updated:
https://github.com/apache/tomcat-connectors/pull/5

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



[Bug 65901] HTTP 401 response for a HEAD request violates HTTP spec by including a body

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65901

--- Comment #3 from Stefan Mayr  ---
Created attachment 38376
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38376&action=edit
Attempt to fix bug 65901 against 1.2.49

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



[Bug 65901] HTTP 401 response for a HEAD request violates HTTP spec by including a body

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65901

--- Comment #2 from Stefan Mayr  ---
This week we found this issue is also present for other status codes like 403,
404, 405 etc.

Test wird custom JSPs like
<% response.sendError(401, "Authenticate"); %>

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



[tomcat] branch 9.0.x updated: Fix typo

2022-08-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 816b1f295b Fix typo
816b1f295b is described below

commit 816b1f295b2b438c33c3856ed18a5c70a74d34a0
Author: lihan 
AuthorDate: Wed Aug 24 21:38:13 2022 +0800

Fix typo
---
 java/org/apache/catalina/core/StandardEngine.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/core/StandardEngine.java 
b/java/org/apache/catalina/core/StandardEngine.java
index 6aa496baa1..9aa3945cbf 100644
--- a/java/org/apache/catalina/core/StandardEngine.java
+++ b/java/org/apache/catalina/core/StandardEngine.java
@@ -67,7 +67,7 @@ public class StandardEngine extends ContainerBase implements 
Engine {
 
 super();
 pipeline.setBasic(new StandardEngineValve());
-/* Set the jmvRoute using the system property jvmRoute */
+/* Set the jvmRoute using the system property jvmRoute */
 try {
 setJvmRoute(System.getProperty("jvmRoute"));
 } catch(Exception ex) {


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

2022-08-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 481e70daed Fix typo
481e70daed is described below

commit 481e70daed1120ab0504dc8f2c1cc0bc47ee2445
Author: lihan 
AuthorDate: Wed Aug 24 21:38:13 2022 +0800

Fix typo
---
 java/org/apache/catalina/core/StandardEngine.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/core/StandardEngine.java 
b/java/org/apache/catalina/core/StandardEngine.java
index c29892b6bf..6d072773cd 100644
--- a/java/org/apache/catalina/core/StandardEngine.java
+++ b/java/org/apache/catalina/core/StandardEngine.java
@@ -65,7 +65,7 @@ public class StandardEngine extends ContainerBase implements 
Engine {
 
 super();
 pipeline.setBasic(new StandardEngineValve());
-/* Set the jmvRoute using the system property jvmRoute */
+/* Set the jvmRoute using the system property jvmRoute */
 try {
 setJvmRoute(System.getProperty("jvmRoute"));
 } catch(Exception ex) {


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



Re: jakarta.el, useless getResource?

2022-08-24 Thread Romain Manni-Bucau
Hi

Went ahead and created https://github.com/apache/tomcat/pull/547  (if it
helps)

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le lun. 22 août 2022 à 14:25, Romain Manni-Bucau  a
écrit :

> +1
>
> To answer the proxy reference: it affects other cases - loading classes
> from a "database", proxies is just a well known case I used to illustrate
> my point. By contract a classloader is not always an URLClassLoader which
> is the assumption of the impl right now. Also CDS changes the perf there
> too - a lot when enabled.
>
> Side note: graalvm integration is way easier without that check ;).
>
> Romain Manni-Bucau
> @rmannibucau  |  Blog
>  | Old Blog
>  | Github
>  | LinkedIn
>  | Book
> 
>
>
> Le lun. 22 août 2022 à 13:54, Mark Thomas  a écrit :
>
>> On 22/08/2022 11:48, Mark Thomas wrote:
>> > On 22/08/2022 10:20, Romain Manni-Bucau wrote:
>>
>> 
>>
>> >> So overall I wonder if this check can be dropped now we have concurrent
>> >> classloaders and cache almost everywhere. If not, should the missed
>> items
>> >> be cached in some (webapp) classloader to help to exit faster?
>> >
>> > We need to test with various JDKs but if the results are comparable to
>> > those for Java 11, I'd have no objection to simplifying the code.
>>
>> I've just run the performance test with Java 7, Java 8 and Java 11 with
>> 8.5.x and in all three cases, the average time to run the test was less
>> without the performance fix than with it.
>>
>> Given these, results, I think we remove this performance hack for all
>> current versions.
>>
>> Objections?
>>
>> Mark
>>
>> -
>> 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: Fix typo

2022-08-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 6167517453 Fix typo
6167517453 is described below

commit 616751745353b2c4cd9300971d4b3e1a233dc3a5
Author: lihan 
AuthorDate: Wed Aug 24 21:38:13 2022 +0800

Fix typo
---
 java/org/apache/catalina/core/StandardEngine.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/core/StandardEngine.java 
b/java/org/apache/catalina/core/StandardEngine.java
index 6aa496baa1..9aa3945cbf 100644
--- a/java/org/apache/catalina/core/StandardEngine.java
+++ b/java/org/apache/catalina/core/StandardEngine.java
@@ -67,7 +67,7 @@ public class StandardEngine extends ContainerBase implements 
Engine {
 
 super();
 pipeline.setBasic(new StandardEngineValve());
-/* Set the jmvRoute using the system property jvmRoute */
+/* Set the jvmRoute using the system property jvmRoute */
 try {
 setJvmRoute(System.getProperty("jvmRoute"));
 } catch(Exception ex) {


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



[tomcat] branch main updated: Remove deprecated code.

2022-08-24 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 378bb27c4f Remove deprecated code.
378bb27c4f is described below

commit 378bb27c4fd98dc306b88f699955e19dce4d7c41
Author: Mark Thomas 
AuthorDate: Wed Aug 24 14:22:39 2022 +0100

Remove deprecated code.
---
 java/org/apache/tomcat/util/descriptor/web/WebXml.java  |  8 
 .../tomcat/util/descriptor/web/TestWebXmlOrdering.java  | 13 -
 2 files changed, 21 deletions(-)

diff --git a/java/org/apache/tomcat/util/descriptor/web/WebXml.java 
b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
index 3eb1a0f253..a8efa05dff 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebXml.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
@@ -89,14 +89,6 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Charse
 public boolean isDuplicated() {
 return !duplicates.isEmpty();
 }
-@Deprecated
-public void setDuplicated(boolean duplicated) {
-if (duplicated) {
-duplicates.add("unknown");
-} else {
-duplicates.clear();
-}
-}
 public void addDuplicate(String duplicate) {
 this.duplicates.add(duplicate);
 }
diff --git a/test/org/apache/tomcat/util/descriptor/web/TestWebXmlOrdering.java 
b/test/org/apache/tomcat/util/descriptor/web/TestWebXmlOrdering.java
index 5c221d19c1..40b62ab300 100644
--- a/test/org/apache/tomcat/util/descriptor/web/TestWebXmlOrdering.java
+++ b/test/org/apache/tomcat/util/descriptor/web/TestWebXmlOrdering.java
@@ -362,19 +362,6 @@ public class TestWebXmlOrdering {
 WebXml.orderWebFragments(app, fragmentsWithDuplicate, null);
 }
 
-@SuppressWarnings("deprecation")
-@Test(expected=IllegalArgumentException.class)
-public void testOrderWebFragmentsRelativeDuplicateDeprecated() throws 
MalformedURLException {
-WebXml withDuplicate = new WebXml();
-withDuplicate.setURL(new URL("https://example.com/original.jar";));
-withDuplicate.setDuplicated(true);
-
-Map fragmentsWithDuplicate = new LinkedHashMap<>();
-fragmentsWithDuplicate.put("has-duplicate", withDuplicate);
-
-WebXml.orderWebFragments(app, fragmentsWithDuplicate, null);
-}
-
 private interface RelativeOrderingTestRunner {
 void init();
 void validate(String order);


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



[GitHub] [tomcat] markt-asf closed pull request #535: List duplicate locations when failing a deploy due to duplicated fragment names

2022-08-24 Thread GitBox


markt-asf closed pull request #535: List duplicate locations when failing a 
deploy due to duplicated fragment names
URL: https://github.com/apache/tomcat/pull/535


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



[GitHub] [tomcat] markt-asf commented on pull request #535: List duplicate locations when failing a deploy due to duplicated fragment names

2022-08-24 Thread GitBox


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

   AS per previous comment, merged manually. Thanks very much for the PR.


-- 
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 8.5.x updated: Manually merge #535 - improve error message for duplicate fragments

2022-08-24 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 9a5056d402 Manually merge #535 - improve error message for duplicate 
fragments
9a5056d402 is described below

commit 9a5056d402b334580c7a92916ee8d221bdde00d4
Author: Mark Thomas 
AuthorDate: Wed Aug 24 14:20:19 2022 +0100

Manually merge #535 - improve error message for duplicate fragments

Now lists the JARs that contain the duplicates. PR by Mads Rolsdorph
---
 .../descriptor/web/FragmentJarScannerCallback.java |  2 +-
 .../util/descriptor/web/LocalStrings.properties|  2 +-
 .../apache/tomcat/util/descriptor/web/WebXml.java  | 21 +
 .../util/descriptor/web/TestWebXmlOrdering.java| 27 ++
 webapps/docs/changelog.xml |  6 +
 5 files changed, 52 insertions(+), 6 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java 
b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
index 8782e26b6e..9455d4763c 100644
--- a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
+++ b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
@@ -136,7 +136,7 @@ public class FragmentJarScannerCallback implements 
JarScannerCallback {
 // this name as having a duplicate so Tomcat can handle it
 // correctly when the fragments are being ordered.
 String duplicateName = fragment.getName();
-fragments.get(duplicateName).setDuplicated(true);
+fragments.get(duplicateName).addDuplicate(url.toString());
 // Rename the current fragment so it doesn't clash
 fragment.setName(url.toString());
 }
diff --git a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties 
b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
index cd74378397..e3dda224ce 100644
--- a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
@@ -32,7 +32,7 @@ webRuleSet.relativeOrderingCount= element is 
limited to 1 occurrence
 
 webXml.duplicateEnvEntry=Duplicate env-entry name [{0}]
 webXml.duplicateFilter=Duplicate filter name [{0}]
-webXml.duplicateFragment=More than one fragment with the name [{0}] was found. 
This is not legal with relative ordering. See section 8.2.2 2c of the Servlet 
specification for details. Consider using absolute ordering.
+webXml.duplicateFragment=More than one fragment with the name [{0}] was found. 
This is not legal with relative ordering. See section 8.2.2 2c of the Servlet 
specification for details. Consider using absolute ordering. Duplicate 
fragments found in [{1}].
 webXml.duplicateMessageDestination=Duplicate message-destination name [{0}]
 webXml.duplicateMessageDestinationRef=Duplicate message-destination-ref name 
[{0}]
 webXml.duplicateResourceEnvRef=Duplicate resource-env-ref name [{0}]
diff --git a/java/org/apache/tomcat/util/descriptor/web/WebXml.java 
b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
index 705b1556cd..b17d595c0b 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebXml.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
@@ -85,12 +85,23 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Encodi
  * to know as the action that the specification requires (see 8.2.2 1.e and
  * 2.c) varies depending on the ordering method used.
  */
-private boolean duplicated = false;
+private final List duplicates = new ArrayList<>();
 public boolean isDuplicated() {
-return duplicated;
+return !duplicates.isEmpty();
 }
+@Deprecated
 public void setDuplicated(boolean duplicated) {
-this.duplicated = duplicated;
+if (duplicated) {
+duplicates.add("unknown");
+} else {
+duplicates.clear();
+}
+}
+public void addDuplicate(String duplicate) {
+this.duplicates.add(duplicate);
+}
+public List getDuplicates() {
+return new ArrayList<>(this.duplicates);
 }
 
 /**
@@ -2202,8 +2213,10 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Encodi
 // Stage 0. Check there were no fragments with duplicate names
 for (WebXml fragment : fragments.values()) {
 if (fragment.isDuplicated()) {
+List duplicates = fragment.getDuplicates();
+duplicates.add(0, fragment.getURL().toString());
 throw new IllegalArgumentException(
-sm.getString("webXml.duplicateFragment", 
fragment.getName()));
+sm.getString("webXml.duplicateFragment", 
fr

[tomcat] branch 9.0.x updated: Manually merge #535 - improve error message for duplicate fragments

2022-08-24 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 7e2a5b2028 Manually merge #535 - improve error message for duplicate 
fragments
7e2a5b2028 is described below

commit 7e2a5b2028f5f4c11ff25be07ac1c1934d6d4471
Author: Mark Thomas 
AuthorDate: Wed Aug 24 14:20:19 2022 +0100

Manually merge #535 - improve error message for duplicate fragments

Now lists the JARs that contain the duplicates. PR by Mads Rolsdorph
---
 .../descriptor/web/FragmentJarScannerCallback.java |  2 +-
 .../util/descriptor/web/LocalStrings.properties|  2 +-
 .../apache/tomcat/util/descriptor/web/WebXml.java  | 21 +
 .../util/descriptor/web/TestWebXmlOrdering.java| 27 ++
 webapps/docs/changelog.xml |  6 +
 5 files changed, 52 insertions(+), 6 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java 
b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
index 8782e26b6e..9455d4763c 100644
--- a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
+++ b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
@@ -136,7 +136,7 @@ public class FragmentJarScannerCallback implements 
JarScannerCallback {
 // this name as having a duplicate so Tomcat can handle it
 // correctly when the fragments are being ordered.
 String duplicateName = fragment.getName();
-fragments.get(duplicateName).setDuplicated(true);
+fragments.get(duplicateName).addDuplicate(url.toString());
 // Rename the current fragment so it doesn't clash
 fragment.setName(url.toString());
 }
diff --git a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties 
b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
index dd57b512d3..a84bc1fbe0 100644
--- a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
@@ -32,7 +32,7 @@ webRuleSet.relativeOrderingCount= element is 
limited to 1 occurrence
 
 webXml.duplicateEnvEntry=Duplicate env-entry name [{0}]
 webXml.duplicateFilter=Duplicate filter name [{0}]
-webXml.duplicateFragment=More than one fragment with the name [{0}] was found. 
This is not legal with relative ordering. See section 8.2.2 2c of the Servlet 
specification for details. Consider using absolute ordering.
+webXml.duplicateFragment=More than one fragment with the name [{0}] was found. 
This is not legal with relative ordering. See section 8.2.2 2c of the Servlet 
specification for details. Consider using absolute ordering. Duplicate 
fragments found in [{1}].
 webXml.duplicateMessageDestination=Duplicate message-destination name [{0}]
 webXml.duplicateMessageDestinationRef=Duplicate message-destination-ref name 
[{0}]
 webXml.duplicateResourceEnvRef=Duplicate resource-env-ref name [{0}]
diff --git a/java/org/apache/tomcat/util/descriptor/web/WebXml.java 
b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
index c517ddec76..4706653f9b 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebXml.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
@@ -84,12 +84,23 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Charse
  * to know as the action that the specification requires (see 8.2.2 1.e and
  * 2.c) varies depending on the ordering method used.
  */
-private boolean duplicated = false;
+private final List duplicates = new ArrayList<>();
 public boolean isDuplicated() {
-return duplicated;
+return !duplicates.isEmpty();
 }
+@Deprecated
 public void setDuplicated(boolean duplicated) {
-this.duplicated = duplicated;
+if (duplicated) {
+duplicates.add("unknown");
+} else {
+duplicates.clear();
+}
+}
+public void addDuplicate(String duplicate) {
+this.duplicates.add(duplicate);
+}
+public List getDuplicates() {
+return new ArrayList<>(this.duplicates);
 }
 
 /**
@@ -2258,8 +2269,10 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Charse
 // Stage 0. Check there were no fragments with duplicate names
 for (WebXml fragment : fragments.values()) {
 if (fragment.isDuplicated()) {
+List duplicates = fragment.getDuplicates();
+duplicates.add(0, fragment.getURL().toString());
 throw new IllegalArgumentException(
-sm.getString("webXml.duplicateFragment", 
fragment.getName()));
+sm.getString("webXml.duplicateFragment", 
fr

[tomcat] branch 10.0.x updated: Manually merge #535 - improve error message for duplicate fragments

2022-08-24 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 1fac2707f3 Manually merge #535 - improve error message for duplicate 
fragments
1fac2707f3 is described below

commit 1fac2707f3d9a6da64610333fcad310ee6d9b8a2
Author: Mark Thomas 
AuthorDate: Wed Aug 24 14:20:19 2022 +0100

Manually merge #535 - improve error message for duplicate fragments

Now lists the JARs that contain the duplicates. PR by Mads Rolsdorph
---
 .../descriptor/web/FragmentJarScannerCallback.java |  2 +-
 .../util/descriptor/web/LocalStrings.properties|  2 +-
 .../apache/tomcat/util/descriptor/web/WebXml.java  | 21 +
 .../util/descriptor/web/TestWebXmlOrdering.java| 27 ++
 webapps/docs/changelog.xml |  6 +
 5 files changed, 52 insertions(+), 6 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java 
b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
index 8782e26b6e..9455d4763c 100644
--- a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
+++ b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
@@ -136,7 +136,7 @@ public class FragmentJarScannerCallback implements 
JarScannerCallback {
 // this name as having a duplicate so Tomcat can handle it
 // correctly when the fragments are being ordered.
 String duplicateName = fragment.getName();
-fragments.get(duplicateName).setDuplicated(true);
+fragments.get(duplicateName).addDuplicate(url.toString());
 // Rename the current fragment so it doesn't clash
 fragment.setName(url.toString());
 }
diff --git a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties 
b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
index dd57b512d3..a84bc1fbe0 100644
--- a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
@@ -32,7 +32,7 @@ webRuleSet.relativeOrderingCount= element is 
limited to 1 occurrence
 
 webXml.duplicateEnvEntry=Duplicate env-entry name [{0}]
 webXml.duplicateFilter=Duplicate filter name [{0}]
-webXml.duplicateFragment=More than one fragment with the name [{0}] was found. 
This is not legal with relative ordering. See section 8.2.2 2c of the Servlet 
specification for details. Consider using absolute ordering.
+webXml.duplicateFragment=More than one fragment with the name [{0}] was found. 
This is not legal with relative ordering. See section 8.2.2 2c of the Servlet 
specification for details. Consider using absolute ordering. Duplicate 
fragments found in [{1}].
 webXml.duplicateMessageDestination=Duplicate message-destination name [{0}]
 webXml.duplicateMessageDestinationRef=Duplicate message-destination-ref name 
[{0}]
 webXml.duplicateResourceEnvRef=Duplicate resource-env-ref name [{0}]
diff --git a/java/org/apache/tomcat/util/descriptor/web/WebXml.java 
b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
index 62b5ed7f28..f5300cf7dd 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebXml.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
@@ -84,12 +84,23 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Charse
  * to know as the action that the specification requires (see 8.2.2 1.e and
  * 2.c) varies depending on the ordering method used.
  */
-private boolean duplicated = false;
+private final List duplicates = new ArrayList<>();
 public boolean isDuplicated() {
-return duplicated;
+return !duplicates.isEmpty();
 }
+@Deprecated
 public void setDuplicated(boolean duplicated) {
-this.duplicated = duplicated;
+if (duplicated) {
+duplicates.add("unknown");
+} else {
+duplicates.clear();
+}
+}
+public void addDuplicate(String duplicate) {
+this.duplicates.add(duplicate);
+}
+public List getDuplicates() {
+return new ArrayList<>(this.duplicates);
 }
 
 /**
@@ -2264,8 +2275,10 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Charse
 // Stage 0. Check there were no fragments with duplicate names
 for (WebXml fragment : fragments.values()) {
 if (fragment.isDuplicated()) {
+List duplicates = fragment.getDuplicates();
+duplicates.add(0, fragment.getURL().toString());
 throw new IllegalArgumentException(
-sm.getString("webXml.duplicateFragment", 
fragment.getName()));
+sm.getString("webXml.duplicateFragment", 

[tomcat] branch main updated: Manually merge #535 - improve error message for duplicate fragments

2022-08-24 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 0e323eb32b Manually merge #535 - improve error message for duplicate 
fragments
0e323eb32b is described below

commit 0e323eb32b854f59ce56ee1cd8fdd88dd48f34b6
Author: Mark Thomas 
AuthorDate: Wed Aug 24 14:20:19 2022 +0100

Manually merge #535 - improve error message for duplicate fragments

Now lists the JARs that contain the duplicates. PR by Mads Rolsdorph
---
 .../descriptor/web/FragmentJarScannerCallback.java |  2 +-
 .../util/descriptor/web/LocalStrings.properties|  2 +-
 .../apache/tomcat/util/descriptor/web/WebXml.java  | 21 +
 .../util/descriptor/web/TestWebXmlOrdering.java| 27 ++
 webapps/docs/changelog.xml |  6 +
 5 files changed, 52 insertions(+), 6 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java 
b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
index 8782e26b6e..9455d4763c 100644
--- a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
+++ b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
@@ -136,7 +136,7 @@ public class FragmentJarScannerCallback implements 
JarScannerCallback {
 // this name as having a duplicate so Tomcat can handle it
 // correctly when the fragments are being ordered.
 String duplicateName = fragment.getName();
-fragments.get(duplicateName).setDuplicated(true);
+fragments.get(duplicateName).addDuplicate(url.toString());
 // Rename the current fragment so it doesn't clash
 fragment.setName(url.toString());
 }
diff --git a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties 
b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
index a48dac4448..55e40e0c12 100644
--- a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
@@ -32,7 +32,7 @@ webRuleSet.relativeOrderingCount= element is 
limited to 1 occurrence
 
 webXml.duplicateEnvEntry=Duplicate env-entry name [{0}]
 webXml.duplicateFilter=Duplicate filter name [{0}]
-webXml.duplicateFragment=More than one fragment with the name [{0}] was found. 
This is not legal with relative ordering. See section 8.2.2 2c of the Servlet 
specification for details. Consider using absolute ordering.
+webXml.duplicateFragment=More than one fragment with the name [{0}] was found. 
This is not legal with relative ordering. See section 8.2.2 2c of the Servlet 
specification for details. Consider using absolute ordering. Duplicate 
fragments found in [{1}].
 webXml.duplicateMessageDestination=Duplicate message-destination name [{0}]
 webXml.duplicateMessageDestinationRef=Duplicate message-destination-ref name 
[{0}]
 webXml.duplicateResourceEnvRef=Duplicate resource-env-ref name [{0}]
diff --git a/java/org/apache/tomcat/util/descriptor/web/WebXml.java 
b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
index 3dc6a3ed28..3eb1a0f253 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebXml.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
@@ -85,12 +85,23 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Charse
  * to know as the action that the specification requires (see 8.2.2 1.e and
  * 2.c) varies depending on the ordering method used.
  */
-private boolean duplicated = false;
+private final List duplicates = new ArrayList<>();
 public boolean isDuplicated() {
-return duplicated;
+return !duplicates.isEmpty();
 }
+@Deprecated
 public void setDuplicated(boolean duplicated) {
-this.duplicated = duplicated;
+if (duplicated) {
+duplicates.add("unknown");
+} else {
+duplicates.clear();
+}
+}
+public void addDuplicate(String duplicate) {
+this.duplicates.add(duplicate);
+}
+public List getDuplicates() {
+return new ArrayList<>(this.duplicates);
 }
 
 /**
@@ -2166,8 +2177,10 @@ public class WebXml extends XmlEncodingBase implements 
DocumentProperties.Charse
 // Stage 0. Check there were no fragments with duplicate names
 for (WebXml fragment : fragments.values()) {
 if (fragment.isDuplicated()) {
+List duplicates = fragment.getDuplicates();
+duplicates.add(0, fragment.getURL().toString());
 throw new IllegalArgumentException(
-sm.getString("webXml.duplicateFragment", 
fragment.getName()));
+sm.getString("webXml.duplicateFragment", 
frag

[Bug 66236] New: maxSavePostSize=-1 crashes ssl renegotiation

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66236

Bug ID: 66236
   Summary: maxSavePostSize=-1 crashes ssl renegotiation
   Product: Tomcat 10
   Version: 10.0.22
  Hardware: All
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Authentication
  Assignee: dev@tomcat.apache.org
  Reporter: bernd.stoltef...@lbswest.de
  Target Milestone: --

According to documentation maxSavePostSize=-1 means "disable limit".
This was working fine in previous versions.

With tomcat 10 this will trigger an exception when a ssl rehandshake is
necessary:
 java.lang.IllegalArgumentException: capacity < 0: (-1 < 0)
  at java.base/java.nio.Buffer.createCapacityException(Buffer.java:279)
  at java.base/java.nio.ByteBuffer.allocate(ByteBuffer.java:362)
  at
org.apache.coyote.http11.filters.BufferedInputFilter.setLimit(BufferedInputFilter.java:69)
  at
org.apache.coyote.http11.Http11Processor.sslReHandShake(Http11Processor.java:1285)

Reason seems to be, that line 1285 of Http11Processor allocates a buffer with
the size of maxSavePostSize without checking for the special meanings of 0 and
-1.

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



[GitHub] [tomcat] markt-asf commented on pull request #535: List duplicate locations when failing a deploy due to duplicated fragment names

2022-08-24 Thread GitBox


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

   Thanks for the PR. I like it. I'm probably being over cautious but I'd like 
to retain backwards compatibility for the existing methods on WebXml - at least 
up to 10.0.x anyway. Therefore, I'm going to apply this manually with a few 
tweaks.


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



[Bug 66235] Java Beans Standard not honoured in EL expressions when running under Graal VM (JVM Runtime Mode)

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66235

--- Comment #5 from Remy Maucherat  ---
Thanks for the additional tweaks.

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



[tomcat] branch 9.0.x updated: Additional tweaks for 66235

2022-08-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 650d3ccee1 Additional tweaks for 66235
650d3ccee1 is described below

commit 650d3ccee1d28dc4846677505c19014c82c63672
Author: remm 
AuthorDate: Wed Aug 24 14:20:05 2022 +0200

Additional tweaks for 66235
---
 java/org/apache/jasper/el/JasperELResolver.java| 23 ++
 .../org/apache/jasper/el/TestJasperELResolver.java | 10 --
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index 3289fc7b1a..4a74f6ca6c 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -236,25 +236,22 @@ public class JasperELResolver extends CompositeELResolver 
{
 }
 
 private static Method getReadMethod(Class beanClass, String prop) {
-Method result = null;
-String getter = "get" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
+String isGetter = "is" + capitalize(prop);
+String getter = "get" + capitalize(prop);
 for (Method method : methods) {
-if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
-return method;
-}
-}
-getter = "is" + capitalize(prop);
-for (Method method : methods) {
-if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
-return method;
+if (method.getParameterCount() == 0) {
+if (isGetter.equals(method.getName()) && 
method.getReturnType().equals(boolean.class)) {
+return method;
+} else if (getter.equals(method.getName())) {
+return method;
+}
 }
 }
-return result;
+return null;
 }
 
 private static Method getWriteMethod(Class beanClass, String prop, 
Class valueClass) {
-Method result = null;
 String setter = "set" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
@@ -263,7 +260,7 @@ public class JasperELResolver extends CompositeELResolver {
 return method;
 }
 }
-return result;
+return null;
 }
 
 private static String capitalize(String name) {
diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index d3d8c6c2bb..237e55d451 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -81,8 +81,9 @@ public class TestJasperELResolver {
 ELResolver resolver = new JasperELResolver.GraalBeanELResolver();
 ELContext context = new ELContextImpl(resolver);
 Assert.assertEquals("foo", resolver.getValue(context, new TestBean(), 
"foo"));
+Assert.assertEquals(Boolean.TRUE, resolver.getValue(context, new 
TestBean(), "foo2"));
 Assert.assertEquals("bla", resolver.getValue(context, new TestBean(), 
"bla"));
-Assert.assertEquals("foobar", resolver.getValue(context, new 
TestBean(), "foobar"));
+Assert.assertNull(resolver.getValue(context, new TestBean(), 
"foobar"));
 Assert.assertNull(resolver.getValue(context, new TestBean(), "bar"));
 Assert.assertFalse(resolver.isReadOnly(context, new TestBean(), 
"foo"));
 Assert.assertTrue(resolver.isReadOnly(context, new TestBean(), "bla"));
@@ -94,13 +95,18 @@ public class TestJasperELResolver {
 }
 public void setFoo(@SuppressWarnings("unused") String foo) {
 }
+public boolean isFoo2() {
+return true;
+}
+public void setFoo2(@SuppressWarnings("unused") boolean foo) {
+}
 public String getBar(@SuppressWarnings("unused") boolean i) {
 return "bar";
 }
 public String isFoobar() {
 return "foobar";
 }
-public String isBla() {
+public String getBla() {
 return "bla";
 }
 public void setBla(@SuppressWarnings("unused") Object bla) {


-
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: Additional tweaks for 66235

2022-08-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 6b7157529f Additional tweaks for 66235
6b7157529f is described below

commit 6b7157529ff787a5ce5bc3e4bcd94e708a10fe80
Author: remm 
AuthorDate: Wed Aug 24 14:20:05 2022 +0200

Additional tweaks for 66235
---
 java/org/apache/jasper/el/JasperELResolver.java| 23 ++
 .../org/apache/jasper/el/TestJasperELResolver.java | 10 --
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index 2164dada30..c38c9daf7d 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -236,25 +236,22 @@ public class JasperELResolver extends CompositeELResolver 
{
 }
 
 private static Method getReadMethod(Class beanClass, String prop) {
-Method result = null;
-String getter = "get" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
+String isGetter = "is" + capitalize(prop);
+String getter = "get" + capitalize(prop);
 for (Method method : methods) {
-if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
-return method;
-}
-}
-getter = "is" + capitalize(prop);
-for (Method method : methods) {
-if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
-return method;
+if (method.getParameterCount() == 0) {
+if (isGetter.equals(method.getName()) && 
method.getReturnType().equals(boolean.class)) {
+return method;
+} else if (getter.equals(method.getName())) {
+return method;
+}
 }
 }
-return result;
+return null;
 }
 
 private static Method getWriteMethod(Class beanClass, String prop, 
Class valueClass) {
-Method result = null;
 String setter = "set" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
@@ -263,7 +260,7 @@ public class JasperELResolver extends CompositeELResolver {
 return method;
 }
 }
-return result;
+return null;
 }
 
 private static String capitalize(String name) {
diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index 819d9045e3..644fcf5eb8 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -81,8 +81,9 @@ public class TestJasperELResolver {
 ELResolver resolver = new JasperELResolver.GraalBeanELResolver();
 ELContext context = new ELContextImpl(resolver);
 Assert.assertEquals("foo", resolver.getValue(context, new TestBean(), 
"foo"));
+Assert.assertEquals(Boolean.TRUE, resolver.getValue(context, new 
TestBean(), "foo2"));
 Assert.assertEquals("bla", resolver.getValue(context, new TestBean(), 
"bla"));
-Assert.assertEquals("foobar", resolver.getValue(context, new 
TestBean(), "foobar"));
+Assert.assertNull(resolver.getValue(context, new TestBean(), 
"foobar"));
 Assert.assertNull(resolver.getValue(context, new TestBean(), "bar"));
 Assert.assertFalse(resolver.isReadOnly(context, new TestBean(), 
"foo"));
 Assert.assertTrue(resolver.isReadOnly(context, new TestBean(), "bla"));
@@ -94,13 +95,18 @@ public class TestJasperELResolver {
 }
 public void setFoo(@SuppressWarnings("unused") String foo) {
 }
+public boolean isFoo2() {
+return true;
+}
+public void setFoo2(@SuppressWarnings("unused") boolean foo) {
+}
 public String getBar(@SuppressWarnings("unused") boolean i) {
 return "bar";
 }
 public String isFoobar() {
 return "foobar";
 }
-public String isBla() {
+public String getBla() {
 return "bla";
 }
 public void setBla(@SuppressWarnings("unused") Object bla) {


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



[tomcat] branch main updated: Additional tweaks for 66235

2022-08-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 14c0dbbc79 Additional tweaks for 66235
14c0dbbc79 is described below

commit 14c0dbbc797ab6f04dda68f4372095b789284558
Author: remm 
AuthorDate: Wed Aug 24 14:20:05 2022 +0200

Additional tweaks for 66235
---
 java/org/apache/jasper/el/JasperELResolver.java| 23 ++
 .../org/apache/jasper/el/TestJasperELResolver.java | 10 --
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index 36e4edc4d5..7b7a95c30c 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -241,25 +241,22 @@ public class JasperELResolver extends CompositeELResolver 
{
 }
 
 private static Method getReadMethod(Class beanClass, String prop) {
-Method result = null;
-String getter = "get" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
+String isGetter = "is" + capitalize(prop);
+String getter = "get" + capitalize(prop);
 for (Method method : methods) {
-if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
-return method;
-}
-}
-getter = "is" + capitalize(prop);
-for (Method method : methods) {
-if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
-return method;
+if (method.getParameterCount() == 0) {
+if (isGetter.equals(method.getName()) && 
method.getReturnType().equals(boolean.class)) {
+return method;
+} else if (getter.equals(method.getName())) {
+return method;
+}
 }
 }
-return result;
+return null;
 }
 
 private static Method getWriteMethod(Class beanClass, String prop, 
Class valueClass) {
-Method result = null;
 String setter = "set" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
@@ -268,7 +265,7 @@ public class JasperELResolver extends CompositeELResolver {
 return method;
 }
 }
-return result;
+return null;
 }
 
 private static String capitalize(String name) {
diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index 8605e62e22..e00a81a9e4 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -83,8 +83,9 @@ public class TestJasperELResolver {
 ELResolver resolver = new JasperELResolver.GraalBeanELResolver();
 ELContext context = new ELContextImpl(resolver);
 Assert.assertEquals("foo", resolver.getValue(context, new TestBean(), 
"foo"));
+Assert.assertEquals(Boolean.TRUE, resolver.getValue(context, new 
TestBean(), "foo2"));
 Assert.assertEquals("bla", resolver.getValue(context, new TestBean(), 
"bla"));
-Assert.assertEquals("foobar", resolver.getValue(context, new 
TestBean(), "foobar"));
+Assert.assertNull(resolver.getValue(context, new TestBean(), 
"foobar"));
 Assert.assertNull(resolver.getValue(context, new TestBean(), "bar"));
 Assert.assertFalse(resolver.isReadOnly(context, new TestBean(), 
"foo"));
 Assert.assertTrue(resolver.isReadOnly(context, new TestBean(), "bla"));
@@ -96,13 +97,18 @@ public class TestJasperELResolver {
 }
 public void setFoo(@SuppressWarnings("unused") String foo) {
 }
+public boolean isFoo2() {
+return true;
+}
+public void setFoo2(@SuppressWarnings("unused") boolean foo) {
+}
 public String getBar(@SuppressWarnings("unused") boolean i) {
 return "bar";
 }
 public String isFoobar() {
 return "foobar";
 }
-public String isBla() {
+public String getBla() {
 return "bla";
 }
 public void setBla(@SuppressWarnings("unused") Object bla) {


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



svn commit: r1903660 - /tomcat/site/trunk/docs/whoweare.html

2022-08-24 Thread lihan
Author: lihan
Date: Wed Aug 24 11:50:33 2022
New Revision: 1903660

URL: http://svn.apache.org/viewvc?rev=1903660&view=rev
Log:
build whoweare.html docs

Modified:
tomcat/site/trunk/docs/whoweare.html

Modified: tomcat/site/trunk/docs/whoweare.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/whoweare.html?rev=1903660&r1=1903659&r2=1903660&view=diff
==
--- tomcat/site/trunk/docs/whoweare.html (original)
+++ tomcat/site/trunk/docs/whoweare.html Wed Aug 24 11:50:33 2022
@@ -144,6 +144,9 @@ A complete list of all the Apache Commit
 Huxing Zhang (huxing at apache.org)
 
 
+Han Li (lihan at apache.org)
+
+
 Emeritus PMC members
 
 http://www.apache.org/foundation/glossary.html#Emeritus";>



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



[Bug 66235] Java Beans Standard not honoured in EL expressions when running under Graal VM (JVM Runtime Mode)

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66235

--- Comment #4 from matthias.hil...@mgm-tp.com ---
Thanks for this quick fix.
When looking at the commit I have 2 remarks. I think there are still some small
differences, that might result in different behavior:

BeanELResolver: "is" is only used for boolean or null type
GraalBeanELResolver: "is" is used for all types

BeanELResolver: if "get" and "is" exists both, "is" is preferred over "get"
GraalBeanELResolver: "get" is preferred over "is"

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



[tomcat] branch 8.5.x updated: Optimize comment

2022-08-24 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 ec43c90d92 Optimize comment
ec43c90d92 is described below

commit ec43c90d9277c14f27718a1877d2834cb7310214
Author: Poison 
AuthorDate: Thu Aug 18 14:07:26 2022 +0800

Optimize comment

HTTP2 also supports relative redirects.
---
 java/org/apache/catalina/connector/Response.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index b38667061b..67dc666fdc 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1363,7 +1363,7 @@ public class Response implements HttpServletResponse {
 // In this case, the default Tomcat values are assumed, but without
 // reference to org.apache.catalina.STRICT_SERVLET_COMPLIANCE.
 String locationUri;
-// Relative redirects require HTTP/1.1
+// Relative redirects require HTTP/1.1 or later
 if (getRequest().getCoyoteRequest().getSupportsRelativeRedirects() 
&&
 (context == null || context.getUseRelativeRedirects())) {
 locationUri = location;


-
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: Optimize comment

2022-08-24 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 6feca44d10 Optimize comment
6feca44d10 is described below

commit 6feca44d1064a1ad4f2cb868b5d4070ea4208ce3
Author: Poison 
AuthorDate: Thu Aug 18 14:07:26 2022 +0800

Optimize comment

HTTP2 also supports relative redirects.
---
 java/org/apache/catalina/connector/Response.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 6d22590cb6..7b6cfb3ff1 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1368,7 +1368,7 @@ public class Response implements HttpServletResponse {
 // In this case, the default Tomcat values are assumed, but without
 // reference to org.apache.catalina.STRICT_SERVLET_COMPLIANCE.
 String locationUri;
-// Relative redirects require HTTP/1.1
+// Relative redirects require HTTP/1.1 or later
 if (getRequest().getCoyoteRequest().getSupportsRelativeRedirects() 
&&
 (context == null || context.getUseRelativeRedirects())) {
 locationUri = location;


-
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: Optimize comment

2022-08-24 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 dec782b578 Optimize comment
dec782b578 is described below

commit dec782b578eec639fab7f5724fe296f61c53d4fb
Author: Poison 
AuthorDate: Thu Aug 18 14:07:26 2022 +0800

Optimize comment

HTTP2 also supports relative redirects.
---
 java/org/apache/catalina/connector/Response.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 4fdeb704a8..aab67a7022 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1329,7 +1329,7 @@ public class Response implements HttpServletResponse {
 // In this case, the default Tomcat values are assumed, but without
 // reference to org.apache.catalina.STRICT_SERVLET_COMPLIANCE.
 String locationUri;
-// Relative redirects require HTTP/1.1
+// Relative redirects require HTTP/1.1 or later
 if (getRequest().getCoyoteRequest().getSupportsRelativeRedirects() 
&&
 (context == null || context.getUseRelativeRedirects())) {
 locationUri = location;


-
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 #543: Optimize comment

2022-08-24 Thread GitBox


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

   Thanks. I'll back-port this to earlier Tomcat versions as well.


-- 
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: Optimize comment

2022-08-24 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 aef9666ed6 Optimize comment
aef9666ed6 is described below

commit aef9666ed608e70ff282c51aa72e53ea5664e5d2
Author: Poison 
AuthorDate: Thu Aug 18 14:07:26 2022 +0800

Optimize comment

HTTP2 also supports relative redirects.
---
 java/org/apache/catalina/connector/Response.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 57ad601602..4349c8867e 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1292,7 +1292,7 @@ public class Response implements HttpServletResponse {
 // In this case, the default Tomcat values are assumed, but without
 // reference to org.apache.catalina.STRICT_SERVLET_COMPLIANCE.
 String locationUri;
-// Relative redirects require HTTP/1.1
+// Relative redirects require HTTP/1.1 or later
 if (getRequest().getCoyoteRequest().getSupportsRelativeRedirects() 
&&
 (context == null || context.getUseRelativeRedirects())) {
 locationUri = location;


-
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 #543: Optimize comment

2022-08-24 Thread GitBox


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


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



[GitHub] [tomcat] markt-asf closed pull request #546: Bugfix for 66233 - Response error msg when the number of Cookie exceeds maxCookieCount

2022-08-24 Thread GitBox


markt-asf closed pull request #546: Bugfix for 66233 - Response error msg when 
the number of Cookie exceeds maxCookieCount
URL: https://github.com/apache/tomcat/pull/546


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



[GitHub] [tomcat] markt-asf commented on pull request #546: Bugfix for 66233 - Response error msg when the number of Cookie exceeds maxCookieCount

2022-08-24 Thread GitBox


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

   Sorry - didn't see this PR. I've just applied the same fix.


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



[Bug 66233] when set maxCookieCount 1, request has 5 cookies, the response message is "null"

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66233

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #2 from Mark Thomas  ---
Fixed in:
- 10.1.x for 10.1.0-M18 onwards
- 10.0.x for 10.0.24 onwards
-  9.0.x for  9.0.66 onwards
-  8.5.x for  8.5.83 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



[tomcat] branch 8.5.x updated: Fix 66233 - include error message with 400 response for too many cookies

2022-08-24 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 d50929c327 Fix 66233 - include error message with 400 response for too 
many cookies
d50929c327 is described below

commit d50929c3275fffb1f82b38d6bd782630b5eb2cb7
Author: Mark Thomas 
AuthorDate: Wed Aug 24 11:50:06 2022 +0100

Fix 66233 - include error message with 400 response for too many cookies

https://bz.apache.org/bugzilla/show_bug.cgi?id=66233
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 2 +-
 webapps/docs/changelog.xml| 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 3c02626c20..ed5d5fc31d 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -756,7 +756,7 @@ public class CoyoteAdapter implements Adapter {
 // Too many cookies
 if (!response.isError()) {
 response.setError();
-response.sendError(400);
+response.sendError(400, e.getMessage());
 }
 return true;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f956088b6a..a7feba22fb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -127,6 +127,10 @@
 session persistence and restoration occurs during the authentication
 process. (markt)
   
+  
+66233: Include an error message when sending a 400 response
+because a request has too many cookies. (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 66233 - include error message with 400 response for too many cookies

2022-08-24 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 0461717fc0 Fix 66233 - include error message with 400 response for too 
many cookies
0461717fc0 is described below

commit 0461717fc03c176e6da7b947b75c6ded7b879e1b
Author: Mark Thomas 
AuthorDate: Wed Aug 24 11:50:06 2022 +0100

Fix 66233 - include error message with 400 response for too many cookies

https://bz.apache.org/bugzilla/show_bug.cgi?id=66233
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 2 +-
 webapps/docs/changelog.xml| 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index aed20f3a93..f9263b685d 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -752,7 +752,7 @@ public class CoyoteAdapter implements Adapter {
 // Too many cookies
 if (!response.isError()) {
 response.setError();
-response.sendError(400);
+response.sendError(400, e.getMessage());
 }
 return true;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c8a5a7b38f..9779e91b40 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -148,6 +148,10 @@
 session persistence and restoration occurs during the authentication
 process. (markt)
   
+  
+66233: Include an error message when sending a 400 response
+because a request has too many cookies. (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: Fix 66233 - include error message with 400 response for too many cookies

2022-08-24 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 5c7a6dfac2 Fix 66233 - include error message with 400 response for too 
many cookies
5c7a6dfac2 is described below

commit 5c7a6dfac2a055a57fdf4eac5cd13946f8d5fda4
Author: Mark Thomas 
AuthorDate: Wed Aug 24 11:50:06 2022 +0100

Fix 66233 - include error message with 400 response for too many cookies

https://bz.apache.org/bugzilla/show_bug.cgi?id=66233
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 2 +-
 webapps/docs/changelog.xml| 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 200a2adb3b..9cbb9783e8 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -744,7 +744,7 @@ public class CoyoteAdapter implements Adapter {
 // Too many cookies
 if (!response.isError()) {
 response.setError();
-response.sendError(400);
+response.sendError(400, e.getMessage());
 }
 return true;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b942d8be66..9e29c91699 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -148,6 +148,10 @@
 session persistence and restoration occurs during the authentication
 process. (markt)
   
+  
+66233: Include an error message when sending a 400 response
+because a request has too many cookies. (markt)
+  
 
   
   


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



[tomcat] branch main updated: Fix 66233 - include error message with 400 response for too many cookies

2022-08-24 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 4f9dc7f4a0 Fix 66233 - include error message with 400 response for too 
many cookies
4f9dc7f4a0 is described below

commit 4f9dc7f4a0959d8aab7b8f5c04e17a7f039b3ba2
Author: Mark Thomas 
AuthorDate: Wed Aug 24 11:50:06 2022 +0100

Fix 66233 - include error message with 400 response for too many cookies

https://bz.apache.org/bugzilla/show_bug.cgi?id=66233
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 2 +-
 webapps/docs/changelog.xml| 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 5b5660159f..79cff350f0 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -753,7 +753,7 @@ public class CoyoteAdapter implements Adapter {
 // Too many cookies
 if (!response.isError()) {
 response.setError();
-response.sendError(400);
+response.sendError(400, e.getMessage());
 }
 return true;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6e42cb88b7..a9362be59f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -148,6 +148,10 @@
 session persistence and restoration occurs during the authentication
 process. (markt)
   
+  
+66233: Include an error message when sending a 400 response
+because a request has too many cookies. (markt)
+  
 
   
   


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



svn commit: r1903658 - /tomcat/site/trunk/xdocs/whoweare.xml

2022-08-24 Thread lihan
Author: lihan
Date: Wed Aug 24 10:25:26 2022
New Revision: 1903658

URL: http://svn.apache.org/viewvc?rev=1903658&view=rev
Log:
add new committer - Han Li

Modified:
tomcat/site/trunk/xdocs/whoweare.xml

Modified: tomcat/site/trunk/xdocs/whoweare.xml
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/whoweare.xml?rev=1903658&r1=1903657&r2=1903658&view=diff
==
--- tomcat/site/trunk/xdocs/whoweare.xml (original)
+++ tomcat/site/trunk/xdocs/whoweare.xml Wed Aug 24 10:25:26 2022
@@ -154,6 +154,9 @@ A complete list of all the Apache Commit
 Huxing Zhang (huxing at apache.org)
 
 
+Han Li (lihan at apache.org)
+
+
 
 
 



-
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: Silence IDE warnings

2022-08-24 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 c617e92c01 Silence IDE warnings
c617e92c01 is described below

commit c617e92c01cf591315a7a99d2b60e061f43d1548
Author: Mark Thomas 
AuthorDate: Wed Aug 24 10:42:54 2022 +0100

Silence IDE warnings
---
 test/org/apache/jasper/el/TestJasperELResolver.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index 318988b24a..d3d8c6c2bb 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -92,9 +92,9 @@ public class TestJasperELResolver {
 public String getFoo() {
 return "foo";
 }
-public void setFoo(String foo) {
+public void setFoo(@SuppressWarnings("unused") String foo) {
 }
-public String getBar(boolean i) {
+public String getBar(@SuppressWarnings("unused") boolean i) {
 return "bar";
 }
 public String isFoobar() {
@@ -103,7 +103,7 @@ public class TestJasperELResolver {
 public String isBla() {
 return "bla";
 }
-public void setBla(Object bla) {
+public void setBla(@SuppressWarnings("unused") Object bla) {
 }
 }
 }


-
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: Silence IDE warnings

2022-08-24 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 082c8d2bf2 Silence IDE warnings
082c8d2bf2 is described below

commit 082c8d2bf21a1562f17efb9f4eda2201f432bacc
Author: Mark Thomas 
AuthorDate: Wed Aug 24 10:42:54 2022 +0100

Silence IDE warnings
---
 test/org/apache/jasper/el/TestJasperELResolver.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index ab1d4edb32..819d9045e3 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -92,9 +92,9 @@ public class TestJasperELResolver {
 public String getFoo() {
 return "foo";
 }
-public void setFoo(String foo) {
+public void setFoo(@SuppressWarnings("unused") String foo) {
 }
-public String getBar(boolean i) {
+public String getBar(@SuppressWarnings("unused") boolean i) {
 return "bar";
 }
 public String isFoobar() {
@@ -103,7 +103,7 @@ public class TestJasperELResolver {
 public String isBla() {
 return "bla";
 }
-public void setBla(Object bla) {
+public void setBla(@SuppressWarnings("unused") Object bla) {
 }
 }
 }


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



[tomcat] branch main updated: Silence IDE warnings

2022-08-24 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 141c4b9dab Silence IDE warnings
141c4b9dab is described below

commit 141c4b9dabf87c3add2363b7e9f3c24a8f6842cd
Author: Mark Thomas 
AuthorDate: Wed Aug 24 10:42:54 2022 +0100

Silence IDE warnings
---
 test/org/apache/jasper/el/TestJasperELResolver.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index 2d0859a02c..8605e62e22 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -94,9 +94,9 @@ public class TestJasperELResolver {
 public String getFoo() {
 return "foo";
 }
-public void setFoo(String foo) {
+public void setFoo(@SuppressWarnings("unused") String foo) {
 }
-public String getBar(boolean i) {
+public String getBar(@SuppressWarnings("unused") boolean i) {
 return "bar";
 }
 public String isFoobar() {
@@ -105,7 +105,7 @@ public class TestJasperELResolver {
 public String isBla() {
 return "bla";
 }
-public void setBla(Object bla) {
+public void setBla(@SuppressWarnings("unused") Object bla) {
 }
 }
 }


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



[Bug 66209] CPU regression when classpath Bloom filters are active

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66209

--- Comment #10 from Mark Thomas  ---
Thanks for the offer of a patch. Please go ahead.

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



[Bug 66235] Java Beans Standard not honoured in EL expressions when running under Graal VM (JVM Runtime Mode)

2022-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66235

Remy Maucherat  changed:

   What|Removed |Added

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

--- Comment #3 from Remy Maucherat  ---
I added fixes to GraalBeanELResolver and added tests. This will be in 10.1-M18,
10.0.24. 9.0.66.

-- 
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: [DISCUSS] MessageBytes refactoring

2022-08-24 Thread Han Li


> 2022年8月24日 16:16,Mark Thomas  写道:
> 
> On 24/08/2022 09:08, Rémy Maucherat wrote:
>> On Tue, Aug 23, 2022 at 10:43 PM Mark Thomas  wrote:
>>> 
>>> Hi all,
>>> 
>>> I've been looking at a fix for bug 66196. My ideas so far have revolved
>>> around MessageBytes but the solutions are being made more complex by the
>>> current behaviour of MessageBytes in some cases.
>>> 
>>> For example (I'm using strings in place of byte[] and char[] to keep it
>>> simple):
>>> 
>>> mb.setBytes("aaa");
>>> mb.setChars("bbb");
>>> mb.toBytes();
>>> 
>>> mb.getByteChunk() returns "aaa" whereas I'd expect it to be "bbb".
>>> 
>>> I'd like to refactor MessageBytes so it always behaves as if it has a
>>> single current value regardless of whether that value was set as a
>>> String, byte[] or char[]. If a get() method is called for a different
>>> type, conversion occurs on demand.
>>> 
>>> I'm reasonably confident that changing MessageBytes to always have a
>>> single, consistent value will also enable a few useful optimizations -
>>> particularly around ISO-8859-1 String to byte conversions which gets
>>> used a lot for HTTP response headers.
>>> 
>>> Note: As currently, if you write to the ByteChunk or CharChunk directly
>>> the caller is expected to take responsibility for keeping the values in
>>> sync or dealing with the consequences.
>>> 
>>> Thoughts?
>> Well, this is a bit risky obviously but you can attempt it.
> 
> Fair point.
> 
> On my first pass I found that the RewriteValve was accessing the internals 
> directly. That case looked to be manageable. I agree the risk is that this is 
> happening in other places that don't get spotted.
> 
> One option would be to refactor 10.1.x but delay the back-port to see if any 
> regressions emerge.

Are there any sub-tasks I can do? I would be happy to help!

Han

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


Re: [DISCUSS] MessageBytes refactoring

2022-08-24 Thread Mark Thomas

On 24/08/2022 09:08, Rémy Maucherat wrote:

On Tue, Aug 23, 2022 at 10:43 PM Mark Thomas  wrote:


Hi all,

I've been looking at a fix for bug 66196. My ideas so far have revolved
around MessageBytes but the solutions are being made more complex by the
current behaviour of MessageBytes in some cases.

For example (I'm using strings in place of byte[] and char[] to keep it
simple):

mb.setBytes("aaa");
mb.setChars("bbb");
mb.toBytes();

mb.getByteChunk() returns "aaa" whereas I'd expect it to be "bbb".

I'd like to refactor MessageBytes so it always behaves as if it has a
single current value regardless of whether that value was set as a
String, byte[] or char[]. If a get() method is called for a different
type, conversion occurs on demand.

I'm reasonably confident that changing MessageBytes to always have a
single, consistent value will also enable a few useful optimizations -
particularly around ISO-8859-1 String to byte conversions which gets
used a lot for HTTP response headers.

Note: As currently, if you write to the ByteChunk or CharChunk directly
the caller is expected to take responsibility for keeping the values in
sync or dealing with the consequences.

Thoughts?


Well, this is a bit risky obviously but you can attempt it.


Fair point.

On my first pass I found that the RewriteValve was accessing the 
internals directly. That case looked to be manageable. I agree the risk 
is that this is happening in other places that don't get spotted.


One option would be to refactor 10.1.x but delay the back-port to see if 
any regressions emerge.


Mark

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



Re: [DISCUSS] MessageBytes refactoring

2022-08-24 Thread Rémy Maucherat
On Tue, Aug 23, 2022 at 10:43 PM Mark Thomas  wrote:
>
> Hi all,
>
> I've been looking at a fix for bug 66196. My ideas so far have revolved
> around MessageBytes but the solutions are being made more complex by the
> current behaviour of MessageBytes in some cases.
>
> For example (I'm using strings in place of byte[] and char[] to keep it
> simple):
>
> mb.setBytes("aaa");
> mb.setChars("bbb");
> mb.toBytes();
>
> mb.getByteChunk() returns "aaa" whereas I'd expect it to be "bbb".
>
> I'd like to refactor MessageBytes so it always behaves as if it has a
> single current value regardless of whether that value was set as a
> String, byte[] or char[]. If a get() method is called for a different
> type, conversion occurs on demand.
>
> I'm reasonably confident that changing MessageBytes to always have a
> single, consistent value will also enable a few useful optimizations -
> particularly around ISO-8859-1 String to byte conversions which gets
> used a lot for HTTP response headers.
>
> Note: As currently, if you write to the ByteChunk or CharChunk directly
> the caller is expected to take responsibility for keeping the values in
> sync or dealing with the consequences.
>
> Thoughts?

Well, this is a bit risky obviously but you can attempt it.

Rémy

> Mark
>
>
> [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=66196
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

-
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 various issues with the bean resolver used for Graal

2022-08-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new ce2ba5edab Fix various issues with the bean resolver used for Graal
ce2ba5edab is described below

commit ce2ba5edab9dc7f0e81f1e25f8c27a08a0d634e2
Author: remm 
AuthorDate: Wed Aug 24 09:58:32 2022 +0200

Fix various issues with the bean resolver used for Graal
---
 java/org/apache/jasper/el/JasperELResolver.java| 27 +++---
 .../org/apache/jasper/el/TestJasperELResolver.java | 32 ++
 webapps/docs/changelog.xml |  4 +++
 3 files changed, 53 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index 89268ad612..3289fc7b1a 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -188,7 +188,7 @@ public class JasperELResolver extends CompositeELResolver {
  * Extend ELResolver for Graal to avoid bean info use if possible,
  * as BeanELResolver needs manual reflection configuration.
  */
-private static class GraalBeanELResolver extends ELResolver {
+public static class GraalBeanELResolver extends ELResolver {
 
 @Override
 public Object getValue(ELContext context, Object base,
@@ -214,7 +214,7 @@ public class JasperELResolver extends CompositeELResolver {
 if (base == null) {
 return;
 }
-Method method = getWriteMethod(base.getClass(), 
property.toString());
+Method method = getWriteMethod(base.getClass(), 
property.toString(), value.getClass());
 if (method != null) {
 context.setPropertyResolved(base, property);
 try {
@@ -231,35 +231,42 @@ public class JasperELResolver extends CompositeELResolver 
{
 Object property) {
 Class beanClass = base.getClass();
 String prop = property.toString();
-return (getReadMethod(beanClass, prop) != null)
-&& (getWriteMethod(beanClass, prop) != null);
+Method readMethod = getReadMethod(beanClass, prop);
+return readMethod == null || !(getWriteMethod(beanClass, prop, 
readMethod.getReturnType()) != null);
 }
 
-public static Method getReadMethod(Class beanClass, String prop) {
+private static Method getReadMethod(Class beanClass, String prop) {
 Method result = null;
-String setter = "get" + capitalize(prop);
+String getter = "get" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
-if (setter.equals(method.getName())) {
+if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
+return method;
+}
+}
+getter = "is" + capitalize(prop);
+for (Method method : methods) {
+if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
 return method;
 }
 }
 return result;
 }
 
-public static Method getWriteMethod(Class beanClass, String prop) {
+private static Method getWriteMethod(Class beanClass, String prop, 
Class valueClass) {
 Method result = null;
 String setter = "set" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
-if (setter.equals(method.getName())) {
+if (method.getParameterCount() == 1 && 
setter.equals(method.getName())
+&& (valueClass == null || 
valueClass.isAssignableFrom(method.getParameterTypes()[0]))) {
 return method;
 }
 }
 return result;
 }
 
-public static String capitalize(String name) {
+private static String capitalize(String name) {
 if (name == null || name.length() == 0) {
 return name;
 }
diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index f2eef62e4f..318988b24a 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import javax.el.ELContext;
 import javax.el.ELResolver;
 import javax.servlet.jsp.el.ImplicitObjectELResolver;
 
@@ -74,4 +75,35 @@ public class TestJasperELResolver {
 field.setAccessible(true);
 return field.get(target);
 }
+
+@Test
+

[tomcat] branch 10.0.x updated: Fix various issues with the bean resolver used for Graal

2022-08-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 1394276a4b Fix various issues with the bean resolver used for Graal
1394276a4b is described below

commit 1394276a4b343993d2e54513499fed5420bdbfcd
Author: remm 
AuthorDate: Wed Aug 24 09:58:32 2022 +0200

Fix various issues with the bean resolver used for Graal
---
 java/org/apache/jasper/el/JasperELResolver.java| 27 +++---
 .../org/apache/jasper/el/TestJasperELResolver.java | 32 ++
 webapps/docs/changelog.xml |  4 +++
 3 files changed, 53 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index 7c02cea430..2164dada30 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -188,7 +188,7 @@ public class JasperELResolver extends CompositeELResolver {
  * Extend ELResolver for Graal to avoid bean info use if possible,
  * as BeanELResolver needs manual reflection configuration.
  */
-private static class GraalBeanELResolver extends ELResolver {
+public static class GraalBeanELResolver extends ELResolver {
 
 @Override
 public Object getValue(ELContext context, Object base,
@@ -214,7 +214,7 @@ public class JasperELResolver extends CompositeELResolver {
 if (base == null) {
 return;
 }
-Method method = getWriteMethod(base.getClass(), 
property.toString());
+Method method = getWriteMethod(base.getClass(), 
property.toString(), value.getClass());
 if (method != null) {
 context.setPropertyResolved(base, property);
 try {
@@ -231,35 +231,42 @@ public class JasperELResolver extends CompositeELResolver 
{
 Object property) {
 Class beanClass = base.getClass();
 String prop = property.toString();
-return (getReadMethod(beanClass, prop) != null)
-&& (getWriteMethod(beanClass, prop) != null);
+Method readMethod = getReadMethod(beanClass, prop);
+return readMethod == null || !(getWriteMethod(beanClass, prop, 
readMethod.getReturnType()) != null);
 }
 
-public static Method getReadMethod(Class beanClass, String prop) {
+private static Method getReadMethod(Class beanClass, String prop) {
 Method result = null;
-String setter = "get" + capitalize(prop);
+String getter = "get" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
-if (setter.equals(method.getName())) {
+if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
+return method;
+}
+}
+getter = "is" + capitalize(prop);
+for (Method method : methods) {
+if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
 return method;
 }
 }
 return result;
 }
 
-public static Method getWriteMethod(Class beanClass, String prop) {
+private static Method getWriteMethod(Class beanClass, String prop, 
Class valueClass) {
 Method result = null;
 String setter = "set" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
-if (setter.equals(method.getName())) {
+if (method.getParameterCount() == 1 && 
setter.equals(method.getName())
+&& (valueClass == null || 
valueClass.isAssignableFrom(method.getParameterTypes()[0]))) {
 return method;
 }
 }
 return result;
 }
 
-public static String capitalize(String name) {
+private static String capitalize(String name) {
 if (name == null || name.length() == 0) {
 return name;
 }
diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index d58391ebfe..ab1d4edb32 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import jakarta.el.ELContext;
 import jakarta.el.ELResolver;
 import jakarta.servlet.jsp.el.ImplicitObjectELResolver;
 
@@ -74,4 +75,35 @@ public class TestJasperELResolver {
 field.setAccessible(true);
 return field.get(target);
 }
+
+   

[tomcat] branch main updated: Fix various issues with the bean resolver used for Graal

2022-08-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 93594a5136 Fix various issues with the bean resolver used for Graal
93594a5136 is described below

commit 93594a5136c54c24dffeaf96815f5a322ee6a87b
Author: remm 
AuthorDate: Wed Aug 24 09:58:32 2022 +0200

Fix various issues with the bean resolver used for Graal
---
 java/org/apache/jasper/el/JasperELResolver.java| 27 +++---
 .../org/apache/jasper/el/TestJasperELResolver.java | 32 ++
 webapps/docs/changelog.xml |  4 +++
 3 files changed, 53 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index a2e4e124ec..36e4edc4d5 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -193,7 +193,7 @@ public class JasperELResolver extends CompositeELResolver {
  * Extend ELResolver for Graal to avoid bean info use if possible,
  * as BeanELResolver needs manual reflection configuration.
  */
-private static class GraalBeanELResolver extends ELResolver {
+public static class GraalBeanELResolver extends ELResolver {
 
 @Override
 public Object getValue(ELContext context, Object base,
@@ -219,7 +219,7 @@ public class JasperELResolver extends CompositeELResolver {
 if (base == null) {
 return;
 }
-Method method = getWriteMethod(base.getClass(), 
property.toString());
+Method method = getWriteMethod(base.getClass(), 
property.toString(), value.getClass());
 if (method != null) {
 context.setPropertyResolved(base, property);
 try {
@@ -236,35 +236,42 @@ public class JasperELResolver extends CompositeELResolver 
{
 Object property) {
 Class beanClass = base.getClass();
 String prop = property.toString();
-return (getReadMethod(beanClass, prop) != null)
-&& (getWriteMethod(beanClass, prop) != null);
+Method readMethod = getReadMethod(beanClass, prop);
+return readMethod == null || !(getWriteMethod(beanClass, prop, 
readMethod.getReturnType()) != null);
 }
 
-public static Method getReadMethod(Class beanClass, String prop) {
+private static Method getReadMethod(Class beanClass, String prop) {
 Method result = null;
-String setter = "get" + capitalize(prop);
+String getter = "get" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
-if (setter.equals(method.getName())) {
+if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
+return method;
+}
+}
+getter = "is" + capitalize(prop);
+for (Method method : methods) {
+if (method.getParameterCount() == 0 && 
getter.equals(method.getName())) {
 return method;
 }
 }
 return result;
 }
 
-public static Method getWriteMethod(Class beanClass, String prop) {
+private static Method getWriteMethod(Class beanClass, String prop, 
Class valueClass) {
 Method result = null;
 String setter = "set" + capitalize(prop);
 Method methods[] = beanClass.getMethods();
 for (Method method : methods) {
-if (setter.equals(method.getName())) {
+if (method.getParameterCount() == 1 && 
setter.equals(method.getName())
+&& (valueClass == null || 
valueClass.isAssignableFrom(method.getParameterTypes()[0]))) {
 return method;
 }
 }
 return result;
 }
 
-public static String capitalize(String name) {
+private static String capitalize(String name) {
 if (name == null || name.length() == 0) {
 return name;
 }
diff --git a/test/org/apache/jasper/el/TestJasperELResolver.java 
b/test/org/apache/jasper/el/TestJasperELResolver.java
index 31f9f4804e..2d0859a02c 100644
--- a/test/org/apache/jasper/el/TestJasperELResolver.java
+++ b/test/org/apache/jasper/el/TestJasperELResolver.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import jakarta.el.ELContext;
 import jakarta.el.ELResolver;
 import jakarta.servlet.jsp.el.ImplicitObjectELResolver;
 
@@ -76,4 +77,35 @@ public class TestJasperELResolver {
 field.setAccessible(true);
 return field.get(target);
 }
+
+@Te