[tomcat] branch main updated: Use filtersets for IDE config libs and versioning

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

lihan 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 bc8a3870c5 Use filtersets for IDE config libs and versioning
bc8a3870c5 is described below

commit bc8a3870c5c4b0f9b1fc0a220b9c391986d43783
Author: Bailey Brownie 
AuthorDate: Mon Feb 6 21:39:39 2023 -0500

Use filtersets for IDE config libs and versioning
---
 build.xml  | 35 +-
 res/ide-support/eclipse/eclipse.classpath  | 20 ++---
 .../eclipse/org.eclipse.jdt.core.prefs.properties  |  6 ++--
 res/ide-support/idea/misc.xml  |  2 +-
 res/ide-support/idea/tomcat.iml| 20 ++---
 .../netbeans/nb-tomcat-build.properties|  2 +-
 res/ide-support/netbeans/nb-tomcat.xml |  2 +-
 res/ide-support/netbeans/project.xml   | 16 +-
 webapps/docs/building.xml  | 13 
 9 files changed, 61 insertions(+), 55 deletions(-)

diff --git a/build.xml b/build.xml
index aba58136b3..fb67c70d7c 100644
--- a/build.xml
+++ b/build.xml
@@ -244,6 +244,20 @@
 
   
 
+  
+  
+
+
+
+
+
+
+
+
+
+
+  
+
   
   
 
@@ -3759,11 +3773,16 @@ asf.ldap.username=${release.asfusername}
 
 
 
-
+
+  
+  
+
 
 
-
-
+
+
+  
+
 
 Eclipse project files created.
 Read the Building page on the Apache Tomcat documentation site for details on 
how to configure your Eclipse workspace.
@@ -3777,13 +3796,11 @@ Read the Building page on the Apache Tomcat 
documentation site for details on ho
 
 
   
+  
+  
 
 
-IntelliJ IDEA project directory created. Please create PATH 
VARIABLES for
-
-  ANT_HOME  = ${ant.home}
-  TOMCAT_BUILD_LIBS = ${base.path}
-
+IntelliJ IDEA project directory created.
   
 
   
@@ -3819,6 +3836,8 @@ Use the "ide-netbeans-replace" target if you wish to 
overwrite them.
 
 
   
+  
+  
 
 NetBeans project files created.
 Read the Building page on the Apache Tomcat documentation site for details on 
how to customise your NetBeans project.
diff --git a/res/ide-support/eclipse/eclipse.classpath 
b/res/ide-support/eclipse/eclipse.classpath
index 5c1bcdd282..a98e9c610a 100644
--- a/res/ide-support/eclipse/eclipse.classpath
+++ b/res/ide-support/eclipse/eclipse.classpath
@@ -19,16 +19,16 @@
 
 
 
-
+
 
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
 
 
diff --git a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties 
b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
index c7fcfab4bb..0e28ec4353 100644
--- a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
+++ b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
@@ -15,6 +15,6 @@
 # limitations under the License.
 # -
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=@BUILD_JAVA_VERSION@
+org.eclipse.jdt.core.compiler.compliance=@MIN_JAVA_VERSION@
+org.eclipse.jdt.core.compiler.source=@BUILD_JAVA_VERSION@
diff --git a/res/ide-support/idea/misc.xml b/res/ide-support/idea/misc.xml
index 2f3538ae29..0f6a7a25c6 100644
--- a/res/ide-support/idea/misc.xml
+++ b/res/ide-support/idea/misc.xml
@@ -16,7 +16,7 @@
   limitations under the License.
 -->
 
-  
+  
 
   
 
\ No newline at end of file
diff --git a/res/ide-support/idea/tomcat.iml b/res/ide-support/idea/tomcat.iml
index 07b6c5a32b..08e6c05f7a 100644
--- a/res/ide-support/idea/tomcat.iml
+++ b/res/ide-support/idea/tomcat.iml
@@ -30,7 +30,7 @@
 
   
 
-  
+  
 
 
 
@@ -41,7 +41,7 @@
 
   
 
-
+
 
 
 
@@ -50,7 +50,7 @@
 
   
 
-  
+  
 
 
 
@@ -59,7 +59,7 @@
 
   
 
-  
+  
 
 
 
@@ -68,7 +68,7 @@
 
   
 
-  
+  
 
 
 
@@ -77,7 +77,7 @@
 
   
 
-  
+  
 
 
 
@@ -86,7 +86,7 @@
 
   
 
-  
+  
 
 
 
@@ -95,7 +95,7 @@
 
   
 
-  
+  
 
 
 
@@ -104,7 +104,7 @@
 
   
 
-  
+  
 
 
 
@@ 

[tomcat] branch 10.1.x updated: Update objenesis and unboundid versions for IDE configs. Submitted by Bailey Brownie

2023-02-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 760961a1a7 Update objenesis and unboundid versions for IDE configs. 
Submitted by Bailey Brownie
760961a1a7 is described below

commit 760961a1a772417307714b447a17a0cfad912a36
Author: Bailey Brownie 
AuthorDate: Mon Feb 6 21:39:39 2023 -0500

Update objenesis and unboundid versions for IDE configs.
Submitted by Bailey Brownie
---
 build.xml  | 37 +-
 res/ide-support/eclipse/eclipse.classpath  | 24 +++---
 .../eclipse/org.eclipse.jdt.core.prefs.properties  |  6 ++--
 res/ide-support/idea/misc.xml  |  2 +-
 res/ide-support/idea/tomcat.iml| 24 +++---
 .../netbeans/nb-tomcat-build.properties|  2 +-
 res/ide-support/netbeans/nb-tomcat.xml |  2 +-
 res/ide-support/netbeans/project.xml   | 16 +-
 webapps/docs/building.xml  | 13 
 9 files changed, 67 insertions(+), 59 deletions(-)

diff --git a/build.xml b/build.xml
index 61a9f86c09..8051b42a85 100644
--- a/build.xml
+++ b/build.xml
@@ -246,6 +246,22 @@
 
   
 
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
   
   
 
@@ -3793,11 +3809,16 @@ asf.ldap.username=${release.asfusername}
 
 
 
-
+
+  
+  
+
 
 
-
-
+
+
+  
+
 
 Eclipse project files created.
 Read the Building page on the Apache Tomcat documentation site for details on 
how to configure your Eclipse workspace.
@@ -3811,13 +3832,11 @@ Read the Building page on the Apache Tomcat 
documentation site for details on ho
 
 
   
+  
+  
 
 
-IntelliJ IDEA project directory created. Please create PATH 
VARIABLES for
-
-  ANT_HOME  = ${ant.home}
-  TOMCAT_BUILD_LIBS = ${base.path}
-
+IntelliJ IDEA project directory created.
   
 
   
@@ -3853,6 +3872,8 @@ Use the "ide-netbeans-replace" target if you wish to 
overwrite them.
 
 
   
+  
+  
 
 NetBeans project files created.
 Read the Building page on the Apache Tomcat documentation site for details on 
how to customise your NetBeans project.
diff --git a/res/ide-support/eclipse/eclipse.classpath 
b/res/ide-support/eclipse/eclipse.classpath
index 850b7e1acf..fcad3f3747 100644
--- a/res/ide-support/eclipse/eclipse.classpath
+++ b/res/ide-support/eclipse/eclipse.classpath
@@ -19,18 +19,18 @@
 
 
 
-
+
 
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
 
 
diff --git a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties 
b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
index c7fcfab4bb..0e28ec4353 100644
--- a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
+++ b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
@@ -15,6 +15,6 @@
 # limitations under the License.
 # -
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=@BUILD_JAVA_VERSION@
+org.eclipse.jdt.core.compiler.compliance=@MIN_JAVA_VERSION@
+org.eclipse.jdt.core.compiler.source=@BUILD_JAVA_VERSION@
diff --git a/res/ide-support/idea/misc.xml b/res/ide-support/idea/misc.xml
index 2f3538ae29..0f6a7a25c6 100644
--- a/res/ide-support/idea/misc.xml
+++ b/res/ide-support/idea/misc.xml
@@ -16,7 +16,7 @@
   limitations under the License.
 -->
 
-  
+  
 
   
 
\ No newline at end of file
diff --git a/res/ide-support/idea/tomcat.iml b/res/ide-support/idea/tomcat.iml
index eace46183a..13e7a12569 100644
--- a/res/ide-support/idea/tomcat.iml
+++ b/res/ide-support/idea/tomcat.iml
@@ -30,7 +30,7 @@
 
   
 
-  
+  
 
 
 
@@ -41,7 +41,7 @@
 
   
 
-
+
 
 
 
@@ -50,7 +50,7 @@
 
   
 
-  
+  
 
 
 
@@ -59,7 +59,7 @@
 
   
 
-  
+  
 
 
 
@@ -68,7 +68,7 @@
 
   
 
-  
+  
 
 
 
@@ -77,7 +77,7 @@
 
   
 
-  
+  
 
 
 
@@ -86,7 +86,7 @@
 
   
 
-  
+  
 
 
 
@@ -95,7 +95,7 @@
 
   
 
-  
+  
 
 
 
@@ 

[tomcat] branch 9.0.x updated: Update objenesis and unboundid versions for IDE configs. Submitted by Bailey Brownie

2023-02-09 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 74719c4ec3 Update objenesis and unboundid versions for IDE configs. 
Submitted by Bailey Brownie
74719c4ec3 is described below

commit 74719c4ec36b36859b3d2050156ee4dbad55c959
Author: Bailey Brownie 
AuthorDate: Tue Feb 7 10:39:39 2023 +0800

Update objenesis and unboundid versions for IDE configs.
Submitted by Bailey Brownie
---
 build.xml  | 37 +-
 res/ide-support/eclipse/eclipse.classpath  | 23 +++---
 .../eclipse/org.eclipse.jdt.core.prefs.properties  |  6 ++--
 res/ide-support/idea/misc.xml  |  2 +-
 res/ide-support/idea/tomcat.iml| 31 +++---
 .../netbeans/nb-tomcat-build.properties|  2 +-
 res/ide-support/netbeans/nb-tomcat.xml |  2 +-
 res/ide-support/netbeans/project.xml   | 14 
 webapps/docs/building.xml  | 13 
 9 files changed, 74 insertions(+), 56 deletions(-)

diff --git a/build.xml b/build.xml
index 3d7d43d2d1..b889f55cdd 100644
--- a/build.xml
+++ b/build.xml
@@ -242,6 +242,22 @@
 
   
 
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
   
   
 
@@ -3718,11 +3734,16 @@ asf.ldap.username=${release.asfusername}
 
 
 
-
+
+  
+  
+
 
 
-
-
+
+
+  
+
 
 Eclipse project files created.
 Read the Building page on the Apache Tomcat documentation site for details on 
how to configure your Eclipse workspace.
@@ -3736,13 +3757,11 @@ Read the Building page on the Apache Tomcat 
documentation site for details on ho
 
 
   
+  
+  
 
 
-IntelliJ IDEA project directory created. Please create PATH 
VARIABLES for
-
-  ANT_HOME  = ${ant.home}
-  TOMCAT_BUILD_LIBS = ${base.path}
-
+IntelliJ IDEA project directory created.
   
 
   
@@ -3778,6 +3797,8 @@ Use the "ide-netbeans-replace" target if you wish to 
overwrite them.
 
 
   
+  
+  
 
 NetBeans project files created.
 Read the Building page on the Apache Tomcat documentation site for details on 
how to customise your NetBeans project.
diff --git a/res/ide-support/eclipse/eclipse.classpath 
b/res/ide-support/eclipse/eclipse.classpath
index 1384731b20..fcad3f3747 100644
--- a/res/ide-support/eclipse/eclipse.classpath
+++ b/res/ide-support/eclipse/eclipse.classpath
@@ -19,17 +19,18 @@
 
 
 
-
+
 
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
 
 
diff --git a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties 
b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
index c7fcfab4bb..0e28ec4353 100644
--- a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
+++ b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
@@ -15,6 +15,6 @@
 # limitations under the License.
 # -
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=@BUILD_JAVA_VERSION@
+org.eclipse.jdt.core.compiler.compliance=@MIN_JAVA_VERSION@
+org.eclipse.jdt.core.compiler.source=@BUILD_JAVA_VERSION@
diff --git a/res/ide-support/idea/misc.xml b/res/ide-support/idea/misc.xml
index 2f3538ae29..0f6a7a25c6 100644
--- a/res/ide-support/idea/misc.xml
+++ b/res/ide-support/idea/misc.xml
@@ -16,7 +16,7 @@
   limitations under the License.
 -->
 
-  
+  
 
   
 
\ No newline at end of file
diff --git a/res/ide-support/idea/tomcat.iml b/res/ide-support/idea/tomcat.iml
index aa62dc576b..13e7a12569 100644
--- a/res/ide-support/idea/tomcat.iml
+++ b/res/ide-support/idea/tomcat.iml
@@ -30,7 +30,7 @@
 
   
 
-  
+  
 
 
 
@@ -41,7 +41,7 @@
 
   
 
-
+
 
 
 
@@ -50,7 +50,7 @@
 
   
 
-  
+  
 
 
 
@@ -59,7 +59,7 @@
 
   
 
-  
+  
 
 
 
@@ -68,7 +68,7 @@
 
   
 
-  
+  
 
 
 
@@ -77,7 +77,7 @@
 
   
 
-  
+  
 
 
 
@@ -86,7 +86,7 @@
 
   
 
-  
+  
 
 
 
@@ -95,7 +95,7 @@
 
   
 
-  
+  
 
 
 
@@ 

[tomcat] branch 8.5.x updated: Update objenesis and unboundid versions for IDE configs. Submitted by Bailey Brownie

2023-02-09 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 23520c54b3 Update objenesis and unboundid versions for IDE configs. 
Submitted by Bailey Brownie
23520c54b3 is described below

commit 23520c54b3477ce07330f11e9090d5ca676c4e34
Author: lihan 
AuthorDate: Thu Feb 9 17:04:15 2023 +0800

Update objenesis and unboundid versions for IDE configs.
Submitted by Bailey Brownie
---
 build.xml  | 35 +-
 res/ide-support/eclipse/eclipse.classpath  | 21 ++---
 .../eclipse/org.eclipse.jdt.core.prefs.properties  |  6 ++--
 res/ide-support/idea/misc.xml  |  2 +-
 res/ide-support/idea/tomcat.iml| 20 ++---
 .../netbeans/nb-tomcat-build.properties|  2 +-
 res/ide-support/netbeans/nb-tomcat.xml |  2 +-
 res/ide-support/netbeans/project.xml   | 14 -
 webapps/docs/building.xml  | 12 
 9 files changed, 61 insertions(+), 53 deletions(-)

diff --git a/build.xml b/build.xml
index 5c07d2b80b..4788636fc0 100644
--- a/build.xml
+++ b/build.xml
@@ -251,6 +251,21 @@
 
   
 
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+  
+
   
   
 
@@ -3372,12 +3387,16 @@ asf.ldap.username=${release.asfusername}
 
 
 
-
+
+  
+  
+
 
 
 
-
-
+
+  
+
 Eclipse project files created.
 Read the Building page on the Apache Tomcat documentation site for details on 
how to configure your Eclipse workspace.
   
@@ -3390,13 +3409,11 @@ Read the Building page on the Apache Tomcat 
documentation site for details on ho
 
 
   
+  
+  
 
 
-IntelliJ IDEA project directory created. Please create PATH 
VARIABLES for
-
-  ANT_HOME  = ${ant.home}
-  TOMCAT_BUILD_LIBS = ${base.path}
-
+IntelliJ IDEA project directory created.
   
 
   
@@ -3432,6 +3449,8 @@ Use the "ide-netbeans-replace" target if you wish to 
overwrite them.
 
 
   
+  
+  
 
 NetBeans project files created.
 Read the Building page on the Apache Tomcat documentation site for details on 
how to customise your NetBeans project.
diff --git a/res/ide-support/eclipse/eclipse.classpath 
b/res/ide-support/eclipse/eclipse.classpath
index 3e26cdb72b..881f58847e 100644
--- a/res/ide-support/eclipse/eclipse.classpath
+++ b/res/ide-support/eclipse/eclipse.classpath
@@ -19,16 +19,17 @@
 
 
 
-
+
 
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
 
 
diff --git a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties 
b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
index c7fcfab4bb..0e28ec4353 100644
--- a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
+++ b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties
@@ -15,6 +15,6 @@
 # limitations under the License.
 # -
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=@BUILD_JAVA_VERSION@
+org.eclipse.jdt.core.compiler.compliance=@MIN_JAVA_VERSION@
+org.eclipse.jdt.core.compiler.source=@BUILD_JAVA_VERSION@
diff --git a/res/ide-support/idea/misc.xml b/res/ide-support/idea/misc.xml
index 2f3538ae29..0f6a7a25c6 100644
--- a/res/ide-support/idea/misc.xml
+++ b/res/ide-support/idea/misc.xml
@@ -16,7 +16,7 @@
   limitations under the License.
 -->
 
-  
+  
 
   
 
\ No newline at end of file
diff --git a/res/ide-support/idea/tomcat.iml b/res/ide-support/idea/tomcat.iml
index a096fc3137..4d83e65156 100644
--- a/res/ide-support/idea/tomcat.iml
+++ b/res/ide-support/idea/tomcat.iml
@@ -30,7 +30,7 @@
 
   
 
-  
+  
 
 
 
@@ -41,7 +41,7 @@
 
   
 
-
+
 
 
 
@@ -50,7 +50,7 @@
 
   
 
-  
+  
 
 
 
@@ -59,7 +59,7 @@
 
   
 
-  
+  
 
 
 
@@ -68,7 +68,7 @@
 
   
 
-  
+  
 
 
 
@@ -77,7 +77,7 @@
 
   
 
-  
+  
 
 
 
@@ -86,7 +86,7 @@
 
   
 
-  
+  
 
 
 
@@ -95,7 +95,7 @@
 
   
 
-  
+  
 
 
 
@@ 

[tomcat] branch 9.0.x updated: Remove incorrect configuration

2023-02-09 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 3d3e074d95 Remove incorrect configuration
3d3e074d95 is described below

commit 3d3e074d951a5d7f265e90bf0c46a3540428290a
Author: lihan 
AuthorDate: Thu Feb 9 17:10:27 2023 +0800

Remove incorrect configuration
---
 build.xml | 1 -
 res/ide-support/eclipse/eclipse.classpath | 1 -
 res/ide-support/netbeans/project.xml  | 2 +-
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/build.xml b/build.xml
index b889f55cdd..b8879ab427 100644
--- a/build.xml
+++ b/build.xml
@@ -253,7 +253,6 @@
 
 
 
-
 
 
   
diff --git a/res/ide-support/eclipse/eclipse.classpath 
b/res/ide-support/eclipse/eclipse.classpath
index fcad3f3747..881f58847e 100644
--- a/res/ide-support/eclipse/eclipse.classpath
+++ b/res/ide-support/eclipse/eclipse.classpath
@@ -30,7 +30,6 @@
 
 
 
-
 
 
 
diff --git a/res/ide-support/netbeans/project.xml 
b/res/ide-support/netbeans/project.xml
index fea783cd6e..75a30853ea 100644
--- a/res/ide-support/netbeans/project.xml
+++ b/res/ide-support/netbeans/project.xml
@@ -178,7 +178,7 @@
 -->
 
 java
-@JAXRPC_JAR@:@WSDL4J_JAR@:@JDT_JAR@:@BND_JAR@:@MIGRATION_JAR@:${ant.includes}/
+@JAXRPC_JAR@:@WSDL4J_JAR@:@JDT_JAR@:@BND_JAR@:${ant.includes}/
 @BUILD_JAVA_VERSION@
 
 


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



[tomcat] branch main updated: Fix BZ 66471 - JSessionId secure attribute missing with RemoteIpFilter and X-Forwarded-Proto set to https

2023-02-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c64d496dda Fix BZ 66471 - JSessionId secure attribute missing with 
RemoteIpFilter and X-Forwarded-Proto set to https
c64d496dda is described below

commit c64d496dda1560b5df113be55fbfaefec349b50f
Author: lihan 
AuthorDate: Thu Feb 9 22:42:48 2023 +0800

Fix BZ 66471 - JSessionId secure attribute missing with RemoteIpFilter and 
X-Forwarded-Proto set to https

https://bz.apache.org/bugzilla/show_bug.cgi?id=66471
---
 java/org/apache/catalina/Globals.java  |  7 ++
 java/org/apache/catalina/connector/Request.java| 14 
 .../apache/catalina/filters/RemoteIpFilter.java|  7 +-
 .../catalina/filters/TestRemoteIpFilter.java   | 95 --
 4 files changed, 94 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/Globals.java 
b/java/org/apache/catalina/Globals.java
index 5c7eaa6d43..a3e1462065 100644
--- a/java/org/apache/catalina/Globals.java
+++ b/java/org/apache/catalina/Globals.java
@@ -95,6 +95,13 @@ public final class Globals {
 public static final String SENDFILE_SUPPORTED_ATTR = 
org.apache.coyote.Constants.SENDFILE_SUPPORTED_ATTR;
 
 
+/**
+ * The request attribute that is set to the value of {@code Boolean.TRUE}
+ * if {@code org.apache.catalina.filters.RemoteIpFilter } determines
+ * that this request was submitted via a secure channel.
+ */
+public static final String REMOTE_IP_FILTER_SECURE = 
"org.apache.catalina.filters.RemoteIpFilter.secure";
+
 /**
  * The request attribute that can be used by a servlet to pass
  * to the connector the name of the file that is to be served
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index b943bfe0e8..8297363352 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3489,5 +3489,19 @@ public class Request implements HttpServletRequest {
 // NO-OP
 }
 });
+specialAttributes.put(Globals.REMOTE_IP_FILTER_SECURE,
+new SpecialAttributeAdapter() {
+@Override
+public Object get(Request request, String name) {
+return Boolean.valueOf(request.isSecure());
+}
+
+@Override
+public void set(Request request, String name, Object value) {
+if (value instanceof Boolean) {
+request.setSecure(((Boolean) value).booleanValue());
+}
+}
+});
 }
 }
diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java 
b/java/org/apache/catalina/filters/RemoteIpFilter.java
index 95dac6e85f..25cb2336a1 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -584,11 +584,6 @@ public class RemoteIpFilter extends GenericFilter {
 return serverPort;
 }
 
-@Override
-public boolean isSecure() {
-return secure;
-}
-
 public void removeHeader(String name) {
 Map.Entry> header = getHeaderEntry(name);
 if (header != null) {
@@ -628,7 +623,7 @@ public class RemoteIpFilter extends GenericFilter {
 }
 
 public void setSecure(boolean secure) {
-this.secure = secure;
+super.getRequest().setAttribute(Globals.REMOTE_IP_FILTER_SECURE, 
Boolean.valueOf(secure));
 }
 
 public void setServerName(String serverName) {
diff --git a/test/org/apache/catalina/filters/TestRemoteIpFilter.java 
b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
index 5dc472e266..59c7ecfd97 100644
--- a/test/org/apache/catalina/filters/TestRemoteIpFilter.java
+++ b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
@@ -82,15 +82,21 @@ public class TestRemoteIpFilter extends TomcatBaseTest {
 
 private static final long serialVersionUID = 1L;
 
-private transient HttpServletRequest request;
-
-public HttpServletRequest getRequest() {
-return request;
-}
+public String remoteAddr;
+public String remoteHost;
+public String scheme;
+public String serverName;
+public int serverPort;
+public boolean isSecure;
 
 @Override
 public void service(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
-this.request = request;
+this.isSecure = request.isSecure();
+this.remoteAddr = request.getRemoteAddr();
+this.remoteHost = request.getRemoteHost();
+  

[tomcat] branch main updated: Add a changelog entry

2023-02-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 322fb2bb4e Add a changelog entry
322fb2bb4e is described below

commit 322fb2bb4e4a8413d4116c299cf8948632f94d65
Author: lihan 
AuthorDate: Fri Feb 10 09:58:21 2023 +0800

Add a changelog entry
---
 java/org/apache/catalina/Globals.java | 2 +-
 webapps/docs/changelog.xml| 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/Globals.java 
b/java/org/apache/catalina/Globals.java
index a3e1462065..a5f1fed466 100644
--- a/java/org/apache/catalina/Globals.java
+++ b/java/org/apache/catalina/Globals.java
@@ -97,7 +97,7 @@ public final class Globals {
 
 /**
  * The request attribute that is set to the value of {@code Boolean.TRUE}
- * if {@code org.apache.catalina.filters.RemoteIpFilter } determines
+ * if {@link org.apache.catalina.filters.RemoteIpFilter} determines
  * that this request was submitted via a secure channel.
  */
 public static final String REMOTE_IP_FILTER_SECURE = 
"org.apache.catalina.filters.RemoteIpFilter.secure";
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index dca43edfc0..e898d09c6f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -170,6 +170,11 @@
 external web server. Based on code and ideas from pull request
 506 provided by Max Fortun. (remm)
   
+  
+66471: Fix JSessionId secure attribute missing When
+RemoteIpFilter determines that this request was submitted
+via a secure channel. (lihan)
+  
 
   
   


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



[tomcat] branch 10.1.x updated: Fix BZ 66471 - JSessionId secure attribute missing with RemoteIpFilter and X-Forwarded-Proto set to https

2023-02-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new f509bbf31f Fix BZ 66471 - JSessionId secure attribute missing with 
RemoteIpFilter and X-Forwarded-Proto set to https
f509bbf31f is described below

commit f509bbf31fc00abe3d9f25ebfabca5e05173da5b
Author: lihan 
AuthorDate: Fri Feb 10 10:01:27 2023 +0800

Fix BZ 66471 - JSessionId secure attribute missing with RemoteIpFilter and 
X-Forwarded-Proto set to https

https://bz.apache.org/bugzilla/show_bug.cgi?id=66471
---
 java/org/apache/catalina/Globals.java  |  7 ++
 java/org/apache/catalina/connector/Request.java| 14 
 .../apache/catalina/filters/RemoteIpFilter.java|  7 +-
 .../catalina/filters/TestRemoteIpFilter.java   | 96 --
 webapps/docs/changelog.xml |  5 ++
 5 files changed, 100 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/Globals.java 
b/java/org/apache/catalina/Globals.java
index f04839ff79..dad40addf1 100644
--- a/java/org/apache/catalina/Globals.java
+++ b/java/org/apache/catalina/Globals.java
@@ -95,6 +95,13 @@ public final class Globals {
 public static final String SENDFILE_SUPPORTED_ATTR = 
org.apache.coyote.Constants.SENDFILE_SUPPORTED_ATTR;
 
 
+/**
+ * The request attribute that is set to the value of {@code Boolean.TRUE}
+ * if {@link org.apache.catalina.filters.RemoteIpFilter} determines
+ * that this request was submitted via a secure channel.
+ */
+public static final String REMOTE_IP_FILTER_SECURE = 
"org.apache.catalina.filters.RemoteIpFilter.secure";
+
 /**
  * The request attribute that can be used by a servlet to pass
  * to the connector the name of the file that is to be served
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 7a7373bb8e..deff558b69 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3533,5 +3533,19 @@ public class Request implements HttpServletRequest {
 // NO-OP
 }
 });
+specialAttributes.put(Globals.REMOTE_IP_FILTER_SECURE,
+new SpecialAttributeAdapter() {
+@Override
+public Object get(Request request, String name) {
+return Boolean.valueOf(request.isSecure());
+}
+
+@Override
+public void set(Request request, String name, Object value) {
+if (value instanceof Boolean) {
+request.setSecure(((Boolean) value).booleanValue());
+}
+}
+});
 }
 }
diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java 
b/java/org/apache/catalina/filters/RemoteIpFilter.java
index 8a70cbb762..7e85898a8d 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -585,11 +585,6 @@ public class RemoteIpFilter extends GenericFilter {
 return serverPort;
 }
 
-@Override
-public boolean isSecure() {
-return secure;
-}
-
 public void removeHeader(String name) {
 Map.Entry> header = getHeaderEntry(name);
 if (header != null) {
@@ -629,7 +624,7 @@ public class RemoteIpFilter extends GenericFilter {
 }
 
 public void setSecure(boolean secure) {
-this.secure = secure;
+super.getRequest().setAttribute(Globals.REMOTE_IP_FILTER_SECURE, 
Boolean.valueOf(secure));
 }
 
 public void setServerName(String serverName) {
diff --git a/test/org/apache/catalina/filters/TestRemoteIpFilter.java 
b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
index 5dc472e266..1706e7ccf7 100644
--- a/test/org/apache/catalina/filters/TestRemoteIpFilter.java
+++ b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
@@ -82,15 +82,21 @@ public class TestRemoteIpFilter extends TomcatBaseTest {
 
 private static final long serialVersionUID = 1L;
 
-private transient HttpServletRequest request;
-
-public HttpServletRequest getRequest() {
-return request;
-}
+public String remoteAddr;
+public String remoteHost;
+public String scheme;
+public String serverName;
+public int serverPort;
+public boolean isSecure;
 
 @Override
 public void service(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
-this.request = request;
+this.isSecure = request.isSecure();
+this.remoteAddr = request.

[tomcat] branch 9.0.x updated: Fix BZ 66471 - JSessionId secure attribute missing with RemoteIpFilter and X-Forwarded-Proto set to https

2023-02-09 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 3b51230764 Fix BZ 66471 - JSessionId secure attribute missing with 
RemoteIpFilter and X-Forwarded-Proto set to https
3b51230764 is described below

commit 3b51230764da595bb19e8d0962dd8c69ab40dfab
Author: lihan 
AuthorDate: Fri Feb 10 10:01:27 2023 +0800

Fix BZ 66471 - JSessionId secure attribute missing with RemoteIpFilter and 
X-Forwarded-Proto set to https

https://bz.apache.org/bugzilla/show_bug.cgi?id=66471
---
 java/org/apache/catalina/Globals.java  |  7 ++
 java/org/apache/catalina/connector/Request.java| 14 
 .../apache/catalina/filters/RemoteIpFilter.java|  7 +-
 .../catalina/filters/TestRemoteIpFilter.java   | 96 --
 webapps/docs/changelog.xml |  5 ++
 5 files changed, 100 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/Globals.java 
b/java/org/apache/catalina/Globals.java
index 07213317d6..e21e6e202d 100644
--- a/java/org/apache/catalina/Globals.java
+++ b/java/org/apache/catalina/Globals.java
@@ -111,6 +111,13 @@ public final class Globals {
 public static final String SENDFILE_SUPPORTED_ATTR = 
org.apache.coyote.Constants.SENDFILE_SUPPORTED_ATTR;
 
 
+/**
+ * The request attribute that is set to the value of {@code Boolean.TRUE}
+ * if {@link org.apache.catalina.filters.RemoteIpFilter} determines
+ * that this request was submitted via a secure channel.
+ */
+public static final String REMOTE_IP_FILTER_SECURE = 
"org.apache.catalina.filters.RemoteIpFilter.secure";
+
 /**
  * The request attribute that can be used by a servlet to pass
  * to the connector the name of the file that is to be served
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 6cb200f8ef..2c2c03aae8 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3611,6 +3611,20 @@ public class Request implements HttpServletRequest {
 // NO-OP
 }
 });
+specialAttributes.put(Globals.REMOTE_IP_FILTER_SECURE,
+new SpecialAttributeAdapter() {
+@Override
+public Object get(Request request, String name) {
+return Boolean.valueOf(request.isSecure());
+}
+
+@Override
+public void set(Request request, String name, Object value) {
+if (value instanceof Boolean) {
+request.setSecure(((Boolean) value).booleanValue());
+}
+}
+});
 specialAttributes.put(Globals.STREAM_ID,
 new SpecialAttributeAdapter() {
 @Override
diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java 
b/java/org/apache/catalina/filters/RemoteIpFilter.java
index 3fdb17551b..5acf36cf1d 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -585,11 +585,6 @@ public class RemoteIpFilter extends GenericFilter {
 return serverPort;
 }
 
-@Override
-public boolean isSecure() {
-return secure;
-}
-
 public void removeHeader(String name) {
 Map.Entry> header = getHeaderEntry(name);
 if (header != null) {
@@ -629,7 +624,7 @@ public class RemoteIpFilter extends GenericFilter {
 }
 
 public void setSecure(boolean secure) {
-this.secure = secure;
+super.getRequest().setAttribute(Globals.REMOTE_IP_FILTER_SECURE, 
Boolean.valueOf(secure));
 }
 
 public void setServerName(String serverName) {
diff --git a/test/org/apache/catalina/filters/TestRemoteIpFilter.java 
b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
index ee5abc4649..5599a4df54 100644
--- a/test/org/apache/catalina/filters/TestRemoteIpFilter.java
+++ b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
@@ -82,15 +82,21 @@ public class TestRemoteIpFilter extends TomcatBaseTest {
 
 private static final long serialVersionUID = 1L;
 
-private transient HttpServletRequest request;
-
-public HttpServletRequest getRequest() {
-return request;
-}
+public String remoteAddr;
+public String remoteHost;
+public String scheme;
+public String serverName;
+public int serverPort;
+public boolean isSecure;
 
 @Override
 public void service(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
-this.requ

[tomcat] branch 8.5.x updated: Fix BZ 66471 - JSessionId secure attribute missing with RemoteIpFilter and X-Forwarded-Proto set to https

2023-02-09 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 5b72c94e8b Fix BZ 66471 - JSessionId secure attribute missing with 
RemoteIpFilter and X-Forwarded-Proto set to https
5b72c94e8b is described below

commit 5b72c94e8b2c4ada63a1d91dc527bf4d8fd1f510
Author: lihan 
AuthorDate: Fri Feb 10 10:01:27 2023 +0800

Fix BZ 66471 - JSessionId secure attribute missing with RemoteIpFilter and 
X-Forwarded-Proto set to https

https://bz.apache.org/bugzilla/show_bug.cgi?id=66471
---
 java/org/apache/catalina/Globals.java  |  7 ++
 java/org/apache/catalina/connector/Request.java| 14 
 .../apache/catalina/filters/RemoteIpFilter.java|  7 +-
 .../catalina/filters/TestRemoteIpFilter.java   | 96 --
 webapps/docs/changelog.xml |  5 ++
 5 files changed, 100 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/Globals.java 
b/java/org/apache/catalina/Globals.java
index 07213317d6..e21e6e202d 100644
--- a/java/org/apache/catalina/Globals.java
+++ b/java/org/apache/catalina/Globals.java
@@ -111,6 +111,13 @@ public final class Globals {
 public static final String SENDFILE_SUPPORTED_ATTR = 
org.apache.coyote.Constants.SENDFILE_SUPPORTED_ATTR;
 
 
+/**
+ * The request attribute that is set to the value of {@code Boolean.TRUE}
+ * if {@link org.apache.catalina.filters.RemoteIpFilter} determines
+ * that this request was submitted via a secure channel.
+ */
+public static final String REMOTE_IP_FILTER_SECURE = 
"org.apache.catalina.filters.RemoteIpFilter.secure";
+
 /**
  * The request attribute that can be used by a servlet to pass
  * to the connector the name of the file that is to be served
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 1a1644c053..53e562ff52 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3655,6 +3655,20 @@ public class Request implements HttpServletRequest {
 // NO-OP
 }
 });
+specialAttributes.put(Globals.REMOTE_IP_FILTER_SECURE,
+new SpecialAttributeAdapter() {
+@Override
+public Object get(Request request, String name) {
+return Boolean.valueOf(request.isSecure());
+}
+
+@Override
+public void set(Request request, String name, Object value) {
+if (value instanceof Boolean) {
+request.setSecure(((Boolean) value).booleanValue());
+}
+}
+});
 specialAttributes.put(Globals.STREAM_ID,
 new SpecialAttributeAdapter() {
 @Override
diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java 
b/java/org/apache/catalina/filters/RemoteIpFilter.java
index 8bf562dcf8..534d214d46 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -579,11 +579,6 @@ public class RemoteIpFilter implements Filter {
 return serverPort;
 }
 
-@Override
-public boolean isSecure() {
-return secure;
-}
-
 public void removeHeader(String name) {
 Map.Entry> header = getHeaderEntry(name);
 if (header != null) {
@@ -623,7 +618,7 @@ public class RemoteIpFilter implements Filter {
 }
 
 public void setSecure(boolean secure) {
-this.secure = secure;
+super.getRequest().setAttribute(Globals.REMOTE_IP_FILTER_SECURE, 
Boolean.valueOf(secure));
 }
 
 public void setServerName(String serverName) {
diff --git a/test/org/apache/catalina/filters/TestRemoteIpFilter.java 
b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
index cd7869a553..bf51a5aef8 100644
--- a/test/org/apache/catalina/filters/TestRemoteIpFilter.java
+++ b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
@@ -82,15 +82,21 @@ public class TestRemoteIpFilter extends TomcatBaseTest {
 
 private static final long serialVersionUID = 1L;
 
-private transient HttpServletRequest request;
-
-public HttpServletRequest getRequest() {
-return request;
-}
+public String remoteAddr;
+public String remoteHost;
+public String scheme;
+public String serverName;
+public int serverPort;
+public boolean isSecure;
 
 @Override
 public void service(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
-this.requ

[tomcat] branch main updated: Improve: Reuse the instance of StringBuilder to avoid duplicate object creation (#588)

2023-02-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 87e1cbf767 Improve: Reuse the instance of StringBuilder to avoid 
duplicate object creation (#588)
87e1cbf767 is described below

commit 87e1cbf7679fffdc0eeb620961d709681e564e3b
Author: Andrei Briukhov 
AuthorDate: Fri Feb 10 11:34:59 2023 +0300

Improve: Reuse the instance of StringBuilder to avoid duplicate object 
creation (#588)
---
 java/org/apache/catalina/valves/ExtendedAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 
b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index 74dc8b871a..62faf87356 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -432,22 +432,22 @@ public class ExtendedAccessLogValve extends 
AccessLogValve {
 switch (c) {
 case ' ':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 buf.append((char) c);
 return result;
 case '-':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 subToken = true;
 return result;
 case '(':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 parameter = true;
 return result;
 case ')':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 break;
 default:
 buf.append((char) c);


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



[tomcat] branch 10.1.x updated: Improve: Reuse the instance of StringBuilder to avoid duplicate object creation (#588)

2023-02-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new cd06594f7f Improve: Reuse the instance of StringBuilder to avoid 
duplicate object creation (#588)
cd06594f7f is described below

commit cd06594f7f9d2e52abbccc6d9e42827a5f41f8bf
Author: Andrei Briukhov 
AuthorDate: Fri Feb 10 11:34:59 2023 +0300

Improve: Reuse the instance of StringBuilder to avoid duplicate object 
creation (#588)
---
 java/org/apache/catalina/valves/ExtendedAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 
b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index 74dc8b871a..62faf87356 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -432,22 +432,22 @@ public class ExtendedAccessLogValve extends 
AccessLogValve {
 switch (c) {
 case ' ':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 buf.append((char) c);
 return result;
 case '-':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 subToken = true;
 return result;
 case '(':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 parameter = true;
 return result;
 case ')':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 break;
 default:
 buf.append((char) c);


-
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: Improve: Reuse the instance of StringBuilder to avoid duplicate object creation (#588)

2023-02-10 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 7ba2e5c8b8 Improve: Reuse the instance of StringBuilder to avoid 
duplicate object creation (#588)
7ba2e5c8b8 is described below

commit 7ba2e5c8b822a5140eecf3280ef608090b1120d1
Author: Andrei Briukhov 
AuthorDate: Fri Feb 10 11:34:59 2023 +0300

Improve: Reuse the instance of StringBuilder to avoid duplicate object 
creation (#588)
---
 java/org/apache/catalina/valves/ExtendedAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 
b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index e2eb61aa61..6768b0d421 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -432,22 +432,22 @@ public class ExtendedAccessLogValve extends 
AccessLogValve {
 switch (c) {
 case ' ':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 buf.append((char) c);
 return result;
 case '-':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 subToken = true;
 return result;
 case '(':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 parameter = true;
 return result;
 case ')':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 break;
 default:
 buf.append((char) c);


-
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: Improve: Reuse the instance of StringBuilder to avoid duplicate object creation (#588)

2023-02-10 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 9a56b27279 Improve: Reuse the instance of StringBuilder to avoid 
duplicate object creation (#588)
9a56b27279 is described below

commit 9a56b27279c767fcc2cd4269f078980efdf04f33
Author: Andrei Briukhov 
AuthorDate: Fri Feb 10 11:34:59 2023 +0300

Improve: Reuse the instance of StringBuilder to avoid duplicate object 
creation (#588)
---
 java/org/apache/catalina/valves/ExtendedAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 
b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index 26d5eee01c..39474e160e 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -442,22 +442,22 @@ public class ExtendedAccessLogValve extends 
AccessLogValve {
 switch (c) {
 case ' ':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 buf.append((char) c);
 return result;
 case '-':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 subToken = true;
 return result;
 case '(':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 parameter = true;
 return result;
 case ')':
 result = buf.toString();
-buf = new StringBuilder();
+buf.setLength(0);
 break;
 default:
 buf.append((char) c);


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



[tomcat] branch main updated: Replace manually invoke close method with try-with-resources. (#590)

2023-02-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 03ae0436fa Replace manually invoke close method with 
try-with-resources. (#590)
03ae0436fa is described below

commit 03ae0436fa1ffefe334432238b020532a7165016
Author: Andrei Briukhov 
AuthorDate: Fri Feb 10 12:16:41 2023 +0300

Replace manually invoke close method with try-with-resources. (#590)
---
 .../coyote/http11/filters/ChunkedOutputFilter.java | 30 --
 .../xreflection/ReflectionLessCodeGenerator.java   |  8 +++---
 .../apache/catalina/core/TestAsyncContextImpl.java | 13 +++---
 3 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java 
b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
index 6eedd81eea..c7a6f27a48 100644
--- a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
+++ b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
@@ -177,20 +177,22 @@ public class ChunkedOutputFilter implements OutputFilter {
 lastChunk.position(0).limit(lastChunk.capacity());
 
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
-   OutputStreamWriter osw = new OutputStreamWriter(baos, 
StandardCharsets.ISO_8859_1);
-for (Map.Entry trailerField : 
trailerFields.entrySet()) {
-// Ignore disallowed headers
-if (disallowedTrailerFieldNames.contains(
-trailerField.getKey().toLowerCase(Locale.ENGLISH))) {
-continue;
-}
-osw.write(trailerField.getKey());
-osw.write(':');
-osw.write(' ');
-osw.write(trailerField.getValue());
-osw.write("\r\n");
-}
-osw.close();
+
+   try (OutputStreamWriter osw = new OutputStreamWriter(baos, 
StandardCharsets.ISO_8859_1)) {
+   for (Map.Entry trailerField : 
trailerFields.entrySet()) {
+   // Ignore disallowed headers
+   if (disallowedTrailerFieldNames.contains(
+   trailerField.getKey().toLowerCase(Locale.ENGLISH))) 
{
+   continue;
+   }
+   osw.write(trailerField.getKey());
+   osw.write(':');
+   osw.write(' ');
+   osw.write(trailerField.getValue());
+   osw.write("\r\n");
+   }
+   }
+
 buffer.doWrite(ByteBuffer.wrap(baos.toByteArray()));
 
 buffer.doWrite(crlfChunk);
diff --git 
a/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java 
b/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
index a06d78dce5..d79983e4f9 100644
--- a/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
+++ b/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
@@ -185,10 +185,10 @@ final class ReflectionLessCodeGenerator {
 .append(System.lineSeparator());
 //end - class
 File destination = new File(directory, className+".java");
-BufferedWriter writer = new BufferedWriter(new FileWriter(destination, 
false));
-writer.write(code.toString());
-writer.flush();
-writer.close();
+try (BufferedWriter writer = new BufferedWriter(new 
FileWriter(destination, false))) {
+writer.write(code.toString());
+writer.flush();
+}
 
 }
 
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 14621803ed..fc755166b2 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -1521,15 +1521,10 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 // Just for debugging
 async.setTimeout(10);
 
-ExecutorService executor = Executors.newSingleThreadExecutor();
-executor.submit(new Runnable() {
-
-@Override
-public void run() {
-async.dispatch("/ServletC");
-}
-});
-executor.shutdown();
+try (ExecutorService executor = 
Executors.newSingleThreadExecutor()) {
+executor.submit(() -> async.dispatch("/ServletC"));
+executor.shutdown();
+}
 }
 }
 


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



[tomcat] branch 10.1.x updated: Replace manually invoke close method with try-with-resources. (#590)

2023-02-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new a890a8f8eb Replace manually invoke close method with 
try-with-resources. (#590)
a890a8f8eb is described below

commit a890a8f8eb5562b496e8a2fda76082c6e3e96840
Author: Andrei Briukhov 
AuthorDate: Fri Feb 10 12:16:41 2023 +0300

Replace manually invoke close method with try-with-resources. (#590)
---
 .../coyote/http11/filters/ChunkedOutputFilter.java | 30 --
 .../xreflection/ReflectionLessCodeGenerator.java   |  8 +++---
 .../apache/catalina/core/TestAsyncContextImpl.java | 13 +++---
 3 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java 
b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
index 6eedd81eea..c7a6f27a48 100644
--- a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
+++ b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
@@ -177,20 +177,22 @@ public class ChunkedOutputFilter implements OutputFilter {
 lastChunk.position(0).limit(lastChunk.capacity());
 
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
-   OutputStreamWriter osw = new OutputStreamWriter(baos, 
StandardCharsets.ISO_8859_1);
-for (Map.Entry trailerField : 
trailerFields.entrySet()) {
-// Ignore disallowed headers
-if (disallowedTrailerFieldNames.contains(
-trailerField.getKey().toLowerCase(Locale.ENGLISH))) {
-continue;
-}
-osw.write(trailerField.getKey());
-osw.write(':');
-osw.write(' ');
-osw.write(trailerField.getValue());
-osw.write("\r\n");
-}
-osw.close();
+
+   try (OutputStreamWriter osw = new OutputStreamWriter(baos, 
StandardCharsets.ISO_8859_1)) {
+   for (Map.Entry trailerField : 
trailerFields.entrySet()) {
+   // Ignore disallowed headers
+   if (disallowedTrailerFieldNames.contains(
+   trailerField.getKey().toLowerCase(Locale.ENGLISH))) 
{
+   continue;
+   }
+   osw.write(trailerField.getKey());
+   osw.write(':');
+   osw.write(' ');
+   osw.write(trailerField.getValue());
+   osw.write("\r\n");
+   }
+   }
+
 buffer.doWrite(ByteBuffer.wrap(baos.toByteArray()));
 
 buffer.doWrite(crlfChunk);
diff --git 
a/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java 
b/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
index a06d78dce5..d79983e4f9 100644
--- a/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
+++ b/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
@@ -185,10 +185,10 @@ final class ReflectionLessCodeGenerator {
 .append(System.lineSeparator());
 //end - class
 File destination = new File(directory, className+".java");
-BufferedWriter writer = new BufferedWriter(new FileWriter(destination, 
false));
-writer.write(code.toString());
-writer.flush();
-writer.close();
+try (BufferedWriter writer = new BufferedWriter(new 
FileWriter(destination, false))) {
+writer.write(code.toString());
+writer.flush();
+}
 
 }
 
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 14621803ed..fc755166b2 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -1521,15 +1521,10 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 // Just for debugging
 async.setTimeout(10);
 
-ExecutorService executor = Executors.newSingleThreadExecutor();
-executor.submit(new Runnable() {
-
-@Override
-public void run() {
-async.dispatch("/ServletC");
-}
-});
-executor.shutdown();
+try (ExecutorService executor = 
Executors.newSingleThreadExecutor()) {
+executor.submit(() -> async.dispatch("/ServletC"));
+executor.shutdown();
+}
 }
 }
 


-
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: Replace manually invoke close method with try-with-resources. (#590)

2023-02-10 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 90e6b33286 Replace manually invoke close method with 
try-with-resources. (#590)
90e6b33286 is described below

commit 90e6b332865109398e6fbab5de4657519ab8d9b2
Author: Andrei Briukhov 
AuthorDate: Fri Feb 10 12:16:41 2023 +0300

Replace manually invoke close method with try-with-resources. (#590)
---
 .../coyote/http11/filters/ChunkedOutputFilter.java | 30 --
 .../xreflection/ReflectionLessCodeGenerator.java   |  8 +++---
 .../apache/catalina/core/TestAsyncContextImpl.java | 13 +++---
 3 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java 
b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
index 6eedd81eea..c7a6f27a48 100644
--- a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
+++ b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
@@ -177,20 +177,22 @@ public class ChunkedOutputFilter implements OutputFilter {
 lastChunk.position(0).limit(lastChunk.capacity());
 
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
-   OutputStreamWriter osw = new OutputStreamWriter(baos, 
StandardCharsets.ISO_8859_1);
-for (Map.Entry trailerField : 
trailerFields.entrySet()) {
-// Ignore disallowed headers
-if (disallowedTrailerFieldNames.contains(
-trailerField.getKey().toLowerCase(Locale.ENGLISH))) {
-continue;
-}
-osw.write(trailerField.getKey());
-osw.write(':');
-osw.write(' ');
-osw.write(trailerField.getValue());
-osw.write("\r\n");
-}
-osw.close();
+
+   try (OutputStreamWriter osw = new OutputStreamWriter(baos, 
StandardCharsets.ISO_8859_1)) {
+   for (Map.Entry trailerField : 
trailerFields.entrySet()) {
+   // Ignore disallowed headers
+   if (disallowedTrailerFieldNames.contains(
+   trailerField.getKey().toLowerCase(Locale.ENGLISH))) 
{
+   continue;
+   }
+   osw.write(trailerField.getKey());
+   osw.write(':');
+   osw.write(' ');
+   osw.write(trailerField.getValue());
+   osw.write("\r\n");
+   }
+   }
+
 buffer.doWrite(ByteBuffer.wrap(baos.toByteArray()));
 
 buffer.doWrite(crlfChunk);
diff --git 
a/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java 
b/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
index a06d78dce5..d79983e4f9 100644
--- a/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
+++ b/java/org/apache/tomcat/util/xreflection/ReflectionLessCodeGenerator.java
@@ -185,10 +185,10 @@ final class ReflectionLessCodeGenerator {
 .append(System.lineSeparator());
 //end - class
 File destination = new File(directory, className+".java");
-BufferedWriter writer = new BufferedWriter(new FileWriter(destination, 
false));
-writer.write(code.toString());
-writer.flush();
-writer.close();
+try (BufferedWriter writer = new BufferedWriter(new 
FileWriter(destination, false))) {
+writer.write(code.toString());
+writer.flush();
+}
 
 }
 
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 1ce2eebb3e..1066c51b02 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -1521,15 +1521,10 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 // Just for debugging
 async.setTimeout(10);
 
-ExecutorService executor = Executors.newSingleThreadExecutor();
-executor.submit(new Runnable() {
-
-@Override
-public void run() {
-async.dispatch("/ServletC");
-}
-});
-executor.shutdown();
+try (ExecutorService executor = 
Executors.newSingleThreadExecutor()) {
+executor.submit(() -> async.dispatch("/ServletC"));
+executor.shutdown();
+}
 }
 }
 


-
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: Revert TestAsyncContextImpl.

2023-02-10 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 17e7c48348 Revert TestAsyncContextImpl.
17e7c48348 is described below

commit 17e7c483489ab25ad00262b93c5fb47235ee8754
Author: lihan 
AuthorDate: Fri Feb 10 17:24:03 2023 +0800

Revert TestAsyncContextImpl.
---
 test/org/apache/catalina/core/TestAsyncContextImpl.java | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 1066c51b02..1ce2eebb3e 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -1521,10 +1521,15 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 // Just for debugging
 async.setTimeout(10);
 
-try (ExecutorService executor = 
Executors.newSingleThreadExecutor()) {
-executor.submit(() -> async.dispatch("/ServletC"));
-executor.shutdown();
-}
+ExecutorService executor = Executors.newSingleThreadExecutor();
+executor.submit(new Runnable() {
+
+@Override
+public void run() {
+async.dispatch("/ServletC");
+}
+});
+executor.shutdown();
 }
 }
 


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



[tomcat] branch 10.1.x updated: Revert TestAsyncContextImpl.

2023-02-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 5bff34bfec Revert TestAsyncContextImpl.
5bff34bfec is described below

commit 5bff34bfec80a38de933171c36c9b5691bfbbe82
Author: lihan 
AuthorDate: Fri Feb 10 17:24:03 2023 +0800

Revert TestAsyncContextImpl.
---
 test/org/apache/catalina/core/TestAsyncContextImpl.java | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index fc755166b2..14621803ed 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -1521,10 +1521,15 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 // Just for debugging
 async.setTimeout(10);
 
-try (ExecutorService executor = 
Executors.newSingleThreadExecutor()) {
-executor.submit(() -> async.dispatch("/ServletC"));
-executor.shutdown();
-}
+ExecutorService executor = Executors.newSingleThreadExecutor();
+executor.submit(new Runnable() {
+
+@Override
+public void run() {
+async.dispatch("/ServletC");
+}
+});
+executor.shutdown();
 }
 }
 


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



[tomcat] branch main updated: Revert TestAsyncContextImpl.

2023-02-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 1b90313d4c Revert TestAsyncContextImpl.
1b90313d4c is described below

commit 1b90313d4ced5fca1c16aff5ba8271f916cacee5
Author: lihan 
AuthorDate: Fri Feb 10 17:24:03 2023 +0800

Revert TestAsyncContextImpl.
---
 test/org/apache/catalina/core/TestAsyncContextImpl.java | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index fc755166b2..14621803ed 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -1521,10 +1521,15 @@ public class TestAsyncContextImpl extends 
TomcatBaseTest {
 // Just for debugging
 async.setTimeout(10);
 
-try (ExecutorService executor = 
Executors.newSingleThreadExecutor()) {
-executor.submit(() -> async.dispatch("/ServletC"));
-executor.shutdown();
-}
+ExecutorService executor = Executors.newSingleThreadExecutor();
+executor.submit(new Runnable() {
+
+@Override
+public void run() {
+async.dispatch("/ServletC");
+}
+});
+executor.shutdown();
 }
 }
 


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



[tomcat] branch main updated: Fix typo.

2023-02-15 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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

commit f31182254a5e14103f018f5e2b70da41f6b7b012
Author: lihan 
AuthorDate: Wed Feb 15 17:57:46 2023 +0800

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

diff --git a/java/org/apache/catalina/Context.java 
b/java/org/apache/catalina/Context.java
index c3a881b385..928c1bfcd0 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -441,7 +441,7 @@ public interface Context extends Container, ContextBind {
 
 
 /**
- * Determine if the matadata of the application is complete. This typically
+ * Determine if the metadata of the application is complete. This typically
  * means annotations which add to the application metadata will be
  * ignored.
  *


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



[tomcat] branch main updated: Many improvements.

2023-02-16 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 f9fa97a537 Many improvements.
f9fa97a537 is described below

commit f9fa97a5372117bcc58ae699e929065dfac74f1f
Author: lihan 
AuthorDate: Fri Feb 17 11:30:53 2023 +0800

Many improvements.
---
 java/org/apache/coyote/ajp/AbstractAjpProtocol.java |  6 +-
 java/org/apache/coyote/ajp/AjpMessage.java  |  2 +-
 .../org/apache/tomcat/util/digester/CallMethodRule.java | 17 ++---
 java/org/apache/tomcat/util/json/JSONFilter.java|  4 ++--
 java/org/apache/tomcat/util/net/SSLUtilBase.java|  2 +-
 .../ciphers/OpenSSLCipherConfigurationParser.java   |  6 +++---
 .../apache/tomcat/util/scan/AbstractInputStreamJar.java |  4 ++--
 .../tomcat/util/xreflection/ReflectionProperty.java |  8 +++-
 .../tomcat/util/xreflection/SetPropertyClass.java   |  6 ++
 9 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java 
b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
index b62fe988a8..537a1d0b04 100644
--- a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
+++ b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
@@ -182,11 +182,7 @@ public abstract class AbstractAjpProtocol extends 
AbstractProtocol {
 private int packetSize = Constants.MAX_PACKET_SIZE;
 public int getPacketSize() { return packetSize; }
 public void setPacketSize(int packetSize) {
-if (packetSize < Constants.MAX_PACKET_SIZE) {
-this.packetSize = Constants.MAX_PACKET_SIZE;
-} else {
-this.packetSize = packetSize;
-}
+this.packetSize = Math.max(packetSize, Constants.MAX_PACKET_SIZE);
 }
 
 
diff --git a/java/org/apache/coyote/ajp/AjpMessage.java 
b/java/org/apache/coyote/ajp/AjpMessage.java
index 14d7e53cb9..f49a099125 100644
--- a/java/org/apache/coyote/ajp/AjpMessage.java
+++ b/java/org/apache/coyote/ajp/AjpMessage.java
@@ -398,7 +398,7 @@ public class AjpMessage {
 StringBuilder sb = new StringBuilder();
 for (int i = start; i < start + 16 ; i++) {
 if (i < len + 4) {
-sb.append(hex(buf[i]) + " ");
+sb.append(hex(buf[i])).append(" ");
 } else {
 sb.append("   ");
 }
diff --git a/java/org/apache/tomcat/util/digester/CallMethodRule.java 
b/java/org/apache/tomcat/util/digester/CallMethodRule.java
index bd65535dbc..3110c4450b 100644
--- a/java/org/apache/tomcat/util/digester/CallMethodRule.java
+++ b/java/org/apache/tomcat/util/digester/CallMethodRule.java
@@ -19,6 +19,8 @@ package org.apache.tomcat.util.digester;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.xml.sax.Attributes;
 
+import java.util.Arrays;
+
 /**
  * Rule implementation that calls a method on an object on the stack
  * (normally the top/parent object), passing arguments collected from
@@ -96,9 +98,7 @@ public class CallMethodRule extends Rule {
 this.paramTypes = new Class[] { String.class };
 } else {
 this.paramTypes = new Class[paramCount];
-for (int i = 0; i < this.paramTypes.length; i++) {
-this.paramTypes[i] = String.class;
-}
+Arrays.fill(this.paramTypes, String.class);
 }
 }
 
@@ -135,16 +135,14 @@ public class CallMethodRule extends Rule {
  *  for a boolean parameter)
  */
 public CallMethodRule(int targetOffset, String methodName, int paramCount,
-Class paramTypes[]) {
+  Class[] paramTypes) {
 
 this.targetOffset = targetOffset;
 this.methodName = methodName;
 this.paramCount = paramCount;
 if (paramTypes == null) {
 this.paramTypes = new Class[paramCount];
-for (int i = 0; i < this.paramTypes.length; i++) {
-this.paramTypes[i] = String.class;
-}
+Arrays.fill(this.paramTypes, String.class);
 } else {
 this.paramTypes = new Class[paramTypes.length];
 System.arraycopy(paramTypes, 0, this.paramTypes, 0, 
this.paramTypes.length);
@@ -232,10 +230,7 @@ public class CallMethodRule extends Rule {
 
 // Push an array to capture the parameter values if necessary
 if (paramCount > 0) {
-Object parameters[] = new Object[paramCount];
-for (int i = 0; i < parameters.length; i++) {
-parameters[i] = null;
-}
+Object[] parameters = new Object[paramCount];
 digester.pushParams(parameters);
 }
 
diff --git a/java/org/apache/tomcat/util/json/JSONFilter.java 
b/java/org/apache/tomcat/util/json/JSONFilter.java
index cb255dc41b..

[tomcat] branch 10.1.x updated: Many improvements.

2023-02-16 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new f12a93ed10 Many improvements.
f12a93ed10 is described below

commit f12a93ed10fa01446417f76d90bc1fba5aa12c8a
Author: lihan 
AuthorDate: Fri Feb 17 11:30:53 2023 +0800

Many improvements.
---
 java/org/apache/coyote/ajp/AbstractAjpProtocol.java |  6 +-
 java/org/apache/coyote/ajp/AjpMessage.java  |  2 +-
 .../org/apache/tomcat/util/digester/CallMethodRule.java | 17 ++---
 java/org/apache/tomcat/util/json/JSONFilter.java|  4 ++--
 java/org/apache/tomcat/util/net/SSLUtilBase.java|  2 +-
 .../ciphers/OpenSSLCipherConfigurationParser.java   |  6 +++---
 .../apache/tomcat/util/scan/AbstractInputStreamJar.java |  4 ++--
 .../tomcat/util/xreflection/ReflectionProperty.java |  8 +++-
 .../tomcat/util/xreflection/SetPropertyClass.java   |  6 ++
 9 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java 
b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
index e822c29af9..d865ce831f 100644
--- a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
+++ b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
@@ -204,11 +204,7 @@ public abstract class AbstractAjpProtocol extends 
AbstractProtocol {
 private int packetSize = Constants.MAX_PACKET_SIZE;
 public int getPacketSize() { return packetSize; }
 public void setPacketSize(int packetSize) {
-if (packetSize < Constants.MAX_PACKET_SIZE) {
-this.packetSize = Constants.MAX_PACKET_SIZE;
-} else {
-this.packetSize = packetSize;
-}
+this.packetSize = Math.max(packetSize, Constants.MAX_PACKET_SIZE);
 }
 
 
diff --git a/java/org/apache/coyote/ajp/AjpMessage.java 
b/java/org/apache/coyote/ajp/AjpMessage.java
index 14d7e53cb9..f49a099125 100644
--- a/java/org/apache/coyote/ajp/AjpMessage.java
+++ b/java/org/apache/coyote/ajp/AjpMessage.java
@@ -398,7 +398,7 @@ public class AjpMessage {
 StringBuilder sb = new StringBuilder();
 for (int i = start; i < start + 16 ; i++) {
 if (i < len + 4) {
-sb.append(hex(buf[i]) + " ");
+sb.append(hex(buf[i])).append(" ");
 } else {
 sb.append("   ");
 }
diff --git a/java/org/apache/tomcat/util/digester/CallMethodRule.java 
b/java/org/apache/tomcat/util/digester/CallMethodRule.java
index bd65535dbc..3110c4450b 100644
--- a/java/org/apache/tomcat/util/digester/CallMethodRule.java
+++ b/java/org/apache/tomcat/util/digester/CallMethodRule.java
@@ -19,6 +19,8 @@ package org.apache.tomcat.util.digester;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.xml.sax.Attributes;
 
+import java.util.Arrays;
+
 /**
  * Rule implementation that calls a method on an object on the stack
  * (normally the top/parent object), passing arguments collected from
@@ -96,9 +98,7 @@ public class CallMethodRule extends Rule {
 this.paramTypes = new Class[] { String.class };
 } else {
 this.paramTypes = new Class[paramCount];
-for (int i = 0; i < this.paramTypes.length; i++) {
-this.paramTypes[i] = String.class;
-}
+Arrays.fill(this.paramTypes, String.class);
 }
 }
 
@@ -135,16 +135,14 @@ public class CallMethodRule extends Rule {
  *  for a boolean parameter)
  */
 public CallMethodRule(int targetOffset, String methodName, int paramCount,
-Class paramTypes[]) {
+  Class[] paramTypes) {
 
 this.targetOffset = targetOffset;
 this.methodName = methodName;
 this.paramCount = paramCount;
 if (paramTypes == null) {
 this.paramTypes = new Class[paramCount];
-for (int i = 0; i < this.paramTypes.length; i++) {
-this.paramTypes[i] = String.class;
-}
+Arrays.fill(this.paramTypes, String.class);
 } else {
 this.paramTypes = new Class[paramTypes.length];
 System.arraycopy(paramTypes, 0, this.paramTypes, 0, 
this.paramTypes.length);
@@ -232,10 +230,7 @@ public class CallMethodRule extends Rule {
 
 // Push an array to capture the parameter values if necessary
 if (paramCount > 0) {
-Object parameters[] = new Object[paramCount];
-for (int i = 0; i < parameters.length; i++) {
-parameters[i] = null;
-}
+Object[] parameters = new Object[paramCount];
 digester.pushParams(parameters);
 }
 
diff --git a/java/org/apache/tomcat/util/json/JSONFilter.java 
b/java/org/apache/tomcat/util/json/JSONFilter.java
index cb255dc

[tomcat] branch 9.0.x updated: Many improvements.

2023-02-16 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 0cc16359c6 Many improvements.
0cc16359c6 is described below

commit 0cc16359c69b98796f40a1d9951603df604412b4
Author: lihan 
AuthorDate: Fri Feb 17 11:30:53 2023 +0800

Many improvements.
---
 java/org/apache/coyote/ajp/AbstractAjpProtocol.java |  6 +-
 java/org/apache/coyote/ajp/AjpMessage.java  |  2 +-
 .../org/apache/tomcat/util/digester/CallMethodRule.java | 17 ++---
 java/org/apache/tomcat/util/json/JSONFilter.java|  4 ++--
 java/org/apache/tomcat/util/net/SSLUtilBase.java|  2 +-
 .../ciphers/OpenSSLCipherConfigurationParser.java   |  6 +++---
 .../apache/tomcat/util/scan/AbstractInputStreamJar.java |  4 ++--
 .../tomcat/util/xreflection/ReflectionProperty.java |  8 +++-
 .../tomcat/util/xreflection/SetPropertyClass.java   |  6 ++
 9 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java 
b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
index e822c29af9..d865ce831f 100644
--- a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
+++ b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
@@ -204,11 +204,7 @@ public abstract class AbstractAjpProtocol extends 
AbstractProtocol {
 private int packetSize = Constants.MAX_PACKET_SIZE;
 public int getPacketSize() { return packetSize; }
 public void setPacketSize(int packetSize) {
-if (packetSize < Constants.MAX_PACKET_SIZE) {
-this.packetSize = Constants.MAX_PACKET_SIZE;
-} else {
-this.packetSize = packetSize;
-}
+this.packetSize = Math.max(packetSize, Constants.MAX_PACKET_SIZE);
 }
 
 
diff --git a/java/org/apache/coyote/ajp/AjpMessage.java 
b/java/org/apache/coyote/ajp/AjpMessage.java
index 14d7e53cb9..f49a099125 100644
--- a/java/org/apache/coyote/ajp/AjpMessage.java
+++ b/java/org/apache/coyote/ajp/AjpMessage.java
@@ -398,7 +398,7 @@ public class AjpMessage {
 StringBuilder sb = new StringBuilder();
 for (int i = start; i < start + 16 ; i++) {
 if (i < len + 4) {
-sb.append(hex(buf[i]) + " ");
+sb.append(hex(buf[i])).append(" ");
 } else {
 sb.append("   ");
 }
diff --git a/java/org/apache/tomcat/util/digester/CallMethodRule.java 
b/java/org/apache/tomcat/util/digester/CallMethodRule.java
index bd65535dbc..3110c4450b 100644
--- a/java/org/apache/tomcat/util/digester/CallMethodRule.java
+++ b/java/org/apache/tomcat/util/digester/CallMethodRule.java
@@ -19,6 +19,8 @@ package org.apache.tomcat.util.digester;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.xml.sax.Attributes;
 
+import java.util.Arrays;
+
 /**
  * Rule implementation that calls a method on an object on the stack
  * (normally the top/parent object), passing arguments collected from
@@ -96,9 +98,7 @@ public class CallMethodRule extends Rule {
 this.paramTypes = new Class[] { String.class };
 } else {
 this.paramTypes = new Class[paramCount];
-for (int i = 0; i < this.paramTypes.length; i++) {
-this.paramTypes[i] = String.class;
-}
+Arrays.fill(this.paramTypes, String.class);
 }
 }
 
@@ -135,16 +135,14 @@ public class CallMethodRule extends Rule {
  *  for a boolean parameter)
  */
 public CallMethodRule(int targetOffset, String methodName, int paramCount,
-Class paramTypes[]) {
+  Class[] paramTypes) {
 
 this.targetOffset = targetOffset;
 this.methodName = methodName;
 this.paramCount = paramCount;
 if (paramTypes == null) {
 this.paramTypes = new Class[paramCount];
-for (int i = 0; i < this.paramTypes.length; i++) {
-this.paramTypes[i] = String.class;
-}
+Arrays.fill(this.paramTypes, String.class);
 } else {
 this.paramTypes = new Class[paramTypes.length];
 System.arraycopy(paramTypes, 0, this.paramTypes, 0, 
this.paramTypes.length);
@@ -232,10 +230,7 @@ public class CallMethodRule extends Rule {
 
 // Push an array to capture the parameter values if necessary
 if (paramCount > 0) {
-Object parameters[] = new Object[paramCount];
-for (int i = 0; i < parameters.length; i++) {
-parameters[i] = null;
-}
+Object[] parameters = new Object[paramCount];
 digester.pushParams(parameters);
 }
 
diff --git a/java/org/apache/tomcat/util/json/JSONFilter.java 
b/java/org/apache/tomcat/util/json/JSONFilter.java
index cb255dc41b..

[tomcat] branch main updated: Replace with JDK 1.8 Integer::compareUnsigned(int, int).

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

lihan 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 f459e9686e Replace with JDK 1.8 Integer::compareUnsigned(int, int).
f459e9686e is described below

commit f459e9686ebe2703379cdf4f182010f94f312b62
Author: lihan 
AuthorDate: Sun Feb 26 15:11:17 2023 +0800

Replace with JDK 1.8 Integer::compareUnsigned(int, int).
---
 .../apache/tomcat/util/codec/binary/BaseNCodec.java | 21 ++---
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java 
b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
index 0bfcf7312a..3575c992a8 100644
--- a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
+++ b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
@@ -148,23 +148,6 @@ public abstract class BaseNCodec {
  */
 static final byte[] CHUNK_SEPARATOR = {'\r', '\n'};
 
-/**
- * Compares two {@code int} values numerically treating the values
- * as unsigned. Taken from JDK 1.8.
- *
- * TODO: Replace with JDK 1.8 Integer::compareUnsigned(int, int).
- *
- * @param  x the first {@code int} to compare
- * @param  y the second {@code int} to compare
- * @return the value {@code 0} if {@code x == y}; a value less
- * than {@code 0} if {@code x < y} as unsigned values; and
- * a value greater than {@code 0} if {@code x > y} as
- * unsigned values
- */
-private static int compareUnsigned(final int x, final int y) {
-return Integer.compare(x + Integer.MIN_VALUE, y + Integer.MIN_VALUE);
-}
-
 /**
  * Create a positive capacity at least as large the minimum required 
capacity.
  * If the minimum capacity is negative then this throws an 
OutOfMemoryError as no array
@@ -201,10 +184,10 @@ public abstract class BaseNCodec {
 // Overflow-conscious code treats the min and new capacity as unsigned.
 final int oldCapacity = context.buffer.length;
 int newCapacity = oldCapacity * DEFAULT_BUFFER_RESIZE_FACTOR;
-if (compareUnsigned(newCapacity, minCapacity) < 0) {
+if (Integer.compareUnsigned(newCapacity, minCapacity) < 0) {
 newCapacity = minCapacity;
 }
-if (compareUnsigned(newCapacity, MAX_BUFFER_SIZE) > 0) {
+if (Integer.compareUnsigned(newCapacity, MAX_BUFFER_SIZE) > 0) {
 newCapacity = createPositiveCapacity(minCapacity);
 }
 


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



[tomcat] branch main updated: Update 'ide-intellij' target to overwrite old config.

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

lihan 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 ac55dde877 Update 'ide-intellij' target to overwrite old config.
ac55dde877 is described below

commit ac55dde877a20dd4abbd4de8fddea0303baa9091
Author: lihan 
AuthorDate: Sun Feb 26 15:53:22 2023 +0800

Update 'ide-intellij' target to overwrite old config.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index 862a62e730..00983bd2ca 100644
--- a/build.xml
+++ b/build.xml
@@ -3798,7 +3798,7 @@ Read the Building page on the Apache Tomcat documentation 
site for details on ho
   depends="download-compile, download-test-compile"
   description="Creates project directory .idea for IntelliJ IDEA">
 
-
+
   
   
   


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



[tomcat] 01/02: Replace with JDK 1.8 Integer::compareUnsigned(int, int).

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

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

commit 008abc31d4e68ef5b0f9bacd9b65b92d8f2a77d0
Author: lihan 
AuthorDate: Sun Feb 26 15:11:17 2023 +0800

Replace with JDK 1.8 Integer::compareUnsigned(int, int).
---
 .../apache/tomcat/util/codec/binary/BaseNCodec.java | 21 ++---
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java 
b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
index 0bfcf7312a..3575c992a8 100644
--- a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
+++ b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
@@ -148,23 +148,6 @@ public abstract class BaseNCodec {
  */
 static final byte[] CHUNK_SEPARATOR = {'\r', '\n'};
 
-/**
- * Compares two {@code int} values numerically treating the values
- * as unsigned. Taken from JDK 1.8.
- *
- * TODO: Replace with JDK 1.8 Integer::compareUnsigned(int, int).
- *
- * @param  x the first {@code int} to compare
- * @param  y the second {@code int} to compare
- * @return the value {@code 0} if {@code x == y}; a value less
- * than {@code 0} if {@code x < y} as unsigned values; and
- * a value greater than {@code 0} if {@code x > y} as
- * unsigned values
- */
-private static int compareUnsigned(final int x, final int y) {
-return Integer.compare(x + Integer.MIN_VALUE, y + Integer.MIN_VALUE);
-}
-
 /**
  * Create a positive capacity at least as large the minimum required 
capacity.
  * If the minimum capacity is negative then this throws an 
OutOfMemoryError as no array
@@ -201,10 +184,10 @@ public abstract class BaseNCodec {
 // Overflow-conscious code treats the min and new capacity as unsigned.
 final int oldCapacity = context.buffer.length;
 int newCapacity = oldCapacity * DEFAULT_BUFFER_RESIZE_FACTOR;
-if (compareUnsigned(newCapacity, minCapacity) < 0) {
+if (Integer.compareUnsigned(newCapacity, minCapacity) < 0) {
 newCapacity = minCapacity;
 }
-if (compareUnsigned(newCapacity, MAX_BUFFER_SIZE) > 0) {
+if (Integer.compareUnsigned(newCapacity, MAX_BUFFER_SIZE) > 0) {
 newCapacity = createPositiveCapacity(minCapacity);
 }
 


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



[tomcat] branch 10.1.x updated (c2f36c205f -> f8f5554b7a)

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

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


from c2f36c205f Fix previous merge. Missed a few changes.
 new 008abc31d4 Replace with JDK 1.8 Integer::compareUnsigned(int, int).
 new f8f5554b7a Update 'ide-intellij' target to overwrite old config.

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


Summary of changes:
 build.xml   |  2 +-
 .../apache/tomcat/util/codec/binary/BaseNCodec.java | 21 ++---
 2 files changed, 3 insertions(+), 20 deletions(-)


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



[tomcat] 02/02: Update 'ide-intellij' target to overwrite old config.

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

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

commit f8f5554b7abc9ba61234525c7251a4110826fee7
Author: lihan 
AuthorDate: Sun Feb 26 15:53:22 2023 +0800

Update 'ide-intellij' target to overwrite old config.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index bea41a87e3..ccc18a4229 100644
--- a/build.xml
+++ b/build.xml
@@ -3834,7 +3834,7 @@ Read the Building page on the Apache Tomcat documentation 
site for details on ho
   depends="download-compile, download-test-compile"
   description="Creates project directory .idea for IntelliJ IDEA">
 
-
+
   
   
   


-
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 (90a3050e93 -> 84bf5da3a6)

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

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


from 90a3050e93 Refactor to reduce native calls
 new 75d1d8736d Replace with JDK 1.8 Integer::compareUnsigned(int, int).
 new 84bf5da3a6 Update 'ide-intellij' target to overwrite old config.

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


Summary of changes:
 build.xml   |  2 +-
 .../apache/tomcat/util/codec/binary/BaseNCodec.java | 21 ++---
 2 files changed, 3 insertions(+), 20 deletions(-)


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



[tomcat] 02/02: Update 'ide-intellij' target to overwrite old config.

2023-02-25 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

commit 84bf5da3a6c8aac36b88b1e512e72df1278160d7
Author: lihan 
AuthorDate: Sun Feb 26 15:53:22 2023 +0800

Update 'ide-intellij' target to overwrite old config.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index b420c2a59d..e07317e76d 100644
--- a/build.xml
+++ b/build.xml
@@ -3758,7 +3758,7 @@ Read the Building page on the Apache Tomcat documentation 
site for details on ho
   depends="download-compile, download-test-compile"
   description="Creates project directory .idea for IntelliJ IDEA">
 
-
+
   
   
   


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



[tomcat] 01/02: Replace with JDK 1.8 Integer::compareUnsigned(int, int).

2023-02-25 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

commit 75d1d8736d1bb8d1b43eeb228b1df3ca352ede57
Author: lihan 
AuthorDate: Sun Feb 26 15:11:17 2023 +0800

Replace with JDK 1.8 Integer::compareUnsigned(int, int).
---
 .../apache/tomcat/util/codec/binary/BaseNCodec.java | 21 ++---
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java 
b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
index a234da2f0c..32eaa33e5b 100644
--- a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
+++ b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
@@ -160,23 +160,6 @@ public abstract class BaseNCodec {
  */
 static final byte[] CHUNK_SEPARATOR = {'\r', '\n'};
 
-/**
- * Compares two {@code int} values numerically treating the values
- * as unsigned. Taken from JDK 1.8.
- *
- * TODO: Replace with JDK 1.8 Integer::compareUnsigned(int, int).
- *
- * @param  x the first {@code int} to compare
- * @param  y the second {@code int} to compare
- * @return the value {@code 0} if {@code x == y}; a value less
- * than {@code 0} if {@code x < y} as unsigned values; and
- * a value greater than {@code 0} if {@code x > y} as
- * unsigned values
- */
-private static int compareUnsigned(final int x, final int y) {
-return Integer.compare(x + Integer.MIN_VALUE, y + Integer.MIN_VALUE);
-}
-
 /**
  * Create a positive capacity at least as large the minimum required 
capacity.
  * If the minimum capacity is negative then this throws an 
OutOfMemoryError as no array
@@ -243,10 +226,10 @@ public abstract class BaseNCodec {
 // Overflow-conscious code treats the min and new capacity as unsigned.
 final int oldCapacity = context.buffer.length;
 int newCapacity = oldCapacity * DEFAULT_BUFFER_RESIZE_FACTOR;
-if (compareUnsigned(newCapacity, minCapacity) < 0) {
+if (Integer.compareUnsigned(newCapacity, minCapacity) < 0) {
 newCapacity = minCapacity;
 }
-if (compareUnsigned(newCapacity, MAX_BUFFER_SIZE) > 0) {
+if (Integer.compareUnsigned(newCapacity, MAX_BUFFER_SIZE) > 0) {
 newCapacity = createPositiveCapacity(minCapacity);
 }
 


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



[tomcat] branch main updated: Fix a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.

2023-02-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 012f619108 Fix a bug that memory allocation is larger than limit in 
SynchronizedStack to reduce memory footprint.
012f619108 is described below

commit 012f61910889dee66c6d50d732fab9bb1d09
Author: lihan 
AuthorDate: Mon Feb 27 16:25:42 2023 +0800

Fix a bug that memory allocation is larger than limit in SynchronizedStack 
to reduce memory footprint.
---
 java/org/apache/tomcat/util/collections/SynchronizedStack.java | 2 +-
 webapps/docs/changelog.xml | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/collections/SynchronizedStack.java 
b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
index f178b02048..526c44cef5 100644
--- a/java/org/apache/tomcat/util/collections/SynchronizedStack.java
+++ b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
@@ -52,7 +52,7 @@ public class SynchronizedStack {
 this.size = size;
 }
 this.limit = limit;
-stack = new Object[size];
+stack = new Object[this.size];
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e7eb32f1dd..eeb833999e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Fix a bug that memory allocation is larger than limit in
+SynchronizedStack to reduce memory footprint. (lihan)
+  
+
+  
   
 
   


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



[tomcat] branch 10.1.x updated: Fix a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.

2023-02-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 4269d2b05a Fix a bug that memory allocation is larger than limit in 
SynchronizedStack to reduce memory footprint.
4269d2b05a is described below

commit 4269d2b05abe7e182dfb46b30dc253271a58e71b
Author: lihan 
AuthorDate: Mon Feb 27 16:25:42 2023 +0800

Fix a bug that memory allocation is larger than limit in SynchronizedStack 
to reduce memory footprint.
---
 java/org/apache/tomcat/util/collections/SynchronizedStack.java | 2 +-
 webapps/docs/changelog.xml | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/collections/SynchronizedStack.java 
b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
index f178b02048..526c44cef5 100644
--- a/java/org/apache/tomcat/util/collections/SynchronizedStack.java
+++ b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
@@ -52,7 +52,7 @@ public class SynchronizedStack {
 this.size = size;
 }
 this.limit = limit;
-stack = new Object[size];
+stack = new Object[this.size];
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 621d701767..729ed8f22a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Fix a bug that memory allocation is larger than limit in
+SynchronizedStack to reduce memory footprint. (lihan)
+  
+
+  
   
 
   


-
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 a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.

2023-02-27 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 9b02ef12d9 Fix a bug that memory allocation is larger than limit in 
SynchronizedStack to reduce memory footprint.
9b02ef12d9 is described below

commit 9b02ef12d9507716228cf7df9e7b3e568d76d1b8
Author: lihan 
AuthorDate: Mon Feb 27 16:28:33 2023 +0800

Fix a bug that memory allocation is larger than limit in SynchronizedStack 
to reduce memory footprint.
---
 java/org/apache/tomcat/util/collections/SynchronizedStack.java | 2 +-
 webapps/docs/changelog.xml | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/collections/SynchronizedStack.java 
b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
index f178b02048..526c44cef5 100644
--- a/java/org/apache/tomcat/util/collections/SynchronizedStack.java
+++ b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
@@ -52,7 +52,7 @@ public class SynchronizedStack {
 this.size = size;
 }
 this.limit = limit;
-stack = new Object[size];
+stack = new Object[this.size];
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ff565d2628..96c55f827a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Fix a bug that memory allocation is larger than limit in
+SynchronizedStack to reduce memory footprint. (lihan)
+  
+
+  
   
 
   


-
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 a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.

2023-02-27 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 dadd323662 Fix a bug that memory allocation is larger than limit in 
SynchronizedStack to reduce memory footprint.
dadd323662 is described below

commit dadd323662a52e4ef7d7c0f37cac477fb106502e
Author: lihan 
AuthorDate: Mon Feb 27 16:29:31 2023 +0800

Fix a bug that memory allocation is larger than limit in SynchronizedStack 
to reduce memory footprint.
---
 java/org/apache/tomcat/util/collections/SynchronizedStack.java | 2 +-
 webapps/docs/changelog.xml | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/collections/SynchronizedStack.java 
b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
index f178b02048..526c44cef5 100644
--- a/java/org/apache/tomcat/util/collections/SynchronizedStack.java
+++ b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
@@ -52,7 +52,7 @@ public class SynchronizedStack {
 this.size = size;
 }
 this.limit = limit;
-stack = new Object[size];
+stack = new Object[this.size];
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index da9612398f..27095f5b27 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Fix a bug that memory allocation is larger than limit in
+SynchronizedStack to reduce memory footprint. (lihan)
+  
+
+  
   
 
   


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



[tomcat] branch main updated: Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2ee1135c46 Fix BZ 66507 - Catalina version command not honoring 
JAVA_OPTS variable
2ee1135c46 is described below

commit 2ee1135c46654ff366b50077ef0bce7090666dfa
Author: lihan 
AuthorDate: Tue Mar 7 11:38:51 2023 +0800

Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

Patch suggested by Eric Hamilton
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507
---
 bin/catalina.bat | 2 +-
 bin/catalina.sh  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/catalina.bat b/bin/catalina.bat
index 068cd283bc..6350932852 100755
--- a/bin/catalina.bat
+++ b/bin/catalina.bat
@@ -304,7 +304,7 @@ set CATALINA_OPTS=
 goto execCmd
 
 :doVersion
-%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
+%_EXECJAVA% %JAVA_OPTS% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
 goto end
 
 
diff --git a/bin/catalina.sh b/bin/catalina.sh
index a7b14b6957..33649fac27 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -562,9 +562,9 @@ elif [ "$1" = "configtest" ] ; then
 
 elif [ "$1" = "version" ] ; then
 
-"$_RUNJAVA"   \
-  -classpath "$CATALINA_HOME/lib/catalina.jar" \
-  org.apache.catalina.util.ServerInfo
+   eval "\"$_RUNJAVA\"" "$JAVA_OPTS" \
+ -classpath "\"$CATALINA_HOME/lib/catalina.jar\"" \
+ org.apache.catalina.util.ServerInfo
 
 else
 


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



[tomcat] branch 10.1.x updated: Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new c4acd4faa9 Fix BZ 66507 - Catalina version command not honoring 
JAVA_OPTS variable
c4acd4faa9 is described below

commit c4acd4faa9b297dfffecc82df0b1a4dc4479d067
Author: lihan 
AuthorDate: Tue Mar 7 11:38:51 2023 +0800

Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

Patch suggested by Eric Hamilton
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507
---
 bin/catalina.bat | 2 +-
 bin/catalina.sh  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/catalina.bat b/bin/catalina.bat
index 824773b460..a5cf1a92f6 100755
--- a/bin/catalina.bat
+++ b/bin/catalina.bat
@@ -324,7 +324,7 @@ set CATALINA_OPTS=
 goto execCmd
 
 :doVersion
-%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
+%_EXECJAVA% %JAVA_OPTS% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
 goto end
 
 
diff --git a/bin/catalina.sh b/bin/catalina.sh
index a15accbdb5..32f87ffb6f 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -614,9 +614,9 @@ elif [ "$1" = "configtest" ] ; then
 
 elif [ "$1" = "version" ] ; then
 
-"$_RUNJAVA"   \
-  -classpath "$CATALINA_HOME/lib/catalina.jar" \
-  org.apache.catalina.util.ServerInfo
+   eval "\"$_RUNJAVA\"" "$JAVA_OPTS" \
+ -classpath "\"$CATALINA_HOME/lib/catalina.jar\"" \
+ org.apache.catalina.util.ServerInfo
 
 else
 


-
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 BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

2023-03-06 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 33b47cf5eb Fix BZ 66507 - Catalina version command not honoring 
JAVA_OPTS variable
33b47cf5eb is described below

commit 33b47cf5ebcbcfbc91e2923e82d3f5aeae423aa3
Author: lihan 
AuthorDate: Tue Mar 7 11:38:51 2023 +0800

Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

Patch suggested by Eric Hamilton
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507
---
 bin/catalina.bat | 2 +-
 bin/catalina.sh  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/catalina.bat b/bin/catalina.bat
index 282aefcfd2..84a5f39b48 100755
--- a/bin/catalina.bat
+++ b/bin/catalina.bat
@@ -356,7 +356,7 @@ set CATALINA_OPTS=
 goto execCmd
 
 :doVersion
-%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
+%_EXECJAVA% %JAVA_OPTS% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
 goto end
 
 
diff --git a/bin/catalina.sh b/bin/catalina.sh
index d738853938..3a2ffdafa0 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -656,9 +656,9 @@ elif [ "$1" = "configtest" ] ; then
 
 elif [ "$1" = "version" ] ; then
 
-"$_RUNJAVA"   \
-  -classpath "$CATALINA_HOME/lib/catalina.jar" \
-  org.apache.catalina.util.ServerInfo
+   eval "\"$_RUNJAVA\"" "$JAVA_OPTS" \
+ -classpath "\"$CATALINA_HOME/lib/catalina.jar\"" \
+ org.apache.catalina.util.ServerInfo
 
 else
 


-
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 BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

2023-03-06 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 04174d9307 Fix BZ 66507 - Catalina version command not honoring 
JAVA_OPTS variable
04174d9307 is described below

commit 04174d9307893cf4cdda8e0761a62e71758edd0f
Author: lihan 
AuthorDate: Tue Mar 7 11:38:51 2023 +0800

Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

Patch suggested by Eric Hamilton
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507
---
 bin/catalina.bat | 2 +-
 bin/catalina.sh  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/catalina.bat b/bin/catalina.bat
index 282aefcfd2..84a5f39b48 100755
--- a/bin/catalina.bat
+++ b/bin/catalina.bat
@@ -356,7 +356,7 @@ set CATALINA_OPTS=
 goto execCmd
 
 :doVersion
-%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
+%_EXECJAVA% %JAVA_OPTS% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
 goto end
 
 
diff --git a/bin/catalina.sh b/bin/catalina.sh
index d738853938..3a2ffdafa0 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -656,9 +656,9 @@ elif [ "$1" = "configtest" ] ; then
 
 elif [ "$1" = "version" ] ; then
 
-"$_RUNJAVA"   \
-  -classpath "$CATALINA_HOME/lib/catalina.jar" \
-  org.apache.catalina.util.ServerInfo
+   eval "\"$_RUNJAVA\"" "$JAVA_OPTS" \
+ -classpath "\"$CATALINA_HOME/lib/catalina.jar\"" \
+ org.apache.catalina.util.ServerInfo
 
 else
 


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



[tomcat] branch main updated: Align with spec

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 1fc4b7c95d Align with spec
1fc4b7c95d is described below

commit 1fc4b7c95dce1db3d86db9393c78023b93725f63
Author: lihan 
AuthorDate: Tue Mar 7 14:16:53 2023 +0800

Align with spec
---
 java/jakarta/servlet/http/HttpFilter.java | 130 --
 1 file changed, 86 insertions(+), 44 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 4c7154bea6..14d14b35b0 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -25,63 +25,105 @@ import jakarta.servlet.ServletRequest;
 import jakarta.servlet.ServletResponse;
 
 /**
- * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
- * HttpServletRequest and HttpServletResponse respectively.
+ *
+ * 
+ * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
+ * HttpFilter should override
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
+ * 
+ *
+ * 
+ * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
+ * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
+ * variables and external objects such as files, database connections, and 
network connections. See the
+ * https://docs.oracle.com/javase/tutorial/essential/concurrency/";> 
Java Tutorial on Multithreaded
+ * Programming for more information on handling multiple threads in a Java 
program.
+ *
+ * @author Various
+ *
+ * @since Servlet 4.0
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 1L;
+private static final long serialVersionUID = 7478463438252262094L;
+
+/**
+ * 
+ * Does nothing, because this is an abstract class.
+ * 
+ *
+ * @since Servlet 4.0
+ */
+public HttpFilter() {
+}
 
 /**
- * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
- * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
- * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
- * thrown.
  *
- * @throws ServletException If either the request or response are not of 
the expected types or any other error
- *  occurs
+ * 
+ * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
+ * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
+ * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
+ * override this method.
+ * 
+ *
+ * 
+ * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
+ * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
+ * {@link ServletException} is thrown. Otherwise, the protected
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
+ * method is called.
+ * 
+ *
+ * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
+ *
+ * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
+ *
+ * @param chain the FilterChain for invoking the next filter 
or the resource
+ *
+ * @throws IOException if an input or output error is detected when the 
filter handles the request
+ *
+ * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
+ * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
+ *
+ * @since Servlet 4.0
  */
 @Override
-public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
-throws IOException, ServletException {
-if (!(request instanceof HttpServletRequest)) {
-throw new ServletException(request + " not HttpServletRequest");
-}
-if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+public void doFilter(ServletRequest req, Servle

[tomcat] branch 10.1.x updated: Align with spec

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 5f0a1b92f6 Align with spec
5f0a1b92f6 is described below

commit 5f0a1b92f685b86c00ce6ca18b779b42e562f517
Author: lihan 
AuthorDate: Tue Mar 7 14:16:53 2023 +0800

Align with spec
---
 java/jakarta/servlet/http/HttpFilter.java | 130 --
 1 file changed, 86 insertions(+), 44 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 4c7154bea6..14d14b35b0 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -25,63 +25,105 @@ import jakarta.servlet.ServletRequest;
 import jakarta.servlet.ServletResponse;
 
 /**
- * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
- * HttpServletRequest and HttpServletResponse respectively.
+ *
+ * 
+ * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
+ * HttpFilter should override
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
+ * 
+ *
+ * 
+ * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
+ * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
+ * variables and external objects such as files, database connections, and 
network connections. See the
+ * https://docs.oracle.com/javase/tutorial/essential/concurrency/";> 
Java Tutorial on Multithreaded
+ * Programming for more information on handling multiple threads in a Java 
program.
+ *
+ * @author Various
+ *
+ * @since Servlet 4.0
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 1L;
+private static final long serialVersionUID = 7478463438252262094L;
+
+/**
+ * 
+ * Does nothing, because this is an abstract class.
+ * 
+ *
+ * @since Servlet 4.0
+ */
+public HttpFilter() {
+}
 
 /**
- * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
- * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
- * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
- * thrown.
  *
- * @throws ServletException If either the request or response are not of 
the expected types or any other error
- *  occurs
+ * 
+ * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
+ * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
+ * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
+ * override this method.
+ * 
+ *
+ * 
+ * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
+ * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
+ * {@link ServletException} is thrown. Otherwise, the protected
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
+ * method is called.
+ * 
+ *
+ * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
+ *
+ * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
+ *
+ * @param chain the FilterChain for invoking the next filter 
or the resource
+ *
+ * @throws IOException if an input or output error is detected when the 
filter handles the request
+ *
+ * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
+ * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
+ *
+ * @since Servlet 4.0
  */
 @Override
-public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
-throws IOException, ServletException {
-if (!(request instanceof HttpServletRequest)) {
-throw new ServletException(request + " not HttpServletRequest");
-}
-if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+public void doFilter(ServletRequest req, Servle

[tomcat] branch 9.0.x updated: Align with spec

2023-03-06 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 e6cb59c0a7 Align with spec
e6cb59c0a7 is described below

commit e6cb59c0a730d4a5974f8a2e4c1a02946a1be793
Author: lihan 
AuthorDate: Tue Mar 7 14:16:53 2023 +0800

Align with spec
---
 java/javax/servlet/http/HttpFilter.java | 130 +---
 1 file changed, 86 insertions(+), 44 deletions(-)

diff --git a/java/javax/servlet/http/HttpFilter.java 
b/java/javax/servlet/http/HttpFilter.java
index 40394a6343..f1db79c090 100644
--- a/java/javax/servlet/http/HttpFilter.java
+++ b/java/javax/servlet/http/HttpFilter.java
@@ -25,63 +25,105 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
 /**
- * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
- * HttpServletRequest and HttpServletResponse respectively.
+ *
+ * 
+ * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
+ * HttpFilter should override
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
+ * 
+ *
+ * 
+ * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
+ * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
+ * variables and external objects such as files, database connections, and 
network connections. See the
+ * https://docs.oracle.com/javase/tutorial/essential/concurrency/";> 
Java Tutorial on Multithreaded
+ * Programming for more information on handling multiple threads in a Java 
program.
+ *
+ * @author Various
+ *
+ * @since Servlet 4.0
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 1L;
+private static final long serialVersionUID = 7478463438252262094L;
+
+/**
+ * 
+ * Does nothing, because this is an abstract class.
+ * 
+ *
+ * @since Servlet 4.0
+ */
+public HttpFilter() {
+}
 
 /**
- * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
- * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
- * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
- * thrown.
  *
- * @throws ServletException If either the request or response are not of 
the expected types or any other error
- *  occurs
+ * 
+ * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
+ * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
+ * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
+ * override this method.
+ * 
+ *
+ * 
+ * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
+ * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
+ * {@link ServletException} is thrown. Otherwise, the protected
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
+ * method is called.
+ * 
+ *
+ * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
+ *
+ * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
+ *
+ * @param chain the FilterChain for invoking the next filter 
or the resource
+ *
+ * @throws IOException if an input or output error is detected when the 
filter handles the request
+ *
+ * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
+ * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
+ *
+ * @since Servlet 4.0
  */
 @Override
-public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
-throws IOException, ServletException {
-if (!(request instanceof HttpServletRequest)) {
-throw new ServletException(request + " not HttpServletRequest");
-}
-if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+public void doFilter(ServletRequest req, Servle

[tomcat] branch 9.0.x updated: Fix wrong namespace.

2023-03-06 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 32a7fe4ea4 Fix wrong namespace.
32a7fe4ea4 is described below

commit 32a7fe4ea481b9630ddda9df78f593bb33e57638
Author: lihan 
AuthorDate: Tue Mar 7 14:28:13 2023 +0800

Fix wrong namespace.
---
 java/javax/servlet/http/HttpFilter.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/javax/servlet/http/HttpFilter.java 
b/java/javax/servlet/http/HttpFilter.java
index f1db79c090..f9b37eb635 100644
--- a/java/javax/servlet/http/HttpFilter.java
+++ b/java/javax/servlet/http/HttpFilter.java
@@ -29,7 +29,7 @@ import javax.servlet.ServletResponse;
  * 
  * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
  * HttpFilter should override
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
+ * {@link #doFilter(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) }.
  * 
  *
  * 
@@ -70,7 +70,7 @@ public abstract class HttpFilter extends GenericFilter {
  * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
  * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
  * {@link ServletException} is thrown. Otherwise, the protected
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
+ * {@link #doFilter(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)}
  * method is called.
  * 
  *


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



[tomcat] branch main updated: Revert "Align with spec"

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 e020b669a5 Revert "Align with spec"
e020b669a5 is described below

commit e020b669a5792a64c79eedb75751907aee2aa4d3
Author: lihan 
AuthorDate: Tue Mar 7 15:18:10 2023 +0800

Revert "Align with spec"

This reverts commit 1fc4b7c95dce1db3d86db9393c78023b93725f63.
---
 java/jakarta/servlet/http/HttpFilter.java | 130 ++
 1 file changed, 44 insertions(+), 86 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 14d14b35b0..4c7154bea6 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -25,105 +25,63 @@ import jakarta.servlet.ServletRequest;
 import jakarta.servlet.ServletResponse;
 
 /**
- *
- * 
- * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
- * HttpFilter should override
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
- * 
- *
- * 
- * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
- * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
- * variables and external objects such as files, database connections, and 
network connections. See the
- * https://docs.oracle.com/javase/tutorial/essential/concurrency/";> 
Java Tutorial on Multithreaded
- * Programming for more information on handling multiple threads in a Java 
program.
- *
- * @author Various
- *
- * @since Servlet 4.0
+ * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
+ * HttpServletRequest and HttpServletResponse respectively.
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 7478463438252262094L;
-
-/**
- * 
- * Does nothing, because this is an abstract class.
- * 
- *
- * @since Servlet 4.0
- */
-public HttpFilter() {
-}
+private static final long serialVersionUID = 1L;
 
 /**
+ * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
+ * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
+ * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
+ * thrown.
  *
- * 
- * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
- * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
- * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
- * override this method.
- * 
- *
- * 
- * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
- * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
- * {@link ServletException} is thrown. Otherwise, the protected
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
- * method is called.
- * 
- *
- * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
- *
- * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
- *
- * @param chain the FilterChain for invoking the next filter 
or the resource
- *
- * @throws IOException if an input or output error is detected when the 
filter handles the request
- *
- * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
- * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
- *
- * @since Servlet 4.0
+ * @throws ServletException If either the request or response are not of 
the expected types or any other error
+ *  occurs
  */
 @Override
-public void doFilter(ServletRequest req, ServletResponse res, FilterChain 
chain)
-throws IOException, ServletException {
-if (!(req instanceof HttpServletRequest && res instanceof 
HttpServletResponse)) {
-throw new ServletException("non-HTTP request or response");
+public void doFilter(ServletRequest request, ServletResponse response, 

[tomcat] branch 10.1.x updated: Revert "Align with spec"

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 7e7f1f98e7 Revert "Align with spec"
7e7f1f98e7 is described below

commit 7e7f1f98e7d5717feaa2dae169d34374cb3cea53
Author: lihan 
AuthorDate: Tue Mar 7 15:20:13 2023 +0800

Revert "Align with spec"

This reverts commit 5f0a1b92f685b86c00ce6ca18b779b42e562f517.
---
 java/jakarta/servlet/http/HttpFilter.java | 130 ++
 1 file changed, 44 insertions(+), 86 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 14d14b35b0..4c7154bea6 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -25,105 +25,63 @@ import jakarta.servlet.ServletRequest;
 import jakarta.servlet.ServletResponse;
 
 /**
- *
- * 
- * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
- * HttpFilter should override
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
- * 
- *
- * 
- * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
- * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
- * variables and external objects such as files, database connections, and 
network connections. See the
- * https://docs.oracle.com/javase/tutorial/essential/concurrency/";> 
Java Tutorial on Multithreaded
- * Programming for more information on handling multiple threads in a Java 
program.
- *
- * @author Various
- *
- * @since Servlet 4.0
+ * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
+ * HttpServletRequest and HttpServletResponse respectively.
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 7478463438252262094L;
-
-/**
- * 
- * Does nothing, because this is an abstract class.
- * 
- *
- * @since Servlet 4.0
- */
-public HttpFilter() {
-}
+private static final long serialVersionUID = 1L;
 
 /**
+ * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
+ * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
+ * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
+ * thrown.
  *
- * 
- * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
- * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
- * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
- * override this method.
- * 
- *
- * 
- * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
- * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
- * {@link ServletException} is thrown. Otherwise, the protected
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
- * method is called.
- * 
- *
- * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
- *
- * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
- *
- * @param chain the FilterChain for invoking the next filter 
or the resource
- *
- * @throws IOException if an input or output error is detected when the 
filter handles the request
- *
- * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
- * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
- *
- * @since Servlet 4.0
+ * @throws ServletException If either the request or response are not of 
the expected types or any other error
+ *  occurs
  */
 @Override
-public void doFilter(ServletRequest req, ServletResponse res, FilterChain 
chain)
-throws IOException, ServletException {
-if (!(req instanceof HttpServletRequest && res instanceof 
HttpServletResponse)) {
-throw new ServletException("non-HTTP request or response");
+public void doFilter(ServletRequest request, ServletResponse response, 

[tomcat] branch 9.0.x updated: Revert "Align with spec"

2023-03-06 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 1f81fd0367 Revert "Align with spec"
1f81fd0367 is described below

commit 1f81fd0367cd2a304873d5290e54dfbd2be447e7
Author: lihan 
AuthorDate: Tue Mar 7 15:22:39 2023 +0800

Revert "Align with spec"

This reverts commit e6cb59c0
---
 java/javax/servlet/http/HttpFilter.java | 130 +++-
 1 file changed, 44 insertions(+), 86 deletions(-)

diff --git a/java/javax/servlet/http/HttpFilter.java 
b/java/javax/servlet/http/HttpFilter.java
index f9b37eb635..40394a6343 100644
--- a/java/javax/servlet/http/HttpFilter.java
+++ b/java/javax/servlet/http/HttpFilter.java
@@ -25,105 +25,63 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
 /**
- *
- * 
- * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
- * HttpFilter should override
- * {@link #doFilter(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) }.
- * 
- *
- * 
- * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
- * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
- * variables and external objects such as files, database connections, and 
network connections. See the
- * https://docs.oracle.com/javase/tutorial/essential/concurrency/";> 
Java Tutorial on Multithreaded
- * Programming for more information on handling multiple threads in a Java 
program.
- *
- * @author Various
- *
- * @since Servlet 4.0
+ * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
+ * HttpServletRequest and HttpServletResponse respectively.
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 7478463438252262094L;
-
-/**
- * 
- * Does nothing, because this is an abstract class.
- * 
- *
- * @since Servlet 4.0
- */
-public HttpFilter() {
-}
+private static final long serialVersionUID = 1L;
 
 /**
+ * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
+ * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
+ * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
+ * thrown.
  *
- * 
- * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
- * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
- * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
- * override this method.
- * 
- *
- * 
- * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
- * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
- * {@link ServletException} is thrown. Otherwise, the protected
- * {@link #doFilter(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)}
- * method is called.
- * 
- *
- * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
- *
- * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
- *
- * @param chain the FilterChain for invoking the next filter 
or the resource
- *
- * @throws IOException if an input or output error is detected when the 
filter handles the request
- *
- * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
- * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
- *
- * @since Servlet 4.0
+ * @throws ServletException If either the request or response are not of 
the expected types or any other error
+ *  occurs
  */
 @Override
-public void doFilter(ServletRequest req, ServletResponse res, FilterChain 
chain)
-throws IOException, ServletException {
-if (!(req instanceof HttpServletRequest && res instanceof 
HttpServletResponse)) {
-throw new ServletException("non-HTTP request or response");
+public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
+throws IOException, S

[tomcat] branch 10.1.x updated: Fix wrong exception message.#595

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 4958e268c1 Fix wrong exception message.#595
4958e268c1 is described below

commit 4958e268c16bd6fc49e71db23f202f72b935ed3d
Author: lihan 
AuthorDate: Tue Mar 7 16:47:29 2023 +0800

Fix wrong exception message.#595
---
 java/jakarta/servlet/http/HttpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 4c7154bea6..b02a306dbf 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -48,7 +48,7 @@ public abstract class HttpFilter extends GenericFilter {
 throw new ServletException(request + " not HttpServletRequest");
 }
 if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+throw new ServletException(response + " not HttpServletResponse");
 }
 doFilter((HttpServletRequest) request, (HttpServletResponse) response, 
chain);
 }


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



[tomcat] branch main updated (e020b669a5 -> 154fdc5636)

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


from e020b669a5 Revert "Align with spec"
 add 154fdc5636 Fix wrong exception message.#595

No new revisions were added by this update.

Summary of changes:
 java/jakarta/servlet/http/HttpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


-
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 wrong exception message.#595

2023-03-07 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 c3bc80cebf Fix wrong exception message.#595
c3bc80cebf is described below

commit c3bc80cebf12b2425562a042aed3c9d58ee99448
Author: lihan 
AuthorDate: Tue Mar 7 16:47:29 2023 +0800

Fix wrong exception message.#595
---
 java/javax/servlet/http/HttpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/javax/servlet/http/HttpFilter.java 
b/java/javax/servlet/http/HttpFilter.java
index 40394a6343..11ad7a2326 100644
--- a/java/javax/servlet/http/HttpFilter.java
+++ b/java/javax/servlet/http/HttpFilter.java
@@ -48,7 +48,7 @@ public abstract class HttpFilter extends GenericFilter {
 throw new ServletException(request + " not HttpServletRequest");
 }
 if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+throw new ServletException(response + " not HttpServletResponse");
 }
 doFilter((HttpServletRequest) request, (HttpServletResponse) response, 
chain);
 }


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



[tomcat] branch main updated: Add a changelog entry.

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 b189ac03df Add a changelog entry.
b189ac03df is described below

commit b189ac03df02e00d44001c8181886466ead62eb4
Author: lihan 
AuthorDate: Tue Mar 7 17:12:19 2023 +0800

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

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0bcbfc81d9..7efb35c2e1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -162,6 +162,11 @@
 Refactor code using MD5Encoder to use
 HexUtils.toHexString(). (markt)
   
+  
+66507: Fix a bug that $JAVA_OPTS is not passed
+to the jvm in catalina.sh when calling 
version.
+Patch suggested by Eric Hamilton. (lihan)
+  
 
   
 


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



[tomcat] branch 10.1.x updated: Add a changelog entry.

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


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

commit 43cf5dc73c86a6e2a037a7ee068d5654455ef0e1
Author: lihan 
AuthorDate: Tue Mar 7 17:12:19 2023 +0800

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

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f2718b42d0..3018a49ad2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -152,6 +152,11 @@
 Refactor code using MD5Encoder to use
 HexUtils.toHexString(). (markt)
   
+  
+66507: Fix a bug that $JAVA_OPTS is not passed
+to the jvm in catalina.sh when calling 
version.
+Patch suggested by Eric Hamilton. (lihan)
+  
 
   
 


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



[tomcat] branch 9.0.x updated: Add a changelog entry.

2023-03-07 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 9e14971e48 Add a changelog entry.
9e14971e48 is described below

commit 9e14971e4874a979c93cb6c10faf583f385f9cc6
Author: lihan 
AuthorDate: Tue Mar 7 17:12:19 2023 +0800

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

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a8ae064e76..f9e1d61715 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -152,6 +152,11 @@
 Refactor code using MD5Encoder to use
 HexUtils.toHexString(). (markt)
   
+  
+66507: Fix a bug that $JAVA_OPTS is not passed
+to the jvm in catalina.sh when calling 
version.
+Patch suggested by Eric Hamilton. (lihan)
+  
 
   
 


-
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: Add a changelog entry.

2023-03-07 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 c41187f75e Add a changelog entry.
c41187f75e is described below

commit c41187f75e88eec0d0dfb35f6b06b8f9f7e6080a
Author: lihan 
AuthorDate: Tue Mar 7 17:12:19 2023 +0800

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

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8494481a8d..affc066fa7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -152,6 +152,11 @@
 Refactor code using MD5Encoder to use
 HexUtils.toHexString(). (markt)
   
+  
+66507: Fix a bug that $JAVA_OPTS is not passed
+to the jvm in catalina.sh when calling 
version.
+Patch suggested by Eric Hamilton. (lihan)
+  
 
   
 


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



[tomcat] branch main updated: Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

2023-03-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c8fba3264d Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)
c8fba3264d is described below

commit c8fba3264d0c75637a44eb403d10b163384981e7
Author: lihan 
AuthorDate: Fri Mar 10 15:22:50 2023 +0800

Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

Submitted by Andrei Briukhov
---
 conf/web.xml  | 4 ++--
 java/org/apache/catalina/servlets/CGIServlet.java | 4 ++--
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 2 +-
 webapps/docs/cgi-howto.xml| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index 00acceb763..1a5cbfecd0 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -359,7 +359,7 @@
   
   
   
-  
+  
   
   
   
@@ -370,7 +370,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java 
b/java/org/apache/catalina/servlets/CGIServlet.java
index d0755c6fdd..e1cda7bb97 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -255,7 +255,7 @@ public final class CGIServlet extends HttpServlet {
 DEFAULT_SUPER_METHODS.add("TRACE");
 
 if (JrePlatform.IS_WINDOWS) {
-DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 } else {
 // No restrictions
 DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = null;
@@ -324,7 +324,7 @@ public final class CGIServlet extends HttpServlet {
  * Uses \Q...\E to avoid individual quoting.
  */
 private Pattern cmdLineArgumentsEncodedPattern =
-Pattern.compile("[a-zA-Z0-9\\Q%;/?:@&,$-_.!~*'()\\E]+");
+Pattern.compile("[\\w\\Q%;/?:@&,$-.!~*'()\\E]+");
 
 /**
  * Limits the decoded form of individual command line arguments. Default
diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index c2bbae3bee..37e241f5a4 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -41,7 +41,7 @@ public class TestCGIServletCmdLineArguments {
  * here. This was chosen as it is simple and the tests are run on
  * Windows as part of every release cycle.
  */
-defaultDecodedPatternWindows = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+defaultDecodedPatternWindows = Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 
 if (JrePlatform.IS_WINDOWS) {
 Pattern p = null;
diff --git a/webapps/docs/cgi-howto.xml b/webapps/docs/cgi-howto.xml
index d1f3e0d0c9..cc5befa5d5 100644
--- a/webapps/docs/cgi-howto.xml
+++ b/webapps/docs/cgi-howto.xml
@@ -115,7 +115,7 @@ by Daniel Colascione.
 are enabled (via enableCmdLineArguments) individual encoded
 command line argument must match this pattern else the request will be 
rejected.
 The default matches the allowed values defined by RFC3875 and is
-[a-zA-Z0-9\Q%;/?:@&,$-_.!~*'()\E]+
+[\w\Q%;/?:@&,$-.!~*'()\E]+
 enableCmdLineArguments - Are command line arguments
 generated from the query string as per section 4.4 of 3875 RFC? The default is
 false.


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



[tomcat] branch 10.1.x updated: Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

2023-03-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 7ed9261493 Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)
7ed9261493 is described below

commit 7ed92614933fcaecacf647e6bfbe8064e34adca1
Author: lihan 
AuthorDate: Fri Mar 10 15:22:50 2023 +0800

Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

Submitted by Andrei Briukhov
---
 conf/web.xml  | 4 ++--
 java/org/apache/catalina/servlets/CGIServlet.java | 4 ++--
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 2 +-
 webapps/docs/cgi-howto.xml| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index 123a9257ee..8f706c8290 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -363,7 +363,7 @@
   
   
   
-  
+  
   
   
   
@@ -374,7 +374,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java 
b/java/org/apache/catalina/servlets/CGIServlet.java
index d0755c6fdd..e1cda7bb97 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -255,7 +255,7 @@ public final class CGIServlet extends HttpServlet {
 DEFAULT_SUPER_METHODS.add("TRACE");
 
 if (JrePlatform.IS_WINDOWS) {
-DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 } else {
 // No restrictions
 DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = null;
@@ -324,7 +324,7 @@ public final class CGIServlet extends HttpServlet {
  * Uses \Q...\E to avoid individual quoting.
  */
 private Pattern cmdLineArgumentsEncodedPattern =
-Pattern.compile("[a-zA-Z0-9\\Q%;/?:@&,$-_.!~*'()\\E]+");
+Pattern.compile("[\\w\\Q%;/?:@&,$-.!~*'()\\E]+");
 
 /**
  * Limits the decoded form of individual command line arguments. Default
diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index c2bbae3bee..37e241f5a4 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -41,7 +41,7 @@ public class TestCGIServletCmdLineArguments {
  * here. This was chosen as it is simple and the tests are run on
  * Windows as part of every release cycle.
  */
-defaultDecodedPatternWindows = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+defaultDecodedPatternWindows = Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 
 if (JrePlatform.IS_WINDOWS) {
 Pattern p = null;
diff --git a/webapps/docs/cgi-howto.xml b/webapps/docs/cgi-howto.xml
index e00faf0a19..b3b76937f9 100644
--- a/webapps/docs/cgi-howto.xml
+++ b/webapps/docs/cgi-howto.xml
@@ -116,7 +116,7 @@ by Daniel Colascione.
 are enabled (via enableCmdLineArguments) individual encoded
 command line argument must match this pattern else the request will be 
rejected.
 The default matches the allowed values defined by RFC3875 and is
-[a-zA-Z0-9\Q%;/?:@&,$-_.!~*'()\E]+
+[\w\Q%;/?:@&,$-.!~*'()\E]+
 enableCmdLineArguments - Are command line arguments
 generated from the query string as per section 4.4 of 3875 RFC? The default is
 false.


-
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: Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

2023-03-09 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 6918c28c77 Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)
6918c28c77 is described below

commit 6918c28c776c7b7d2104b26b9768b46eeb4352a0
Author: lihan 
AuthorDate: Fri Mar 10 15:22:50 2023 +0800

Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

Submitted by Andrei Briukhov
---
 conf/web.xml  | 4 ++--
 java/org/apache/catalina/servlets/CGIServlet.java | 4 ++--
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 2 +-
 webapps/docs/cgi-howto.xml| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index ddabd5efa9..0b8b1edfe7 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -363,7 +363,7 @@
   
   
   
-  
+  
   
   
   
@@ -374,7 +374,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java 
b/java/org/apache/catalina/servlets/CGIServlet.java
index 1c01714ff7..2c03cf7601 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -254,7 +254,7 @@ public final class CGIServlet extends HttpServlet {
 DEFAULT_SUPER_METHODS.add("TRACE");
 
 if (JrePlatform.IS_WINDOWS) {
-DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 } else {
 // No restrictions
 DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = null;
@@ -323,7 +323,7 @@ public final class CGIServlet extends HttpServlet {
  * Uses \Q...\E to avoid individual quoting.
  */
 private Pattern cmdLineArgumentsEncodedPattern =
-Pattern.compile("[a-zA-Z0-9\\Q%;/?:@&,$-_.!~*'()\\E]+");
+Pattern.compile("[\\w\\Q%;/?:@&,$-.!~*'()\\E]+");
 
 /**
  * Limits the decoded form of individual command line arguments. Default
diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index c2bbae3bee..37e241f5a4 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -41,7 +41,7 @@ public class TestCGIServletCmdLineArguments {
  * here. This was chosen as it is simple and the tests are run on
  * Windows as part of every release cycle.
  */
-defaultDecodedPatternWindows = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+defaultDecodedPatternWindows = Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 
 if (JrePlatform.IS_WINDOWS) {
 Pattern p = null;
diff --git a/webapps/docs/cgi-howto.xml b/webapps/docs/cgi-howto.xml
index e00faf0a19..b3b76937f9 100644
--- a/webapps/docs/cgi-howto.xml
+++ b/webapps/docs/cgi-howto.xml
@@ -116,7 +116,7 @@ by Daniel Colascione.
 are enabled (via enableCmdLineArguments) individual encoded
 command line argument must match this pattern else the request will be 
rejected.
 The default matches the allowed values defined by RFC3875 and is
-[a-zA-Z0-9\Q%;/?:@&,$-_.!~*'()\E]+
+[\w\Q%;/?:@&,$-.!~*'()\E]+
 enableCmdLineArguments - Are command line arguments
 generated from the query string as per section 4.4 of 3875 RFC? The default is
 false.


-
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: Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

2023-03-09 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 3f01b8bdec Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)
3f01b8bdec is described below

commit 3f01b8bdec0663c6f8f815225a1100900c1d9708
Author: lihan 
AuthorDate: Fri Mar 10 15:22:50 2023 +0800

Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

Submitted by Andrei Briukhov
---
 conf/web.xml  | 4 ++--
 java/org/apache/catalina/servlets/CGIServlet.java | 4 ++--
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 2 +-
 webapps/docs/cgi-howto.xml| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index 86777073bb..01eacede64 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -356,7 +356,7 @@
   
   
   
-  
+  
   
   
   
@@ -367,7 +367,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java 
b/java/org/apache/catalina/servlets/CGIServlet.java
index a80c5d1911..a406a4a756 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -254,7 +254,7 @@ public final class CGIServlet extends HttpServlet {
 DEFAULT_SUPER_METHODS.add("TRACE");
 
 if (JrePlatform.IS_WINDOWS) {
-DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 } else {
 // No restrictions
 DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = null;
@@ -323,7 +323,7 @@ public final class CGIServlet extends HttpServlet {
  * Uses \Q...\E to avoid individual quoting.
  */
 private Pattern cmdLineArgumentsEncodedPattern =
-Pattern.compile("[a-zA-Z0-9\\Q%;/?:@&,$-_.!~*'()\\E]+");
+Pattern.compile("[\\w\\Q%;/?:@&,$-.!~*'()\\E]+");
 
 /**
  * Limits the decoded form of individual command line arguments. Default
diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index c2bbae3bee..37e241f5a4 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -41,7 +41,7 @@ public class TestCGIServletCmdLineArguments {
  * here. This was chosen as it is simple and the tests are run on
  * Windows as part of every release cycle.
  */
-defaultDecodedPatternWindows = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+defaultDecodedPatternWindows = Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 
 if (JrePlatform.IS_WINDOWS) {
 Pattern p = null;
diff --git a/webapps/docs/cgi-howto.xml b/webapps/docs/cgi-howto.xml
index e00faf0a19..b3b76937f9 100644
--- a/webapps/docs/cgi-howto.xml
+++ b/webapps/docs/cgi-howto.xml
@@ -116,7 +116,7 @@ by Daniel Colascione.
 are enabled (via enableCmdLineArguments) individual encoded
 command line argument must match this pattern else the request will be 
rejected.
 The default matches the allowed values defined by RFC3875 and is
-[a-zA-Z0-9\Q%;/?:@&,$-_.!~*'()\E]+
+[\w\Q%;/?:@&,$-.!~*'()\E]+
 enableCmdLineArguments - Are command line arguments
 generated from the query string as per section 4.4 of 3875 RFC? The default is
 false.


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



[tomcat] branch main updated: Fix changelog entry

2023-03-14 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 f28f12e5b6 Fix changelog entry
f28f12e5b6 is described below

commit f28f12e5b639a40c3cef4278ee55738d14a62111
Author: lihan 
AuthorDate: Wed Mar 15 10:58:34 2023 +0800

Fix changelog entry
---
 webapps/docs/changelog.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6eb73d1c60..46b8da05be 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -155,6 +155,7 @@
   
 66524 Correct eviction ordering in WebResource cache to
 by LRU as intended. (schultz)
+  
 
   
   


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



[tomcat] branch 10.1.x updated: Fix changelog entry

2023-03-14 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 3cf7c5fdc9 Fix changelog entry
3cf7c5fdc9 is described below

commit 3cf7c5fdc98b09e5dcf13db933f23c8cad3b3be5
Author: lihan 
AuthorDate: Wed Mar 15 10:58:34 2023 +0800

Fix changelog entry
---
 webapps/docs/changelog.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d0470c6b74..c574b05f88 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,7 @@
   
 66524 Correct eviction ordering in WebResource cache to
 by LRU as intended. (schultz)
+  
 
   
   


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

2023-03-14 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 cd2566a28c Fix changelog entry
cd2566a28c is described below

commit cd2566a28cfab43cbba19aa600b56f4d5cb3e533
Author: lihan 
AuthorDate: Wed Mar 15 10:58:34 2023 +0800

Fix changelog entry
---
 webapps/docs/changelog.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5cbbdfaebb..39c4d6707f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,7 @@
   
 66524 Correct eviction ordering in WebResource cache to
 by LRU as intended. (schultz)
+  
 
   
   


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

2023-03-14 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 cbb08b1be3 Fix changelog entry
cbb08b1be3 is described below

commit cbb08b1be39e7c4db468a5df54328084ff98dec7
Author: lihan 
AuthorDate: Wed Mar 15 10:58:34 2023 +0800

Fix changelog entry
---
 webapps/docs/changelog.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9b8b070a20..fe5ef0abc2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,7 @@
   
 66524 Correct eviction ordering in WebResource cache to
 by LRU as intended. (schultz)
+  
 
   
   


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



[tomcat] branch main updated: Ensure brackets are closed in PoolProperties.toString

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

lihan 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 a3671d2e99 Ensure brackets are closed in PoolProperties.toString
a3671d2e99 is described below

commit a3671d2e99c1526e9943a16efede6cb8f2b8057a
Author: Magnus Reftel 
AuthorDate: Mon Apr 24 12:41:51 2023 +0200

Ensure brackets are closed in PoolProperties.toString
---
 .../apache/tomcat/jdbc/pool/PoolProperties.java|  1 +
 .../tomcat/jdbc/pool/PoolPropertiesTest.java   | 39 ++
 2 files changed, 40 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
index e9c9c09b69..3aff37fa53 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
@@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, 
Cloneable, Serializabl
 break;
 }
 }
+buf.append(']');
 }catch (Exception x) {
 //shouldn't happen
 log.debug("toString() call failed", x);
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
new file mode 100644
index 00..b475d64f23
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
@@ -0,0 +1,39 @@
+package org.apache.tomcat.jdbc.pool;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PoolPropertiesTest {
+private static final String DEFAULT_USER = "username_def";
+private static final String DEFAULT_PASSWD = "password_def";
+@Test
+public void toStringOutputShouldHaveBalancedBrackets() {
+PoolProperties properties = new PoolProperties();
+properties.setUsername(DEFAULT_USER);
+properties.setPassword(DEFAULT_PASSWD);
+properties.setAlternateUsernameAllowed(true);
+properties.setInitialSize(0);
+properties.setRemoveAbandoned(false);
+properties.setTimeBetweenEvictionRunsMillis(-1);
+
+String asString = properties.toString();
+
+List stack = new ArrayList<>();
+for (char c : asString.toCharArray()) {
+switch (c) {
+case '{':
+case '(':
+case '[': stack.add(c); break;
+case '}': Assert.assertEquals('{', stack.remove(stack.size() - 
1).charValue()); break;
+case ')': Assert.assertEquals('(', stack.remove(stack.size() - 
1).charValue()); break;
+case ']': Assert.assertEquals('[', stack.remove(stack.size() - 
1).charValue()); break;
+default: break;
+}
+}
+Assert.assertEquals("All brackets should have been closed", 0, 
stack.size());
+}
+}


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



[tomcat] branch 10.1.x updated: Ensure brackets are closed in PoolProperties.toString

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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 7e93ea8206 Ensure brackets are closed in PoolProperties.toString
7e93ea8206 is described below

commit 7e93ea82066868f1a08431ba7778376dd8773a0c
Author: Magnus Reftel 
AuthorDate: Mon Apr 24 12:41:51 2023 +0200

Ensure brackets are closed in PoolProperties.toString
---
 .../apache/tomcat/jdbc/pool/PoolProperties.java|  1 +
 .../tomcat/jdbc/pool/PoolPropertiesTest.java   | 39 ++
 2 files changed, 40 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
index e9c9c09b69..3aff37fa53 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
@@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, 
Cloneable, Serializabl
 break;
 }
 }
+buf.append(']');
 }catch (Exception x) {
 //shouldn't happen
 log.debug("toString() call failed", x);
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
new file mode 100644
index 00..b475d64f23
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
@@ -0,0 +1,39 @@
+package org.apache.tomcat.jdbc.pool;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PoolPropertiesTest {
+private static final String DEFAULT_USER = "username_def";
+private static final String DEFAULT_PASSWD = "password_def";
+@Test
+public void toStringOutputShouldHaveBalancedBrackets() {
+PoolProperties properties = new PoolProperties();
+properties.setUsername(DEFAULT_USER);
+properties.setPassword(DEFAULT_PASSWD);
+properties.setAlternateUsernameAllowed(true);
+properties.setInitialSize(0);
+properties.setRemoveAbandoned(false);
+properties.setTimeBetweenEvictionRunsMillis(-1);
+
+String asString = properties.toString();
+
+List stack = new ArrayList<>();
+for (char c : asString.toCharArray()) {
+switch (c) {
+case '{':
+case '(':
+case '[': stack.add(c); break;
+case '}': Assert.assertEquals('{', stack.remove(stack.size() - 
1).charValue()); break;
+case ')': Assert.assertEquals('(', stack.remove(stack.size() - 
1).charValue()); break;
+case ']': Assert.assertEquals('[', stack.remove(stack.size() - 
1).charValue()); break;
+default: break;
+}
+}
+Assert.assertEquals("All brackets should have been closed", 0, 
stack.size());
+}
+}


-
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: Ensure brackets are closed in PoolProperties.toString

2023-04-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 8908c58089 Ensure brackets are closed in PoolProperties.toString
8908c58089 is described below

commit 8908c5808987a071a0afb6da8ebff506bb1424e0
Author: Magnus Reftel 
AuthorDate: Mon Apr 24 12:41:51 2023 +0200

Ensure brackets are closed in PoolProperties.toString
---
 .../apache/tomcat/jdbc/pool/PoolProperties.java|  1 +
 .../tomcat/jdbc/pool/PoolPropertiesTest.java   | 39 ++
 2 files changed, 40 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
index e9c9c09b69..3aff37fa53 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
@@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, 
Cloneable, Serializabl
 break;
 }
 }
+buf.append(']');
 }catch (Exception x) {
 //shouldn't happen
 log.debug("toString() call failed", x);
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
new file mode 100644
index 00..b475d64f23
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
@@ -0,0 +1,39 @@
+package org.apache.tomcat.jdbc.pool;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PoolPropertiesTest {
+private static final String DEFAULT_USER = "username_def";
+private static final String DEFAULT_PASSWD = "password_def";
+@Test
+public void toStringOutputShouldHaveBalancedBrackets() {
+PoolProperties properties = new PoolProperties();
+properties.setUsername(DEFAULT_USER);
+properties.setPassword(DEFAULT_PASSWD);
+properties.setAlternateUsernameAllowed(true);
+properties.setInitialSize(0);
+properties.setRemoveAbandoned(false);
+properties.setTimeBetweenEvictionRunsMillis(-1);
+
+String asString = properties.toString();
+
+List stack = new ArrayList<>();
+for (char c : asString.toCharArray()) {
+switch (c) {
+case '{':
+case '(':
+case '[': stack.add(c); break;
+case '}': Assert.assertEquals('{', stack.remove(stack.size() - 
1).charValue()); break;
+case ')': Assert.assertEquals('(', stack.remove(stack.size() - 
1).charValue()); break;
+case ']': Assert.assertEquals('[', stack.remove(stack.size() - 
1).charValue()); break;
+default: break;
+}
+}
+Assert.assertEquals("All brackets should have been closed", 0, 
stack.size());
+}
+}


-
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: Ensure brackets are closed in PoolProperties.toString

2023-04-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 ccdb4995cd Ensure brackets are closed in PoolProperties.toString
ccdb4995cd is described below

commit ccdb4995cdf98362732664b4a5077af53926d2c6
Author: Magnus Reftel 
AuthorDate: Mon Apr 24 12:41:51 2023 +0200

Ensure brackets are closed in PoolProperties.toString
---
 .../apache/tomcat/jdbc/pool/PoolProperties.java|  1 +
 .../tomcat/jdbc/pool/PoolPropertiesTest.java   | 39 ++
 2 files changed, 40 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
index f333c3de59..73479e250c 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
@@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, 
Cloneable, Serializabl
 break;
 }
 }
+buf.append(']');
 }catch (Exception x) {
 //shouldn't happen
 log.debug("toString() call failed", x);
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
new file mode 100644
index 00..b475d64f23
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
@@ -0,0 +1,39 @@
+package org.apache.tomcat.jdbc.pool;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PoolPropertiesTest {
+private static final String DEFAULT_USER = "username_def";
+private static final String DEFAULT_PASSWD = "password_def";
+@Test
+public void toStringOutputShouldHaveBalancedBrackets() {
+PoolProperties properties = new PoolProperties();
+properties.setUsername(DEFAULT_USER);
+properties.setPassword(DEFAULT_PASSWD);
+properties.setAlternateUsernameAllowed(true);
+properties.setInitialSize(0);
+properties.setRemoveAbandoned(false);
+properties.setTimeBetweenEvictionRunsMillis(-1);
+
+String asString = properties.toString();
+
+List stack = new ArrayList<>();
+for (char c : asString.toCharArray()) {
+switch (c) {
+case '{':
+case '(':
+case '[': stack.add(c); break;
+case '}': Assert.assertEquals('{', stack.remove(stack.size() - 
1).charValue()); break;
+case ')': Assert.assertEquals('(', stack.remove(stack.size() - 
1).charValue()); break;
+case ']': Assert.assertEquals('[', stack.remove(stack.size() - 
1).charValue()); break;
+default: break;
+}
+}
+Assert.assertEquals("All brackets should have been closed", 0, 
stack.size());
+}
+}


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



[tomcat] branch main updated: Polish

2023-04-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 fa0b2b196d Polish
fa0b2b196d is described below

commit fa0b2b196d8525a662e9edec258650865da465ed
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Polish
---
 java/org/apache/catalina/core/ContainerBase.java   | 18 +++
 java/org/apache/catalina/core/StandardServer.java  | 26 +-
 .../apache/catalina/valves/JsonAccessLogValve.java |  2 +-
 3 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/core/ContainerBase.java 
b/java/org/apache/catalina/core/ContainerBase.java
index 9dc018be15..784c9032ef 100644
--- a/java/org/apache/catalina/core/ContainerBase.java
+++ b/java/org/apache/catalina/core/ContainerBase.java
@@ -377,7 +377,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.cluster = cluster;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldCluster != null) && 
(oldCluster instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldCluster instanceof Lifecycle)) 
{
 try {
 ((Lifecycle) oldCluster).stop();
 } catch (LifecycleException e) {
@@ -390,7 +390,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 cluster.setContainer(this);
 }
 
-if (getState().isAvailable() && (cluster != null) && (cluster 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (cluster instanceof Lifecycle)) {
 try {
 ((Lifecycle) cluster).start();
 } catch (LifecycleException e) {
@@ -580,7 +580,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.realm = realm;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldRealm != null) && (oldRealm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldRealm instanceof Lifecycle)) {
 try {
 ((Lifecycle) oldRealm).stop();
 } catch (LifecycleException e) {
@@ -592,7 +592,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 if (realm != null) {
 realm.setContainer(this);
 }
-if (getState().isAvailable() && (realm != null) && (realm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (realm instanceof Lifecycle)) {
 try {
 ((Lifecycle) realm).start();
 } catch (LifecycleException e) {
@@ -832,8 +832,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Start our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StartChild(child)));
 }
@@ -897,8 +897,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Stop our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StopChild(child)));
 }
@@ -992,7 +992,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 AccessLogAdapter adapter = null;
-Valve valves[] = getPipeline().getValves();
+Valve[] valves = getPipeline().getValves();
 for (Valve valve : valves) {
 if (valve instanceof AccessLog) {
 if (adapter == null) {
diff --git a/java/org/apache/catalina/core/StandardServer.java 
b/java/org/apache/catalina/core/StandardServer.java
index eb5e91e932..09a223fa80 100644
--- a/java/org/apache/catalina/core/StandardServer.java
+++ b/java/org/apache/catalina/core/StandardServer.java
@@ -135,7 +135,7 @@ public final class StandardServer extends 
LifecycleMBeanBase implements Server {
 /**
  * The set of Services associated with this Server.
  */
-private Service services[] = new Service[0];
+private Service[] services = new Service[0];
 private final Object se

[tomcat] branch 10.1.x updated: Polish

2023-04-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new d41f3d03d8 Polish
d41f3d03d8 is described below

commit d41f3d03d86bde44d0180d67a713dfa774c69a92
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Polish
---
 java/org/apache/catalina/core/ContainerBase.java   | 18 +++
 java/org/apache/catalina/core/StandardServer.java  | 26 +-
 .../apache/catalina/valves/JsonAccessLogValve.java |  2 +-
 3 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/core/ContainerBase.java 
b/java/org/apache/catalina/core/ContainerBase.java
index 5275310ec8..7c96f5de5e 100644
--- a/java/org/apache/catalina/core/ContainerBase.java
+++ b/java/org/apache/catalina/core/ContainerBase.java
@@ -400,7 +400,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.cluster = cluster;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldCluster != null) && 
(oldCluster instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldCluster instanceof Lifecycle)) 
{
 try {
 ((Lifecycle) oldCluster).stop();
 } catch (LifecycleException e) {
@@ -413,7 +413,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 cluster.setContainer(this);
 }
 
-if (getState().isAvailable() && (cluster != null) && (cluster 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (cluster instanceof Lifecycle)) {
 try {
 ((Lifecycle) cluster).start();
 } catch (LifecycleException e) {
@@ -603,7 +603,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.realm = realm;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldRealm != null) && (oldRealm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldRealm instanceof Lifecycle)) {
 try {
 ((Lifecycle) oldRealm).stop();
 } catch (LifecycleException e) {
@@ -615,7 +615,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 if (realm != null) {
 realm.setContainer(this);
 }
-if (getState().isAvailable() && (realm != null) && (realm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (realm instanceof Lifecycle)) {
 try {
 ((Lifecycle) realm).start();
 } catch (LifecycleException e) {
@@ -865,8 +865,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Start our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StartChild(child)));
 }
@@ -930,8 +930,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Stop our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StopChild(child)));
 }
@@ -1025,7 +1025,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 AccessLogAdapter adapter = null;
-Valve valves[] = getPipeline().getValves();
+Valve[] valves = getPipeline().getValves();
 for (Valve valve : valves) {
 if (valve instanceof AccessLog) {
 if (adapter == null) {
diff --git a/java/org/apache/catalina/core/StandardServer.java 
b/java/org/apache/catalina/core/StandardServer.java
index 9c6f4b2173..5f4637153b 100644
--- a/java/org/apache/catalina/core/StandardServer.java
+++ b/java/org/apache/catalina/core/StandardServer.java
@@ -136,7 +136,7 @@ public final class StandardServer extends 
LifecycleMBeanBase implements Server {
 /**
  * The set of Services associated with this Server.
  */
-private Service services[] = new Service[0];
+private Service[] services = new Service[0];
 private final Object se

[tomcat] branch 9.0.x updated: Polish

2023-04-27 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 fc1e5951b4 Polish
fc1e5951b4 is described below

commit fc1e5951b4cbdbf1fcee422e084d5ee8bafda0ac
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Polish
---
 java/org/apache/catalina/core/ContainerBase.java   | 18 +++
 java/org/apache/catalina/core/StandardServer.java  | 26 +-
 .../apache/catalina/valves/JsonAccessLogValve.java |  2 +-
 3 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/core/ContainerBase.java 
b/java/org/apache/catalina/core/ContainerBase.java
index 5275310ec8..7c96f5de5e 100644
--- a/java/org/apache/catalina/core/ContainerBase.java
+++ b/java/org/apache/catalina/core/ContainerBase.java
@@ -400,7 +400,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.cluster = cluster;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldCluster != null) && 
(oldCluster instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldCluster instanceof Lifecycle)) 
{
 try {
 ((Lifecycle) oldCluster).stop();
 } catch (LifecycleException e) {
@@ -413,7 +413,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 cluster.setContainer(this);
 }
 
-if (getState().isAvailable() && (cluster != null) && (cluster 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (cluster instanceof Lifecycle)) {
 try {
 ((Lifecycle) cluster).start();
 } catch (LifecycleException e) {
@@ -603,7 +603,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.realm = realm;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldRealm != null) && (oldRealm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldRealm instanceof Lifecycle)) {
 try {
 ((Lifecycle) oldRealm).stop();
 } catch (LifecycleException e) {
@@ -615,7 +615,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 if (realm != null) {
 realm.setContainer(this);
 }
-if (getState().isAvailable() && (realm != null) && (realm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (realm instanceof Lifecycle)) {
 try {
 ((Lifecycle) realm).start();
 } catch (LifecycleException e) {
@@ -865,8 +865,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Start our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StartChild(child)));
 }
@@ -930,8 +930,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Stop our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StopChild(child)));
 }
@@ -1025,7 +1025,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 AccessLogAdapter adapter = null;
-Valve valves[] = getPipeline().getValves();
+Valve[] valves = getPipeline().getValves();
 for (Valve valve : valves) {
 if (valve instanceof AccessLog) {
 if (adapter == null) {
diff --git a/java/org/apache/catalina/core/StandardServer.java 
b/java/org/apache/catalina/core/StandardServer.java
index 0bf371020c..8db5d8f05a 100644
--- a/java/org/apache/catalina/core/StandardServer.java
+++ b/java/org/apache/catalina/core/StandardServer.java
@@ -140,7 +140,7 @@ public final class StandardServer extends 
LifecycleMBeanBase implements Server {
 /**
  * The set of Services associated with this Server.
  */
-private Service services[] = new Service[0];
+private Service[] services = new Service[0];
 private final Object se

[tomcat] branch main updated: Fix typo

2023-05-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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

commit f9366fb6c55ded9ca198cecc9aa31c2acf97e244
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

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

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index b47e67ed60..ac418726ce 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -74,7 +74,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
 // Sleep for up to 10s for clients to complete
 int count = 0;
 while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
-tc3.results[allowedRequests] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
+tc3.results[allowedRequests] == 0 || 
tc4.results[allowedRequests - 1] == 0 ||
 tc4.results[allowedRequests] == 0)) {
 Thread.sleep(100);
 count++;


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



[tomcat] branch 10.1.x updated: Fix typo

2023-05-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 131d81b879 Fix typo
131d81b879 is described below

commit 131d81b879d42876668b666dcda385e0d01fdd08
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

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

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index b47e67ed60..ac418726ce 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -74,7 +74,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
 // Sleep for up to 10s for clients to complete
 int count = 0;
 while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
-tc3.results[allowedRequests] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
+tc3.results[allowedRequests] == 0 || 
tc4.results[allowedRequests - 1] == 0 ||
 tc4.results[allowedRequests] == 0)) {
 Thread.sleep(100);
 count++;


-
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

2023-05-10 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 ef5339cc0d Fix typo
ef5339cc0d is described below

commit ef5339cc0db07614a20fe7a335a2db1b8754cb04
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

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

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index ce7467eb64..7e92351f8d 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -74,7 +74,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
 // Sleep for up to 10s for clients to complete
 int count = 0;
 while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
-tc3.results[allowedRequests] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
+tc3.results[allowedRequests] == 0 || 
tc4.results[allowedRequests - 1] == 0 ||
 tc4.results[allowedRequests] == 0)) {
 Thread.sleep(100);
 count++;


-
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

2023-05-10 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 9f37ce0770 Fix typo
9f37ce0770 is described below

commit 9f37ce0770f3a65d07d1e88c55672337c2619393
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

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

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index 7e986e75d0..ca21f5e1f4 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -74,7 +74,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
 // Sleep for up to 10s for clients to complete
 int count = 0;
 while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
-tc3.results[allowedRequests] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
+tc3.results[allowedRequests] == 0 || 
tc4.results[allowedRequests - 1] == 0 ||
 tc4.results[allowedRequests] == 0)) {
 Thread.sleep(100);
 count++;


-
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: Update IDE configs

2023-05-11 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 d86253f2f2 Update IDE configs
d86253f2f2 is described below

commit d86253f2f2a07aa3c7cb388c1bf12db1fe92cc74
Author: lihan 
AuthorDate: Thu May 11 14:59:22 2023 +0800

Update IDE configs
---
 res/ide-support/eclipse/eclipse.classpath | 1 -
 res/ide-support/idea/tomcat.iml   | 2 +-
 res/ide-support/netbeans/project.xml  | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/res/ide-support/eclipse/eclipse.classpath 
b/res/ide-support/eclipse/eclipse.classpath
index 881f58847e..de3d205f3a 100644
--- a/res/ide-support/eclipse/eclipse.classpath
+++ b/res/ide-support/eclipse/eclipse.classpath
@@ -29,7 +29,6 @@
 
 
 
-
 
 
 
diff --git a/res/ide-support/idea/tomcat.iml b/res/ide-support/idea/tomcat.iml
index 4d83e65156..904c85171c 100644
--- a/res/ide-support/idea/tomcat.iml
+++ b/res/ide-support/idea/tomcat.iml
@@ -113,7 +113,7 @@
 
   
 
-  
+  
 
 
 
diff --git a/res/ide-support/netbeans/project.xml 
b/res/ide-support/netbeans/project.xml
index fea783cd6e..05c25d860f 100644
--- a/res/ide-support/netbeans/project.xml
+++ b/res/ide-support/netbeans/project.xml
@@ -178,7 +178,7 @@
 -->
 
 java
-@JAXRPC_JAR@:@WSDL4J_JAR@:@JDT_JAR@:@BND_JAR@:@MIGRATION_JAR@:${ant.includes}/
+@JAXRPC_JAR@:@WSDL4J_JAR@:@JDT_JAR@:${ant.includes}/
 @BUILD_JAVA_VERSION@
 
 


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



[tomcat-jakartaee-migration] branch main updated: Correct a regression in the previous fix for #29

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

lihan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new adc4ec5  Correct a regression in the previous fix for #29
adc4ec5 is described below

commit adc4ec5b8f3375bfc98d35f694fd6a0cc75f29f1
Author: lihan 
AuthorDate: Thu Sep 15 13:04:43 2022 +0800

Correct a regression in the previous fix for #29
---
 .../org/apache/tomcat/jakartaee/Migration.java | 91 ++
 1 file changed, 23 insertions(+), 68 deletions(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/Migration.java 
b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
index bd18767..d8b899c 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/Migration.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
@@ -36,7 +36,6 @@ import java.util.zip.CRC32;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 
-import org.apache.commons.compress.archivers.ArchiveEntry;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
 import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
@@ -215,8 +214,9 @@ public class Migration {
 
 private void migrateArchiveStreaming(InputStream src, OutputStream dest) 
throws IOException {
 try (ZipArchiveInputStream srcZipStream = new 
ZipArchiveInputStream(CloseShieldInputStream.wrap(src));
-CrcZipArchiveOutputStream destZipStream = new 
CrcZipArchiveOutputStream(CloseShieldOutputStream.wrap(dest))) {
+ZipArchiveOutputStream destZipStream = new 
ZipArchiveOutputStream(CloseShieldOutputStream.wrap(dest))) {
 ZipArchiveEntry srcZipEntry;
+CRC32 crc32 = new CRC32();
 while ((srcZipEntry = srcZipStream.getNextZipEntry()) != null) {
 String srcName = srcZipEntry.getName();
 if (isSignatureFile(srcName)) {
@@ -224,11 +224,25 @@ public class Migration {
 continue;
 }
 String destName = profile.convert(srcName);
-MigrationZipArchiveEntry destZipEntry = new 
MigrationZipArchiveEntry(srcZipEntry, false);
-destZipEntry.setName(destName);
-destZipStream.putArchiveEntry(destZipEntry);
-migrateStream(srcName, srcZipStream, destZipStream);
-destZipStream.closeArchiveEntry();
+if (srcZipEntry.getMethod() == ZipEntry.STORED) {
+ByteArrayOutputStream tempBuffer = new 
ByteArrayOutputStream((int) (srcZipEntry.getSize() * 1.05));
+migrateStream(srcName, srcZipStream, tempBuffer);
+crc32.update(tempBuffer.toByteArray(), 0, 
tempBuffer.size());
+MigrationZipArchiveEntry destZipEntry = new 
MigrationZipArchiveEntry(srcZipEntry);
+destZipEntry.setName(destName);
+destZipEntry.setSize(tempBuffer.size());
+destZipEntry.setCrc(crc32.getValue());
+destZipStream.putArchiveEntry(destZipEntry);
+tempBuffer.writeTo(destZipStream);
+destZipStream.closeArchiveEntry();
+crc32.reset();
+} else {
+MigrationZipArchiveEntry destZipEntry = new 
MigrationZipArchiveEntry(srcZipEntry);
+destZipEntry.setName(destName);
+destZipStream.putArchiveEntry(destZipEntry);
+migrateStream(srcName, srcZipStream, destZipStream);
+destZipStream.closeArchiveEntry();
+}
 }
 }
 }
@@ -254,7 +268,7 @@ public class Migration {
 continue;
 }
 String destName = profile.convert(srcName);
-MigrationZipArchiveEntry destZipEntry = new 
MigrationZipArchiveEntry(srcZipEntry, true);
+MigrationZipArchiveEntry destZipEntry = new 
MigrationZipArchiveEntry(srcZipEntry);
 destZipEntry.setName(destName);
 destZipStream.putArchiveEntry(destZipEntry);
 migrateStream(srcName, srcZipFile.getInputStream(srcZipEntry), 
destZipStream);
@@ -320,30 +334,8 @@ public class Migration {
 }
 
 private static class MigrationZipArchiveEntry extends ZipArchiveEntry {
-protected final CRC32 crc = new CRC32();
-protected long size = 0;
-protected boolean needResetCrc;
-public MigrationZipArchiveEntry(ZipArchiveEntry entry, boolean 
inMemory) throws ZipException {
+public MigrationZipArchiveEntry(ZipArchiveEntry entry) throws 
ZipException {
 super(entry);
-// No recalculation required, when in memory mode and not of type

[tomcat-jakartaee-migration] branch main updated: Add changelog entry

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

lihan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new 90d2f46  Add changelog entry
90d2f46 is described below

commit 90d2f46977cff54925bd626932e9be74300bcd8f
Author: lihan 
AuthorDate: Thu Sep 15 13:14:34 2022 +0800

Add changelog entry
---
 CHANGES.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index f532c10..abe51c5 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,7 +2,7 @@
 
 ## 1.0.4 (in progress)
 
-- TBD
+- Correct a regression in the previous fix for 
[#29](https://github.com/apache/tomcat-jakartaee-migration/issues/29) (lihan)
 
 ## 1.0.3
 


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



[tomcat-jakartaee-migration] branch main updated: Modify description of changelog entry

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

lihan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new ca6e718  Modify description of changelog entry
ca6e718 is described below

commit ca6e71865eef5f324d46feaeed3b8d3b114b432e
Author: lihan 
AuthorDate: Thu Sep 15 13:35:06 2022 +0800

Modify description of changelog entry
---
 CHANGES.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index abe51c5..d724e8d 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,7 +2,7 @@
 
 ## 1.0.4 (in progress)
 
-- Correct a regression in the previous fix for 
[#29](https://github.com/apache/tomcat-jakartaee-migration/issues/29) (lihan)
+- Correct a wrong implementation in the previous fix for 
[#29](https://github.com/apache/tomcat-jakartaee-migration/issues/29) (lihan)
 
 ## 1.0.3
 


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



[tomcat] branch main updated: Iterate over Map.entrySet() instead of Map.keySet()

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

lihan 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 a26ccf25a1 Iterate over Map.entrySet() instead of Map.keySet()
a26ccf25a1 is described below

commit a26ccf25a17a1eea0e2a5ee7b6e0663c8e9bfd30
Author: lihan 
AuthorDate: Fri Sep 16 14:31:54 2022 +0800

Iterate over Map.entrySet() instead of Map.keySet()
---
 java/org/apache/catalina/servlets/WebdavServlet.java | 5 +++--
 java/org/apache/jasper/compiler/Generator.java   | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 7b9e7f84fd..405a281b48 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1812,8 +1812,9 @@ public class WebdavServlet extends DefaultServlet {
 
 generatedXML.writeElement("D", DEFAULT_NAMESPACE, "multistatus", 
XMLWriter.OPENING);
 
-for (String errorPath : errorList.keySet()) {
-int errorCode = errorList.get(errorPath).intValue();
+for (Map.Entry errorEntry : errorList.entrySet()) {
+String errorPath = errorEntry.getKey();
+int errorCode = errorEntry.getValue().intValue();
 
 generatedXML.writeElement("D", "response", XMLWriter.OPENING);
 
diff --git a/java/org/apache/jasper/compiler/Generator.java 
b/java/org/apache/jasper/compiler/Generator.java
index 34c6e41abf..41c8feb67a 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -1837,8 +1837,8 @@ class Generator {
 out.print(" + " + elemName);
 
 // Write remaining attributes
-for (String attrName : map.keySet()) {
-out.print(map.get(attrName));
+for (Entry attrEntry : map.entrySet()) {
+out.print(attrEntry.getValue());
 }
 
 // Does the  have nested tags other than


-
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: Iterate over Map.entrySet() instead of Map.keySet()

2022-09-15 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 c9fabe4875 Iterate over Map.entrySet() instead of Map.keySet()
c9fabe4875 is described below

commit c9fabe487530d50f5a798856f461487fe26677bd
Author: lihan 
AuthorDate: Fri Sep 16 14:31:54 2022 +0800

Iterate over Map.entrySet() instead of Map.keySet()
---
 java/org/apache/catalina/servlets/WebdavServlet.java | 5 +++--
 java/org/apache/jasper/compiler/Generator.java   | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 7b9e7f84fd..405a281b48 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1812,8 +1812,9 @@ public class WebdavServlet extends DefaultServlet {
 
 generatedXML.writeElement("D", DEFAULT_NAMESPACE, "multistatus", 
XMLWriter.OPENING);
 
-for (String errorPath : errorList.keySet()) {
-int errorCode = errorList.get(errorPath).intValue();
+for (Map.Entry errorEntry : errorList.entrySet()) {
+String errorPath = errorEntry.getKey();
+int errorCode = errorEntry.getValue().intValue();
 
 generatedXML.writeElement("D", "response", XMLWriter.OPENING);
 
diff --git a/java/org/apache/jasper/compiler/Generator.java 
b/java/org/apache/jasper/compiler/Generator.java
index 7c90cfda53..175de77ff4 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2061,8 +2061,8 @@ class Generator {
 out.print(" + " + elemName);
 
 // Write remaining attributes
-for (String attrName : map.keySet()) {
-out.print(map.get(attrName));
+for (Entry attrEntry : map.entrySet()) {
+out.print(attrEntry.getValue());
 }
 
 // Does the  have nested tags other than


-
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: Iterate over Map.entrySet() instead of Map.keySet()

2022-09-15 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 24b8f44fea Iterate over Map.entrySet() instead of Map.keySet()
24b8f44fea is described below

commit 24b8f44feaa0a37c067b3199e8db61038ab93248
Author: lihan 
AuthorDate: Fri Sep 16 14:31:54 2022 +0800

Iterate over Map.entrySet() instead of Map.keySet()
---
 java/org/apache/catalina/servlets/WebdavServlet.java | 5 +++--
 java/org/apache/jasper/compiler/Generator.java   | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 53cf4cb738..6b6f15cd3d 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1814,8 +1814,9 @@ public class WebdavServlet extends DefaultServlet {
 
 generatedXML.writeElement("D", DEFAULT_NAMESPACE, "multistatus", 
XMLWriter.OPENING);
 
-for (String errorPath : errorList.keySet()) {
-int errorCode = errorList.get(errorPath).intValue();
+for (Map.Entry errorEntry : errorList.entrySet()) {
+String errorPath = errorEntry.getKey();
+int errorCode = errorEntry.getValue().intValue();
 
 generatedXML.writeElement("D", "response", XMLWriter.OPENING);
 
diff --git a/java/org/apache/jasper/compiler/Generator.java 
b/java/org/apache/jasper/compiler/Generator.java
index b359933bf3..c25d34fb1a 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2051,8 +2051,8 @@ class Generator {
 out.print(" + " + elemName);
 
 // Write remaining attributes
-for (String attrName : map.keySet()) {
-out.print(map.get(attrName));
+for (Entry attrEntry : map.entrySet()) {
+out.print(attrEntry.getValue());
 }
 
 // Does the  have nested tags other than


-
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: Iterate over Map.entrySet() instead of Map.keySet()

2022-09-15 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 6800e83480 Iterate over Map.entrySet() instead of Map.keySet()
6800e83480 is described below

commit 6800e8348025c323ff70b5438ef2796e8003a48d
Author: lihan 
AuthorDate: Fri Sep 16 14:31:54 2022 +0800

Iterate over Map.entrySet() instead of Map.keySet()
---
 java/org/apache/catalina/servlets/WebdavServlet.java | 5 +++--
 java/org/apache/jasper/compiler/Generator.java   | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index a0bf15353f..9e54acbf77 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1811,8 +1811,9 @@ public class WebdavServlet extends DefaultServlet {
 
 generatedXML.writeElement("D", DEFAULT_NAMESPACE, "multistatus", 
XMLWriter.OPENING);
 
-for (String errorPath : errorList.keySet()) {
-int errorCode = errorList.get(errorPath).intValue();
+for (Map.Entry errorEntry : errorList.entrySet()) {
+String errorPath = errorEntry.getKey();
+int errorCode = errorEntry.getValue().intValue();
 
 generatedXML.writeElement("D", "response", XMLWriter.OPENING);
 
diff --git a/java/org/apache/jasper/compiler/Generator.java 
b/java/org/apache/jasper/compiler/Generator.java
index b0c83469ed..68224e5c50 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2069,8 +2069,8 @@ class Generator {
 out.print(" + " + elemName);
 
 // Write remaining attributes
-for (String attrName : map.keySet()) {
-out.print(map.get(attrName));
+for (Entry attrEntry : map.entrySet()) {
+out.print(attrEntry.getValue());
 }
 
 // Does the  have nested tags other than


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



[tomcat] branch main updated: Polishing TaskQueue & ThreadPoolExecutor

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

lihan 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 6afb00b3d5 Polishing TaskQueue & ThreadPoolExecutor
6afb00b3d5 is described below

commit 6afb00b3d5c5de8b6fbb02cd1159356763fb
Author: lihan 
AuthorDate: Tue Sep 27 11:04:44 2022 +0800

Polishing TaskQueue & ThreadPoolExecutor

The ThreadPoolExecutor#setCorePoolSize no longer does 
queue.remainingCapacity()==0 checks on JDK7 and above, so remove the code that 
temporarily fakes this condition.
---
 java/org/apache/tomcat/util/threads/TaskQueue.java | 25 --
 .../tomcat/util/threads/ThreadPoolExecutor.java| 13 ---
 2 files changed, 38 deletions(-)

diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java 
b/java/org/apache/tomcat/util/threads/TaskQueue.java
index 0e7cea653e..981949975b 100644
--- a/java/org/apache/tomcat/util/threads/TaskQueue.java
+++ b/java/org/apache/tomcat/util/threads/TaskQueue.java
@@ -38,10 +38,6 @@ public class TaskQueue extends LinkedBlockingQueue 
{
 
 private transient volatile ThreadPoolExecutor parent = null;
 
-// No need to be volatile. This is written and read in a single thread
-// (when stopping a context and firing the listeners)
-private int forcedRemainingCapacity = -1;
-
 public TaskQueue() {
 super();
 }
@@ -121,25 +117,4 @@ public class TaskQueue extends 
LinkedBlockingQueue {
 }
 return super.take();
 }
-
-@Override
-public int remainingCapacity() {
-if (forcedRemainingCapacity > DEFAULT_FORCED_REMAINING_CAPACITY) {
-// ThreadPoolExecutor.setCorePoolSize checks that
-// remainingCapacity==0 to allow to interrupt idle threads
-// I don't see why, but this hack allows to conform to this
-// "requirement"
-return forcedRemainingCapacity;
-}
-return super.remainingCapacity();
-}
-
-public void setForcedRemainingCapacity(int forcedRemainingCapacity) {
-this.forcedRemainingCapacity = forcedRemainingCapacity;
-}
-
-void resetForcedRemainingCapacity() {
-this.forcedRemainingCapacity = DEFAULT_FORCED_REMAINING_CAPACITY;
-}
-
 }
diff --git a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java 
b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
index 1a92b89ac1..c660a3ed23 100644
--- a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
+++ b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
@@ -1909,15 +1909,6 @@ public class ThreadPoolExecutor extends 
AbstractExecutorService {
 
 // save the current pool parameters to restore them later
 int savedCorePoolSize = this.getCorePoolSize();
-TaskQueue taskQueue =
-getQueue() instanceof TaskQueue ? (TaskQueue) getQueue() : 
null;
-if (taskQueue != null) {
-// note by slaurent : quite oddly 
threadPoolExecutor.setCorePoolSize
-// checks that queue.remainingCapacity()==0. I did not understand
-// why, but to get the intended effect of waking up idle threads, I
-// temporarily fake this condition.
-taskQueue.setForcedRemainingCapacity(0);
-}
 
 // setCorePoolSize(0) wakes idle threads
 this.setCorePoolSize(0);
@@ -1926,10 +1917,6 @@ public class ThreadPoolExecutor extends 
AbstractExecutorService {
 // all threads of the pool are renewed in a limited time, something 
like
 // (threadKeepAlive + longest request time)
 
-if (taskQueue != null) {
-// ok, restore the state of the queue and pool
-taskQueue.resetForcedRemainingCapacity();
-}
 this.setCorePoolSize(savedCorePoolSize);
 }
 


-
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: Polishing TaskQueue & ThreadPoolExecutor

2022-09-26 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 b458f32419 Polishing TaskQueue & ThreadPoolExecutor
b458f32419 is described below

commit b458f32419076db2d59b05c50441ba2df501aa6e
Author: lihan 
AuthorDate: Tue Sep 27 11:04:44 2022 +0800

Polishing TaskQueue & ThreadPoolExecutor

The ThreadPoolExecutor#setCorePoolSize no longer does 
queue.remainingCapacity()==0 checks on JDK7 and above, so remove the code that 
temporarily fakes this condition.
---
 java/org/apache/tomcat/util/threads/TaskQueue.java | 25 --
 .../tomcat/util/threads/ThreadPoolExecutor.java| 13 ---
 2 files changed, 38 deletions(-)

diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java 
b/java/org/apache/tomcat/util/threads/TaskQueue.java
index 3ad5a2a587..cacb320d65 100644
--- a/java/org/apache/tomcat/util/threads/TaskQueue.java
+++ b/java/org/apache/tomcat/util/threads/TaskQueue.java
@@ -38,10 +38,6 @@ public class TaskQueue extends LinkedBlockingQueue 
{
 
 private transient volatile ThreadPoolExecutor parent = null;
 
-// No need to be volatile. This is written and read in a single thread
-// (when stopping a context and firing the listeners)
-private int forcedRemainingCapacity = -1;
-
 public TaskQueue() {
 super();
 }
@@ -145,25 +141,4 @@ public class TaskQueue extends 
LinkedBlockingQueue {
 }
 return super.take();
 }
-
-@Override
-public int remainingCapacity() {
-if (forcedRemainingCapacity > DEFAULT_FORCED_REMAINING_CAPACITY) {
-// ThreadPoolExecutor.setCorePoolSize checks that
-// remainingCapacity==0 to allow to interrupt idle threads
-// I don't see why, but this hack allows to conform to this
-// "requirement"
-return forcedRemainingCapacity;
-}
-return super.remainingCapacity();
-}
-
-public void setForcedRemainingCapacity(int forcedRemainingCapacity) {
-this.forcedRemainingCapacity = forcedRemainingCapacity;
-}
-
-void resetForcedRemainingCapacity() {
-this.forcedRemainingCapacity = DEFAULT_FORCED_REMAINING_CAPACITY;
-}
-
 }
diff --git a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java 
b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
index d800cad534..df46be1853 100644
--- a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
+++ b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
@@ -1938,15 +1938,6 @@ public class ThreadPoolExecutor extends 
AbstractExecutorService {
 
 // save the current pool parameters to restore them later
 int savedCorePoolSize = this.getCorePoolSize();
-TaskQueue taskQueue =
-getQueue() instanceof TaskQueue ? (TaskQueue) getQueue() : 
null;
-if (taskQueue != null) {
-// note by slaurent : quite oddly 
threadPoolExecutor.setCorePoolSize
-// checks that queue.remainingCapacity()==0. I did not understand
-// why, but to get the intended effect of waking up idle threads, I
-// temporarily fake this condition.
-taskQueue.setForcedRemainingCapacity(0);
-}
 
 // setCorePoolSize(0) wakes idle threads
 this.setCorePoolSize(0);
@@ -1955,10 +1946,6 @@ public class ThreadPoolExecutor extends 
AbstractExecutorService {
 // all threads of the pool are renewed in a limited time, something 
like
 // (threadKeepAlive + longest request time)
 
-if (taskQueue != null) {
-// ok, restore the state of the queue and pool
-taskQueue.resetForcedRemainingCapacity();
-}
 this.setCorePoolSize(savedCorePoolSize);
 }
 


-
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: Polishing TaskQueue & ThreadPoolExecutor

2022-09-26 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 ef7e3d48a5 Polishing TaskQueue & ThreadPoolExecutor
ef7e3d48a5 is described below

commit ef7e3d48a58eb0bb7dd0693179e674ef1aab6772
Author: lihan 
AuthorDate: Tue Sep 27 11:04:44 2022 +0800

Polishing TaskQueue & ThreadPoolExecutor

The ThreadPoolExecutor#setCorePoolSize no longer does 
queue.remainingCapacity()==0 checks on JDK7 and above, so remove the code that 
temporarily fakes this condition.
---
 java/org/apache/tomcat/util/threads/TaskQueue.java | 25 --
 .../tomcat/util/threads/ThreadPoolExecutor.java| 13 ---
 2 files changed, 38 deletions(-)

diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java 
b/java/org/apache/tomcat/util/threads/TaskQueue.java
index 3ad5a2a587..cacb320d65 100644
--- a/java/org/apache/tomcat/util/threads/TaskQueue.java
+++ b/java/org/apache/tomcat/util/threads/TaskQueue.java
@@ -38,10 +38,6 @@ public class TaskQueue extends LinkedBlockingQueue 
{
 
 private transient volatile ThreadPoolExecutor parent = null;
 
-// No need to be volatile. This is written and read in a single thread
-// (when stopping a context and firing the listeners)
-private int forcedRemainingCapacity = -1;
-
 public TaskQueue() {
 super();
 }
@@ -145,25 +141,4 @@ public class TaskQueue extends 
LinkedBlockingQueue {
 }
 return super.take();
 }
-
-@Override
-public int remainingCapacity() {
-if (forcedRemainingCapacity > DEFAULT_FORCED_REMAINING_CAPACITY) {
-// ThreadPoolExecutor.setCorePoolSize checks that
-// remainingCapacity==0 to allow to interrupt idle threads
-// I don't see why, but this hack allows to conform to this
-// "requirement"
-return forcedRemainingCapacity;
-}
-return super.remainingCapacity();
-}
-
-public void setForcedRemainingCapacity(int forcedRemainingCapacity) {
-this.forcedRemainingCapacity = forcedRemainingCapacity;
-}
-
-void resetForcedRemainingCapacity() {
-this.forcedRemainingCapacity = DEFAULT_FORCED_REMAINING_CAPACITY;
-}
-
 }
diff --git a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java 
b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
index d800cad534..df46be1853 100644
--- a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
+++ b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
@@ -1938,15 +1938,6 @@ public class ThreadPoolExecutor extends 
AbstractExecutorService {
 
 // save the current pool parameters to restore them later
 int savedCorePoolSize = this.getCorePoolSize();
-TaskQueue taskQueue =
-getQueue() instanceof TaskQueue ? (TaskQueue) getQueue() : 
null;
-if (taskQueue != null) {
-// note by slaurent : quite oddly 
threadPoolExecutor.setCorePoolSize
-// checks that queue.remainingCapacity()==0. I did not understand
-// why, but to get the intended effect of waking up idle threads, I
-// temporarily fake this condition.
-taskQueue.setForcedRemainingCapacity(0);
-}
 
 // setCorePoolSize(0) wakes idle threads
 this.setCorePoolSize(0);
@@ -1955,10 +1946,6 @@ public class ThreadPoolExecutor extends 
AbstractExecutorService {
 // all threads of the pool are renewed in a limited time, something 
like
 // (threadKeepAlive + longest request time)
 
-if (taskQueue != null) {
-// ok, restore the state of the queue and pool
-taskQueue.resetForcedRemainingCapacity();
-}
 this.setCorePoolSize(savedCorePoolSize);
 }
 


-
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: Polishing TaskQueue & ThreadPoolExecutor

2022-09-26 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 4aeddee4cf Polishing TaskQueue & ThreadPoolExecutor
4aeddee4cf is described below

commit 4aeddee4cf9829ac313f68c7656eff80c26cee0c
Author: lihan 
AuthorDate: Tue Sep 27 11:04:44 2022 +0800

Polishing TaskQueue & ThreadPoolExecutor

The ThreadPoolExecutor#setCorePoolSize no longer does 
queue.remainingCapacity()==0 checks on JDK7 and above, so remove the code that 
temporarily fakes this condition.
---
 java/org/apache/tomcat/util/threads/TaskQueue.java | 25 --
 .../tomcat/util/threads/ThreadPoolExecutor.java| 13 ---
 2 files changed, 38 deletions(-)

diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java 
b/java/org/apache/tomcat/util/threads/TaskQueue.java
index 3ad5a2a587..cacb320d65 100644
--- a/java/org/apache/tomcat/util/threads/TaskQueue.java
+++ b/java/org/apache/tomcat/util/threads/TaskQueue.java
@@ -38,10 +38,6 @@ public class TaskQueue extends LinkedBlockingQueue 
{
 
 private transient volatile ThreadPoolExecutor parent = null;
 
-// No need to be volatile. This is written and read in a single thread
-// (when stopping a context and firing the listeners)
-private int forcedRemainingCapacity = -1;
-
 public TaskQueue() {
 super();
 }
@@ -145,25 +141,4 @@ public class TaskQueue extends 
LinkedBlockingQueue {
 }
 return super.take();
 }
-
-@Override
-public int remainingCapacity() {
-if (forcedRemainingCapacity > DEFAULT_FORCED_REMAINING_CAPACITY) {
-// ThreadPoolExecutor.setCorePoolSize checks that
-// remainingCapacity==0 to allow to interrupt idle threads
-// I don't see why, but this hack allows to conform to this
-// "requirement"
-return forcedRemainingCapacity;
-}
-return super.remainingCapacity();
-}
-
-public void setForcedRemainingCapacity(int forcedRemainingCapacity) {
-this.forcedRemainingCapacity = forcedRemainingCapacity;
-}
-
-void resetForcedRemainingCapacity() {
-this.forcedRemainingCapacity = DEFAULT_FORCED_REMAINING_CAPACITY;
-}
-
 }
diff --git a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java 
b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
index d800cad534..df46be1853 100644
--- a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
+++ b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
@@ -1938,15 +1938,6 @@ public class ThreadPoolExecutor extends 
AbstractExecutorService {
 
 // save the current pool parameters to restore them later
 int savedCorePoolSize = this.getCorePoolSize();
-TaskQueue taskQueue =
-getQueue() instanceof TaskQueue ? (TaskQueue) getQueue() : 
null;
-if (taskQueue != null) {
-// note by slaurent : quite oddly 
threadPoolExecutor.setCorePoolSize
-// checks that queue.remainingCapacity()==0. I did not understand
-// why, but to get the intended effect of waking up idle threads, I
-// temporarily fake this condition.
-taskQueue.setForcedRemainingCapacity(0);
-}
 
 // setCorePoolSize(0) wakes idle threads
 this.setCorePoolSize(0);
@@ -1955,10 +1946,6 @@ public class ThreadPoolExecutor extends 
AbstractExecutorService {
 // all threads of the pool are renewed in a limited time, something 
like
 // (threadKeepAlive + longest request time)
 
-if (taskQueue != null) {
-// ok, restore the state of the queue and pool
-taskQueue.resetForcedRemainingCapacity();
-}
 this.setCorePoolSize(savedCorePoolSize);
 }
 


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



[tomcat] branch main updated: Remove meaningless code.

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

lihan 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 42a8beda32 Remove meaningless code.
42a8beda32 is described below

commit 42a8beda32f0c026f6bb3026c3ef68d67528bcbb
Author: lihan 
AuthorDate: Tue Sep 27 11:25:24 2022 +0800

Remove meaningless code.
---
 java/org/apache/tomcat/util/threads/TaskQueue.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java 
b/java/org/apache/tomcat/util/threads/TaskQueue.java
index 981949975b..3ddd277ce4 100644
--- a/java/org/apache/tomcat/util/threads/TaskQueue.java
+++ b/java/org/apache/tomcat/util/threads/TaskQueue.java
@@ -34,7 +34,6 @@ public class TaskQueue extends LinkedBlockingQueue {
 
 private static final long serialVersionUID = 1L;
 protected static final StringManager sm = 
StringManager.getManager(TaskQueue.class);
-private static final int DEFAULT_FORCED_REMAINING_CAPACITY = -1;
 
 private transient volatile ThreadPoolExecutor parent = null;
 


-
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: Remove meaningless code.

2022-09-26 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 667e6cf509 Remove meaningless code.
667e6cf509 is described below

commit 667e6cf509668d2b6d2c384187b4ae660ce83951
Author: lihan 
AuthorDate: Tue Sep 27 11:25:24 2022 +0800

Remove meaningless code.
---
 java/org/apache/tomcat/util/threads/TaskQueue.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java 
b/java/org/apache/tomcat/util/threads/TaskQueue.java
index cacb320d65..6b250ee9d3 100644
--- a/java/org/apache/tomcat/util/threads/TaskQueue.java
+++ b/java/org/apache/tomcat/util/threads/TaskQueue.java
@@ -34,7 +34,6 @@ public class TaskQueue extends LinkedBlockingQueue {
 
 private static final long serialVersionUID = 1L;
 protected static final StringManager sm = 
StringManager.getManager(TaskQueue.class);
-private static final int DEFAULT_FORCED_REMAINING_CAPACITY = -1;
 
 private transient volatile ThreadPoolExecutor parent = null;
 


-
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: Remove meaningless code.

2022-09-26 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 2558c1bcae Remove meaningless code.
2558c1bcae is described below

commit 2558c1bcae768c9b1b7607adc6a97e43569cf9dd
Author: lihan 
AuthorDate: Tue Sep 27 11:25:24 2022 +0800

Remove meaningless code.
---
 java/org/apache/tomcat/util/threads/TaskQueue.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java 
b/java/org/apache/tomcat/util/threads/TaskQueue.java
index cacb320d65..6b250ee9d3 100644
--- a/java/org/apache/tomcat/util/threads/TaskQueue.java
+++ b/java/org/apache/tomcat/util/threads/TaskQueue.java
@@ -34,7 +34,6 @@ public class TaskQueue extends LinkedBlockingQueue {
 
 private static final long serialVersionUID = 1L;
 protected static final StringManager sm = 
StringManager.getManager(TaskQueue.class);
-private static final int DEFAULT_FORCED_REMAINING_CAPACITY = -1;
 
 private transient volatile ThreadPoolExecutor parent = null;
 


-
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: Remove meaningless code.

2022-09-26 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 d22be4e016 Remove meaningless code.
d22be4e016 is described below

commit d22be4e016d1afb715a6576297f9f04b11b33380
Author: lihan 
AuthorDate: Tue Sep 27 11:25:24 2022 +0800

Remove meaningless code.
---
 java/org/apache/tomcat/util/threads/TaskQueue.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java 
b/java/org/apache/tomcat/util/threads/TaskQueue.java
index cacb320d65..6b250ee9d3 100644
--- a/java/org/apache/tomcat/util/threads/TaskQueue.java
+++ b/java/org/apache/tomcat/util/threads/TaskQueue.java
@@ -34,7 +34,6 @@ public class TaskQueue extends LinkedBlockingQueue {
 
 private static final long serialVersionUID = 1L;
 protected static final StringManager sm = 
StringManager.getManager(TaskQueue.class);
-private static final int DEFAULT_FORCED_REMAINING_CAPACITY = -1;
 
 private transient volatile ThreadPoolExecutor parent = null;
 


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



[tomcat] branch main updated: Fix BZ66276

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

lihan 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 1ae46b1555 Fix BZ66276
1ae46b1555 is described below

commit 1ae46b15557067273aad2e2f16873e0c73515435
Author: lihan 
AuthorDate: Tue Sep 27 15:29:53 2022 +0800

Fix BZ66276

https://bz.apache.org/bugzilla/show_bug.cgi?id=66276
---
 java/org/apache/coyote/http2/AbstractNonZeroStream.java | 4 ++--
 webapps/docs/changelog.xml  | 8 
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/AbstractNonZeroStream.java 
b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
index 0368c4fa6c..f67b17f7d9 100644
--- a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
+++ b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
@@ -75,8 +75,8 @@ abstract class AbstractNonZeroStream extends AbstractStream {
 if (isDescendant(parent)) {
 parent.detachFromParent();
 // Cast is always safe since any descendant of this stream must be
-// an instance of Stream
-getParentStream().addChild((Stream) parent);
+// an instance of AbstractNonZeroStream
+getParentStream().addChild((AbstractNonZeroStream) parent);
 }
 
 if (exclusive) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e8ea7712b6..85e487007a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+66276: Fix incorrect class cast when adding
+a descendant of HTTP/2 streams. (lihan)
+  
+
+  
 
 
   


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

2022-09-27 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 761d23e881 Fix BZ66276
761d23e881 is described below

commit 761d23e8813845ec7dbf1a5f65ddf9862a5e2bb0
Author: lihan 
AuthorDate: Tue Sep 27 15:29:53 2022 +0800

Fix BZ66276

https://bz.apache.org/bugzilla/show_bug.cgi?id=66276
---
 java/org/apache/coyote/http2/AbstractNonZeroStream.java | 4 ++--
 webapps/docs/changelog.xml  | 8 
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/AbstractNonZeroStream.java 
b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
index 0368c4fa6c..f67b17f7d9 100644
--- a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
+++ b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
@@ -75,8 +75,8 @@ abstract class AbstractNonZeroStream extends AbstractStream {
 if (isDescendant(parent)) {
 parent.detachFromParent();
 // Cast is always safe since any descendant of this stream must be
-// an instance of Stream
-getParentStream().addChild((Stream) parent);
+// an instance of AbstractNonZeroStream
+getParentStream().addChild((AbstractNonZeroStream) parent);
 }
 
 if (exclusive) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b35a5c72c4..9f5b617766 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+66276: Fix incorrect class cast when adding
+a descendant of HTTP/2 streams. (lihan)
+  
+
+  
 
 
   


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

2022-09-27 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 8ae279a201 Fix BZ66276
8ae279a201 is described below

commit 8ae279a201033ec5c8da5f8b52cbc5838d81b705
Author: lihan 
AuthorDate: Tue Sep 27 15:29:53 2022 +0800

Fix BZ66276

https://bz.apache.org/bugzilla/show_bug.cgi?id=66276
---
 java/org/apache/coyote/http2/AbstractNonZeroStream.java | 4 ++--
 webapps/docs/changelog.xml  | 4 
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/AbstractNonZeroStream.java 
b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
index 0368c4fa6c..f67b17f7d9 100644
--- a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
+++ b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
@@ -75,8 +75,8 @@ abstract class AbstractNonZeroStream extends AbstractStream {
 if (isDescendant(parent)) {
 parent.detachFromParent();
 // Cast is always safe since any descendant of this stream must be
-// an instance of Stream
-getParentStream().addChild((Stream) parent);
+// an instance of AbstractNonZeroStream
+getParentStream().addChild((AbstractNonZeroStream) parent);
 }
 
 if (exclusive) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 493eb7c78f..32c9fecab1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -182,6 +182,10 @@
 incorrect check when matching HTTP/2 preface. Submitted by 刘文章.
 (lihan)
   
+  
+66276: Fix incorrect class cast when adding
+a descendant of HTTP/2 streams. (lihan)
+  
 
   
   


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

2022-09-27 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 e42bab5571 Fix BZ66276
e42bab5571 is described below

commit e42bab5571cb413dba53e5ba8406df812ae89d5e
Author: lihan 
AuthorDate: Tue Sep 27 15:29:53 2022 +0800

Fix BZ66276

https://bz.apache.org/bugzilla/show_bug.cgi?id=66276
---
 java/org/apache/coyote/http2/AbstractNonZeroStream.java | 4 ++--
 webapps/docs/changelog.xml  | 8 
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/AbstractNonZeroStream.java 
b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
index 0368c4fa6c..f67b17f7d9 100644
--- a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
+++ b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
@@ -75,8 +75,8 @@ abstract class AbstractNonZeroStream extends AbstractStream {
 if (isDescendant(parent)) {
 parent.detachFromParent();
 // Cast is always safe since any descendant of this stream must be
-// an instance of Stream
-getParentStream().addChild((Stream) parent);
+// an instance of AbstractNonZeroStream
+getParentStream().addChild((AbstractNonZeroStream) parent);
 }
 
 if (exclusive) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 318f448cdb..35d514f0e1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+66276: Fix incorrect class cast when adding
+a descendant of HTTP/2 streams. (lihan)
+  
+
+  
 
 
   


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



[tomcat] branch main updated: Fix Javadoc typo

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

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

commit c386d43bdcaa6764b3d639adcd1925ab56d8ce96
Author: lihan 
AuthorDate: Wed Sep 28 11:26:21 2022 +0800

Fix Javadoc typo
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 05fe1fa834..2ce72e8acb 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -347,7 +347,7 @@ public abstract class AbstractEndpoint {
 }
 
 /**
- * Create the SSLContextfor the the given SSLHostConfig.
+ * Create the SSLContext for the given SSLHostConfig.
  *
  * @param sslHostConfig The SSLHostConfig for which the SSLContext should 
be
  *  created


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

2022-09-27 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 fe7a6b3642 Fix Javadoc typo
fe7a6b3642 is described below

commit fe7a6b3642935e68e7d1e8c254773b9e958e3b54
Author: lihan 
AuthorDate: Wed Sep 28 11:26:21 2022 +0800

Fix Javadoc typo
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index d058703953..1da61b400d 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -347,7 +347,7 @@ public abstract class AbstractEndpoint {
 }
 
 /**
- * Create the SSLContextfor the the given SSLHostConfig.
+ * Create the SSLContext for the given SSLHostConfig.
  *
  * @param sslHostConfig The SSLHostConfig for which the SSLContext should 
be
  *  created


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

2022-09-27 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 d6e9d0afbf Fix Javadoc typo
d6e9d0afbf is described below

commit d6e9d0afbf2d0b178b09cef662cee3511509b6cf
Author: lihan 
AuthorDate: Wed Sep 28 11:26:21 2022 +0800

Fix Javadoc typo
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 6624ddae88..9a5eda429e 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -358,7 +358,7 @@ public abstract class AbstractEndpoint {
 }
 
 /**
- * Create the SSLContextfor the the given SSLHostConfig.
+ * Create the SSLContext for the given SSLHostConfig.
  *
  * @param sslHostConfig The SSLHostConfig for which the SSLContext should 
be
  *  created


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

2022-09-27 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 eb3d307982 Fix Javadoc typo
eb3d307982 is described below

commit eb3d307982fb8b2918d7b66f6e71259d0c76f533
Author: lihan 
AuthorDate: Wed Sep 28 11:26:21 2022 +0800

Fix Javadoc typo
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 4397151c80..bded5b63a3 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -356,7 +356,7 @@ public abstract class AbstractEndpoint {
 }
 
 /**
- * Create the SSLContextfor the the given SSLHostConfig.
+ * Create the SSLContext for the given SSLHostConfig.
  *
  * @param sslHostConfig The SSLHostConfig for which the SSLContext should 
be
  *  created


-
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: Refactor. Simplify 'Map' operations. No functional change.

2022-10-07 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 4abc0b5f3b Refactor. Simplify 'Map' operations. No functional change.
4abc0b5f3b is described below

commit 4abc0b5f3b473008527b6d1129e08b8aa8526eb1
Author: lihan 
AuthorDate: Sat Oct 8 11:10:30 2022 +0800

Refactor. Simplify 'Map' operations. No functional change.
---
 java/org/apache/catalina/connector/Request.java|  8 ++--
 .../catalina/core/ApplicationPushBuilder.java  |  8 +---
 java/org/apache/catalina/core/StandardContext.java | 23 ++
 .../apache/catalina/servlets/WebdavServlet.java|  8 +---
 .../util/descriptor/web/SecurityConstraint.java|  8 ++--
 java/org/apache/tomcat/util/http/Parameters.java   |  7 +--
 6 files changed, 13 insertions(+), 49 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 69e9ce6199..af2f1ccd2f 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3434,12 +3434,8 @@ public class Request implements HttpServletRequest {
 for (AcceptLanguage acceptLanguage : acceptLanguages) {
 // Add a new Locale to the list of Locales for this quality level
 Double key = Double.valueOf(-acceptLanguage.getQuality());  // 
Reverse the order
-ArrayList values = locales.get(key);
-if (values == null) {
-values = new ArrayList<>();
-locales.put(key, values);
-}
-values.add(acceptLanguage.getLocale());
+locales.computeIfAbsent(key, k -> new ArrayList<>())
+.add(acceptLanguage.getLocale());
 }
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationPushBuilder.java 
b/java/org/apache/catalina/core/ApplicationPushBuilder.java
index 240167c529..42842ef869 100644
--- a/java/org/apache/catalina/core/ApplicationPushBuilder.java
+++ b/java/org/apache/catalina/core/ApplicationPushBuilder.java
@@ -243,13 +243,7 @@ public class ApplicationPushBuilder implements PushBuilder 
{
 
 @Override
 public PushBuilder addHeader(String name, String value) {
-List values = headers.get(name);
-if (values == null) {
-values = new ArrayList<>();
-headers.put(name, values);
-}
-values.add(value);
-
+headers.computeIfAbsent(name, k -> new ArrayList<>()).add(value);
 return this;
 }
 
diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index 329e9e70c0..40f7ea1b1c 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -4892,12 +4892,7 @@ public class StandardContext extends ContainerBase
 continue;
 }
 Integer key = Integer.valueOf(loadOnStartup);
-ArrayList list = map.get(key);
-if (list == null) {
-list = new ArrayList<>();
-map.put(key, list);
-}
-list.add(wrapper);
+map.computeIfAbsent(key, k -> new ArrayList<>()).add(wrapper);
 }
 
 // Load the collected "load on startup" servlets
@@ -5319,12 +5314,8 @@ public class StandardContext extends ContainerBase
 String jndiName = resource.getName();
 for (InjectionTarget injectionTarget: injectionTargets) {
 String clazz = injectionTarget.getTargetClass();
-Map injections = injectionMap.get(clazz);
-if (injections == null) {
-injections = new HashMap<>();
-injectionMap.put(clazz, injections);
-}
-injections.put(injectionTarget.getTargetName(), jndiName);
+injectionMap.computeIfAbsent(clazz, k -> new HashMap<>())
+.put(injectionTarget.getTargetName(), jndiName);
 }
 }
 }
@@ -5348,10 +5339,8 @@ public class StandardContext extends ContainerBase
 ApplicationParameter params[] = findApplicationParameters();
 for (ApplicationParameter param : params) {
 if (param.getOverride()) {
-if (mergedParams.get(param.getName()) == null) {
-mergedParams.put(param.getName(),
-param.getValue());
-}
+mergedParams.computeIfAbsent(param.getName(),
+k -> param.getValue());
 } else {
 mergedParams.put(param.getName(), param.getValue());
 }
@@ -5880,7 +5869,7 @@ 

[tomcat] branch 9.0.x updated: Refactor. Simplify 'Map' operations. No functional change.

2022-10-07 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 bcb8b1198d Refactor. Simplify 'Map' operations. No functional change.
bcb8b1198d is described below

commit bcb8b1198d7472cb6c8e1e150d5ea2c59092a18a
Author: lihan 
AuthorDate: Sat Oct 8 11:10:30 2022 +0800

Refactor. Simplify 'Map' operations. No functional change.
---
 java/org/apache/catalina/connector/Request.java|  8 ++--
 .../catalina/core/ApplicationPushBuilder.java  |  8 +---
 java/org/apache/catalina/core/StandardContext.java | 23 ++
 .../apache/catalina/servlets/WebdavServlet.java|  8 +---
 .../util/descriptor/web/SecurityConstraint.java|  8 ++--
 java/org/apache/tomcat/util/http/Parameters.java   |  7 +--
 6 files changed, 13 insertions(+), 49 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index ff599aa848..5816cb6fbc 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3466,12 +3466,8 @@ public class Request implements HttpServletRequest {
 for (AcceptLanguage acceptLanguage : acceptLanguages) {
 // Add a new Locale to the list of Locales for this quality level
 Double key = Double.valueOf(-acceptLanguage.getQuality());  // 
Reverse the order
-ArrayList values = locales.get(key);
-if (values == null) {
-values = new ArrayList<>();
-locales.put(key, values);
-}
-values.add(acceptLanguage.getLocale());
+locales.computeIfAbsent(key, k -> new ArrayList<>())
+.add(acceptLanguage.getLocale());
 }
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationPushBuilder.java 
b/java/org/apache/catalina/core/ApplicationPushBuilder.java
index e06b9d3ef8..f910957eef 100644
--- a/java/org/apache/catalina/core/ApplicationPushBuilder.java
+++ b/java/org/apache/catalina/core/ApplicationPushBuilder.java
@@ -243,13 +243,7 @@ public class ApplicationPushBuilder implements PushBuilder 
{
 
 @Override
 public PushBuilder addHeader(String name, String value) {
-List values = headers.get(name);
-if (values == null) {
-values = new ArrayList<>();
-headers.put(name, values);
-}
-values.add(value);
-
+headers.computeIfAbsent(name, k -> new ArrayList<>()).add(value);
 return this;
 }
 
diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index ef4ab40c78..4d588cc8dd 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -4943,12 +4943,7 @@ public class StandardContext extends ContainerBase
 continue;
 }
 Integer key = Integer.valueOf(loadOnStartup);
-ArrayList list = map.get(key);
-if (list == null) {
-list = new ArrayList<>();
-map.put(key, list);
-}
-list.add(wrapper);
+map.computeIfAbsent(key, k -> new ArrayList<>()).add(wrapper);
 }
 
 // Load the collected "load on startup" servlets
@@ -5370,12 +5365,8 @@ public class StandardContext extends ContainerBase
 String jndiName = resource.getName();
 for (InjectionTarget injectionTarget: injectionTargets) {
 String clazz = injectionTarget.getTargetClass();
-Map injections = injectionMap.get(clazz);
-if (injections == null) {
-injections = new HashMap<>();
-injectionMap.put(clazz, injections);
-}
-injections.put(injectionTarget.getTargetName(), jndiName);
+injectionMap.computeIfAbsent(clazz, k -> new HashMap<>())
+.put(injectionTarget.getTargetName(), jndiName);
 }
 }
 }
@@ -5399,10 +5390,8 @@ public class StandardContext extends ContainerBase
 ApplicationParameter params[] = findApplicationParameters();
 for (ApplicationParameter param : params) {
 if (param.getOverride()) {
-if (mergedParams.get(param.getName()) == null) {
-mergedParams.put(param.getName(),
-param.getValue());
-}
+mergedParams.computeIfAbsent(param.getName(),
+k -> param.getValue());
 } else {
 mergedParams.put(param.getName(), param.getValue());
 }
@@ -5931,7 +5920,7 @@ 

[tomcat] branch main updated: Refactor. Simplify 'Map' operations. No functional change.

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

lihan 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 52774c2467 Refactor. Simplify 'Map' operations. No functional change.
52774c2467 is described below

commit 52774c24678f11ca7aadc02d98dca156e8c36b3d
Author: lihan 
AuthorDate: Sat Oct 8 11:10:30 2022 +0800

Refactor. Simplify 'Map' operations. No functional change.
---
 java/org/apache/catalina/connector/Request.java|  8 ++--
 .../catalina/core/ApplicationPushBuilder.java  |  8 +---
 java/org/apache/catalina/core/StandardContext.java | 23 ++
 .../apache/catalina/servlets/WebdavServlet.java|  8 +---
 .../util/descriptor/web/SecurityConstraint.java|  8 ++--
 java/org/apache/tomcat/util/http/Parameters.java   |  7 +--
 6 files changed, 13 insertions(+), 49 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 40475e8fc5..b1f59767cc 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3401,12 +3401,8 @@ public class Request implements HttpServletRequest {
 for (AcceptLanguage acceptLanguage : acceptLanguages) {
 // Add a new Locale to the list of Locales for this quality level
 Double key = Double.valueOf(-acceptLanguage.getQuality());  // 
Reverse the order
-ArrayList values = locales.get(key);
-if (values == null) {
-values = new ArrayList<>();
-locales.put(key, values);
-}
-values.add(acceptLanguage.getLocale());
+locales.computeIfAbsent(key, k -> new ArrayList<>())
+.add(acceptLanguage.getLocale());
 }
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationPushBuilder.java 
b/java/org/apache/catalina/core/ApplicationPushBuilder.java
index 240167c529..42842ef869 100644
--- a/java/org/apache/catalina/core/ApplicationPushBuilder.java
+++ b/java/org/apache/catalina/core/ApplicationPushBuilder.java
@@ -243,13 +243,7 @@ public class ApplicationPushBuilder implements PushBuilder 
{
 
 @Override
 public PushBuilder addHeader(String name, String value) {
-List values = headers.get(name);
-if (values == null) {
-values = new ArrayList<>();
-headers.put(name, values);
-}
-values.add(value);
-
+headers.computeIfAbsent(name, k -> new ArrayList<>()).add(value);
 return this;
 }
 
diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index d64f676f9a..5044ed462a 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -4891,12 +4891,7 @@ public class StandardContext extends ContainerBase
 continue;
 }
 Integer key = Integer.valueOf(loadOnStartup);
-ArrayList list = map.get(key);
-if (list == null) {
-list = new ArrayList<>();
-map.put(key, list);
-}
-list.add(wrapper);
+map.computeIfAbsent(key, k -> new ArrayList<>()).add(wrapper);
 }
 
 // Load the collected "load on startup" servlets
@@ -5303,12 +5298,8 @@ public class StandardContext extends ContainerBase
 String jndiName = resource.getName();
 for (InjectionTarget injectionTarget: injectionTargets) {
 String clazz = injectionTarget.getTargetClass();
-Map injections = injectionMap.get(clazz);
-if (injections == null) {
-injections = new HashMap<>();
-injectionMap.put(clazz, injections);
-}
-injections.put(injectionTarget.getTargetName(), jndiName);
+injectionMap.computeIfAbsent(clazz, k -> new HashMap<>())
+.put(injectionTarget.getTargetName(), jndiName);
 }
 }
 }
@@ -5332,10 +5323,8 @@ public class StandardContext extends ContainerBase
 ApplicationParameter params[] = findApplicationParameters();
 for (ApplicationParameter param : params) {
 if (param.getOverride()) {
-if (mergedParams.get(param.getName()) == null) {
-mergedParams.put(param.getName(),
-param.getValue());
-}
+mergedParams.computeIfAbsent(param.getName(),
+k -> param.getValue());
 } else {
 mergedParams.put(param.getName(), param.getValue());
 }
@@ -5864,7 +5853,7 @@ 

  1   2   3   >