(tomcat) branch main updated: Additional changes to support the length property via ArrayELResolver

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

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


The following commit(s) were added to refs/heads/main by this push:
 new a92a7a1d53 Additional changes to support the length property via 
ArrayELResolver
a92a7a1d53 is described below

commit a92a7a1d53bef0270c9ab96f42f8d424cd884117
Author: Mark Thomas 
AuthorDate: Mon Jan 15 17:58:31 2024 +

Additional changes to support the length property via ArrayELResolver

Fixes some TCK failures (or at least it will once I get the new tests
added to the TCK).
---
 java/jakarta/el/ArrayELResolver.java | 15 +++
 webapps/docs/changelog.xml   | 10 +-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/java/jakarta/el/ArrayELResolver.java 
b/java/jakarta/el/ArrayELResolver.java
index 88176320ed..0f2b77ce5f 100644
--- a/java/jakarta/el/ArrayELResolver.java
+++ b/java/jakarta/el/ArrayELResolver.java
@@ -50,6 +50,12 @@ public class ArrayELResolver extends ELResolver {
 
 if (base != null && base.getClass().isArray()) {
 context.setPropertyResolved(base, property);
+
+if (LENGTH_PROPERTY_NAME.equals(property)) {
+// Always read-only
+return null;
+}
+
 try {
 int idx = coerce(property);
 checkBounds(base, idx);
@@ -95,6 +101,11 @@ public class ArrayELResolver extends ELResolver {
 if (base != null && base.getClass().isArray()) {
 context.setPropertyResolved(base, property);
 
+if (LENGTH_PROPERTY_NAME.equals(property)) {
+throw new PropertyNotWritableException(
+Util.message(context, "propertyNotWritable", 
base.getClass().getName(), property));
+}
+
 if (this.readOnly) {
 throw new PropertyNotWritableException(
 Util.message(context, "resolverNotWritable", 
base.getClass().getName()));
@@ -116,6 +127,10 @@ public class ArrayELResolver extends ELResolver {
 
 if (base != null && base.getClass().isArray()) {
 context.setPropertyResolved(base, property);
+if (LENGTH_PROPERTY_NAME.equals(property)) {
+// Always read-only
+return true;
+}
 try {
 int idx = coerce(property);
 checkBounds(base, idx);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index aa7fce0034..fbda5cdec1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -139,6 +139,14 @@
   
 
   
+  
+
+  
+Additional fixes to correctly support length as a 
read-only
+property of an array via the ArrayELResolver. (markt)
+  
+
+  
 
 
   
@@ -1269,7 +1277,7 @@
   
 Align the EL implementation with the latest changes to the Jakarta EL
 specification and add support for the length attribute to the
-ArrayElResolver. (markt)
+ArrayELResolver. (markt)
   
 
   


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



Buildbot failure in on tomcat-9.0.x

2024-01-15 Thread buildbot
Build status: BUILD FAILED: failed compile (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/816
Blamelist: Mark Thomas , remm 
Build Text: failed compile (failure)
Status Detected: new failure
Build Source Stamp: [branch 9.0.x] a8430c65b4ab5ffb50097d747921f397d34d8e82


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 2

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



Re: (tomcat) branch main updated: Fix logic bug spotted by Coverity Scan

2024-01-15 Thread Konstantin Kolinko
пн, 15 янв. 2024 г. в 13:16, :
>
> This is an automated email from the ASF dual-hosted git repository.
>
> markt pushed a commit to branch main
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
>
>
> The following commit(s) were added to refs/heads/main by this push:
>  new bee714eb1d Fix logic bug spotted by Coverity Scan
> bee714eb1d is described below
>
> commit bee714eb1dabfcc07bf410e1145f6c580f14539d
> Author: Mark Thomas 
> AuthorDate: Mon Jan 15 10:11:59 2024 +
>
> Fix logic bug spotted by Coverity Scan
> ---
>  .../apache/tomcat/util/digester/ServiceBindingPropertySource.java| 2 +-
>  webapps/docs/changelog.xml   | 5 
> +
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git 
> a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java 
> b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
> index 89617c9cfb..bd06630f01 100644
> --- a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
> +++ b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
> @@ -116,7 +116,7 @@ public class ServiceBindingPropertySource implements 
> IntrospectionUtils.Property
>  int length = bytes.length;
>
>  if (chomp) {
> -if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
> 2] == '\n') {
> +if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
> 1] == '\n') {
>  length -= 2;
>  } else if (length > 0) {
>  byte c = bytes[length - 1];
> diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
> index 6e9ffb917c..aa7fce0034 100644
> --- a/webapps/docs/changelog.xml
> +++ b/webapps/docs/changelog.xml
> @@ -120,6 +120,11 @@
>  that is no longer included in the JAR. Based on pull request
>  684 by Jendrik Johannes. (markt)
>
> +  
> +Fix ServiceBindingPropertySource so that trailing \r\n
> +sequences are correctly removed from files containing property values
> +when configured to do so. Bug identified by Coverity Scan. (markt)
> +  
>  
>
>

Reviewing the code of ServiceBindingPropertySource,

1. It removes only the last end-of-line sequence (one or two characters).
It could be rewritten with a loop to remove any \n \r characters that
are found at the end.

2. The code later uses "return new String(bytes, 0, length);"
to create a String, without specifying any encoding.

I guess that the Platform default encoding nowadays is UTF-8.
Or maybe it makes sense to use the default encoding, as people edit
those files, using whatever default encoding they prefer.


Best regards,
Konstantin Kolinko

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



Re: (tomcat-tck) branch main created (now 4d1b1e7)

2024-01-15 Thread Mark Thomas

On 15/01/2024 14:23, ma...@apache.org wrote:

This is an automated email from the ASF dual-hosted git repository.

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


   at 4d1b1e7  Initial setup. Should work for EL and WebSocket.


It would be great if folks can try this out. I recommend starting by 
trying the EL TCK. It should run in seconds and pass in full.


I intend to keep this branch configured to run from a local TCK build 
for now as:


a) published TCK builds aren't available (at least I haven't found them) 
even as SNAPSHOT builds.


b) updating the TCKs is next on my TODO list so it is easier for me if 
this project works with a local TCK build by default.


Longer term, I am thinking we'll set up a GitHub CI job for the stable 
branches, and run it against the ASF snapshot builds. Whether we do that 
per commit, daily, per release is TBD.


Mark

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



(tomcat-tck) branch main updated: Fix numbering on GitHub

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

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


The following commit(s) were added to refs/heads/main by this push:
 new 59f20d2  Fix numbering on GitHub
59f20d2 is described below

commit 59f20d25e1291d8aa322141ef8944fbd3045de5d
Author: Mark Thomas 
AuthorDate: Mon Jan 15 14:24:22 2024 +

Fix numbering on GitHub
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 7762291..b705791 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ At the moment, you will need to build the TCK locally (see 
below).
mvn install
 ```
 
-1. Install the TCKs Tomcat tests against
+6. Install the TCKs Tomcat tests against
 ```
cd $TCK/el
mvn install
@@ -64,5 +64,5 @@ At the moment, you will need to build the TCK locally (see 
below).
mvn install
 ```
 
-1. Review the component TCK and Tomcat versions in `$TCK_TOMCAT/pom.xml` and 
edit as required. In particular, you'll
+7. Review the component TCK and Tomcat versions in `$TCK_TOMCAT/pom.xml` and 
edit as required. In particular, you'll
 need to configure the TCKs to use the SNAPSHOT versions you build in the 
previous steps.


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



(tomcat-tck) 01/01: Initial setup. Should work for EL and WebSocket.

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

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

commit 4d1b1e7b31c2c9c67e20433180470e540e761ae7
Author: Mark Thomas 
AuthorDate: Mon Jan 15 14:23:03 2024 +

Initial setup. Should work for EL and WebSocket.
---
 .gitignore |4 +
 LICENSE| 1143 
 NOTICE |5 +
 README.md  |   68 ++
 el-tck/pom.xml |   86 ++
 pom.xml|   78 ++
 websocket-tck/pom.xml  |  125 +++
 .../websocket/TomcatWebSocketTckConfiguration.java |   70 ++
 ...org.jboss.arquillian.core.spi.LoadableExtension |1 +
 9 files changed, 1580 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..beef00d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..4c3277f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,1143 @@
+
+ Apache License
+   Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+  "License" shall mean the terms and conditions for use, reproduction,
+  and distribution as defined by Sections 1 through 9 of this document.
+
+  "Licensor" shall mean the copyright owner or entity authorized by
+  the copyright owner that is granting the License.
+
+  "Legal Entity" shall mean the union of the acting entity and all
+  other entities that control, are controlled by, or are under common
+  control with that entity. For the purposes of this definition,
+  "control" means (i) the power, direct or indirect, to cause the
+  direction or management of such entity, whether by contract or
+  otherwise, or (ii) ownership of fifty percent (50%) or more of the
+  outstanding shares, or (iii) beneficial ownership of such entity.
+
+  "You" (or "Your") shall mean an individual or Legal Entity
+  exercising permissions granted by this License.
+
+  "Source" form shall mean the preferred form for making modifications,
+  including but not limited to software source code, documentation
+  source, and configuration files.
+
+  "Object" form shall mean any form resulting from mechanical
+  transformation or translation of a Source form, including but
+  not limited to compiled object code, generated documentation,
+  and conversions to other media types.
+
+  "Work" shall mean the work of authorship, whether in Source or
+  Object form, made available under the License, as indicated by a
+  copyright notice that is included in or attached to the work
+  (an example is provided in the Appendix below).
+
+  "Derivative Works" shall mean any work, whether in Source or Object
+  form, that is based on (or derived from) the Work and for which the
+  editorial revisions, annotations, elaborations, or other modifications
+  represent, as a whole, an original work of authorship. For the purposes
+  of this License, Derivative Works shall not include works that remain
+  separable from, or merely link (or bind by name) to the interfaces of,
+  the Work and Derivative Works thereof.
+
+  "Contribution" shall mean any work of authorship, including
+  the original version of the Work and any modifications or additions
+  to that Work or Derivative Works thereof, that is intentionally
+  submitted to Licensor for inclusion in the Work by the copyright owner
+  or by an individual or Legal Entity authorized to submit on behalf of
+  the copyright owner. For the purposes of this definition, "submitted"
+  means any form of electronic, verbal, or written communication sent
+  to the Licensor or its representatives, including but not limited to
+  communication on electronic mailing lists, source code control systems,
+  and issue tracking systems that are managed by, or on behalf of, the
+  Licensor for the purpose of discussing and improving the Work, but
+  excluding communication that is conspicuously marked or otherwise
+  designated in writing by the copyright owner as "Not a Contribution."
+
+  "Contributor" shall mean Licensor and any individual or Legal Entity
+  on behalf of whom a Contribution has been received by Licensor and
+  subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+  this License, each Contributor hereby grants to You a perpetual,
+  worldwide, non-exclusive, 

(tomcat-tck) branch main created (now 4d1b1e7)

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

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


  at 4d1b1e7  Initial setup. Should work for EL and WebSocket.

This branch includes the following new commits:

 new 4d1b1e7  Initial setup. Should work for EL and WebSocket.

The 1 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.



-
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: Avoid NPE

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

remm 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 d2559510c9 Avoid NPE
d2559510c9 is described below

commit d2559510c93885a5a50d22ddb2ce89fe3cfac728
Author: remm 
AuthorDate: Mon Jan 15 14:38:09 2024 +0100

Avoid NPE

Reported by coverity.
---
 java/org/apache/tomcat/util/net/jsse/LocalStrings.properties | 1 +
 java/org/apache/tomcat/util/net/jsse/PEMFile.java| 6 ++
 2 files changed, 7 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
index 9a21160bd7..6a3d1fd3e7 100644
--- a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
@@ -20,6 +20,7 @@ jsseUtil.excludeProtocol=The SSL protocol [{0}] which is 
supported in this JRE w
 jsseUtil.noDefaultProtocols=Unable to determine a default for 
sslEnabledProtocols. Set an explicit value to ensure the connector can start.
 
 pemFile.noMultiPrimes=The PKCS#1 certificate is in multi-prime format and Java 
does not provide an API for constructing an RSA private key object from that 
format
+pemFile.noPassword=A password is required to decrypt the private key
 pemFile.notPbkdf2=The OID [{0}] is not the correct OID for PKBDF2 which is the 
only permitted KDF for PBES2
 pemFile.notValidRFC5915=The provided key file does not conform to RFC 5915
 pemFile.parseError=Unable to parse the key from [{0}]
diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java 
b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index a05ae6fdc6..b9a921b021 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -503,6 +503,9 @@ public class PEMFile {
 
 
 private byte[] deriveKeyPBKDF1(int keyLength, String password, byte[] 
salt) throws NoSuchAlgorithmException {
+if (password == null) {
+throw new 
IllegalArgumentException(sm.getString("pemFile.noPassword"));
+}
 // PBKDF1-MD5 as specified by PKCS#5
 byte[] key = new byte[keyLength];
 
@@ -527,6 +530,9 @@ public class PEMFile {
 
 private byte[] deriveKeyPBKDF2(String algorithm, String password, 
byte[] salt, int iterations, int keyLength)
 throws GeneralSecurityException {
+if (password == null) {
+throw new 
IllegalArgumentException(sm.getString("pemFile.noPassword"));
+}
 SecretKeyFactory secretKeyFactory = 
SecretKeyFactory.getInstance(algorithm);
 KeySpec keySpec;
 keySpec = new PBEKeySpec(password.toCharArray(), salt, iterations, 
keyLength);


-
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: Avoid NPE

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new a8430c65b4 Avoid NPE
a8430c65b4 is described below

commit a8430c65b4ab5ffb50097d747921f397d34d8e82
Author: remm 
AuthorDate: Mon Jan 15 14:38:09 2024 +0100

Avoid NPE

Reported by coverity.
---
 java/org/apache/tomcat/util/net/jsse/LocalStrings.properties | 1 +
 java/org/apache/tomcat/util/net/jsse/PEMFile.java| 6 ++
 2 files changed, 7 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
index 9a21160bd7..6a3d1fd3e7 100644
--- a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
@@ -20,6 +20,7 @@ jsseUtil.excludeProtocol=The SSL protocol [{0}] which is 
supported in this JRE w
 jsseUtil.noDefaultProtocols=Unable to determine a default for 
sslEnabledProtocols. Set an explicit value to ensure the connector can start.
 
 pemFile.noMultiPrimes=The PKCS#1 certificate is in multi-prime format and Java 
does not provide an API for constructing an RSA private key object from that 
format
+pemFile.noPassword=A password is required to decrypt the private key
 pemFile.notPbkdf2=The OID [{0}] is not the correct OID for PKBDF2 which is the 
only permitted KDF for PBES2
 pemFile.notValidRFC5915=The provided key file does not conform to RFC 5915
 pemFile.parseError=Unable to parse the key from [{0}]
diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java 
b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index 0185a62bcb..8b5e8fdc61 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -505,6 +505,9 @@ public class PEMFile {
 
 
 private byte[] deriveKeyPBKDF1(int keyLength, String password, byte[] 
salt) throws NoSuchAlgorithmException {
+if (password == null) {
+throw new 
IllegalArgumentException(sm.getString("pemFile.noPassword"));
+}
 // PBKDF1-MD5 as specified by PKCS#5
 byte[] key = new byte[keyLength];
 
@@ -529,6 +532,9 @@ public class PEMFile {
 
 private byte[] deriveKeyPBKDF2(String algorithm, String password, 
byte[] salt, int iterations, int keyLength)
 throws GeneralSecurityException {
+if (password == null) {
+throw new 
IllegalArgumentException(sm.getString("pemFile.noPassword"));
+}
 SecretKeyFactory secretKeyFactory = 
SecretKeyFactory.getInstance(algorithm);
 KeySpec keySpec;
 keySpec = new PBEKeySpec(password.toCharArray(), salt, iterations, 
keyLength);


-
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: Avoid NPE

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

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


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

commit eca81d9607db983e28ab98778230077bd9cd1726
Author: remm 
AuthorDate: Mon Jan 15 14:38:09 2024 +0100

Avoid NPE

Reported by coverity.
---
 java/org/apache/tomcat/util/net/jsse/LocalStrings.properties | 1 +
 java/org/apache/tomcat/util/net/jsse/PEMFile.java| 6 ++
 2 files changed, 7 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
index 9a21160bd7..6a3d1fd3e7 100644
--- a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
@@ -20,6 +20,7 @@ jsseUtil.excludeProtocol=The SSL protocol [{0}] which is 
supported in this JRE w
 jsseUtil.noDefaultProtocols=Unable to determine a default for 
sslEnabledProtocols. Set an explicit value to ensure the connector can start.
 
 pemFile.noMultiPrimes=The PKCS#1 certificate is in multi-prime format and Java 
does not provide an API for constructing an RSA private key object from that 
format
+pemFile.noPassword=A password is required to decrypt the private key
 pemFile.notPbkdf2=The OID [{0}] is not the correct OID for PKBDF2 which is the 
only permitted KDF for PBES2
 pemFile.notValidRFC5915=The provided key file does not conform to RFC 5915
 pemFile.parseError=Unable to parse the key from [{0}]
diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java 
b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index 0185a62bcb..8b5e8fdc61 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -505,6 +505,9 @@ public class PEMFile {
 
 
 private byte[] deriveKeyPBKDF1(int keyLength, String password, byte[] 
salt) throws NoSuchAlgorithmException {
+if (password == null) {
+throw new 
IllegalArgumentException(sm.getString("pemFile.noPassword"));
+}
 // PBKDF1-MD5 as specified by PKCS#5
 byte[] key = new byte[keyLength];
 
@@ -529,6 +532,9 @@ public class PEMFile {
 
 private byte[] deriveKeyPBKDF2(String algorithm, String password, 
byte[] salt, int iterations, int keyLength)
 throws GeneralSecurityException {
+if (password == null) {
+throw new 
IllegalArgumentException(sm.getString("pemFile.noPassword"));
+}
 SecretKeyFactory secretKeyFactory = 
SecretKeyFactory.getInstance(algorithm);
 KeySpec keySpec;
 keySpec = new PBEKeySpec(password.toCharArray(), salt, iterations, 
keyLength);


-
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: Align with 9.0.x onwards

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 3f9950cd9c Align with 9.0.x onwards
3f9950cd9c is described below

commit 3f9950cd9caea493e1345c6ad2ce7e3b2da1a9fc
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:43:49 2024 +

Align with 9.0.x onwards
---
 .../apache/catalina/ssi/ExpressionParseTree.java   |  2 +-
 .../catalina/ssi/ResponseIncludeWrapper.java   | 30 +-
 .../catalina/ssi/SSIServletExternalResolver.java   |  3 ---
 3 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ExpressionParseTree.java 
b/java/org/apache/catalina/ssi/ExpressionParseTree.java
index 1199f6b1f7..3c199787b1 100644
--- a/java/org/apache/catalina/ssi/ExpressionParseTree.java
+++ b/java/org/apache/catalina/ssi/ExpressionParseTree.java
@@ -404,7 +404,7 @@ public class ExpressionParseTree {
 return -1;
 }
 } catch (PatternSyntaxException pse) {
-ssiMediator.log("Invalid expression: " + expr, pse);
+
ssiMediator.log(sm.getString("expressionParseTree.invalidExpression", expr), 
pse);
 return 0;
 }
 }
diff --git a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java 
b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
index 1a59760f91..50cb5f09d7 100644
--- a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
+++ b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
@@ -19,16 +19,13 @@ package org.apache.catalina.ssi;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.util.Locale;
-import java.util.TimeZone;
 
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponseWrapper;
 
-import org.apache.tomcat.util.ExceptionUtils;
+import org.apache.tomcat.util.http.FastHttpDateFormat;
 
 /**
  * An HttpServletResponseWrapper, used from 
SSIServletExternalResolver
@@ -41,8 +38,6 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
  * The names of some headers we want to capture.
  */
 private static final String LAST_MODIFIED = "last-modified";
-private static final DateFormat RFC1123_FORMAT;
-private static final String RFC1123_PATTERN = "EEE, dd MMM  HH:mm:ss 
z";
 
 protected long lastModified = -1;
 
@@ -53,11 +48,6 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 protected ServletOutputStream servletOutputStream;
 protected PrintWriter printWriter;
 
-static {
-RFC1123_FORMAT = new SimpleDateFormat(RFC1123_PATTERN, Locale.US);
-RFC1123_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
-}
-
 /**
  * Initialize our wrapper with the current HttpServletResponse and 
ServletOutputStream.
  *
@@ -151,12 +141,9 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 super.addHeader(name, value);
 String lname = name.toLowerCase(Locale.ENGLISH);
 if (lname.equals(LAST_MODIFIED)) {
-try {
-synchronized (RFC1123_FORMAT) {
-lastModified = RFC1123_FORMAT.parse(value).getTime();
-}
-} catch (Throwable ignore) {
-ExceptionUtils.handleThrowable(ignore);
+long lastModified = FastHttpDateFormat.parseDate(value);
+if (lastModified != -1) {
+this.lastModified = lastModified;
 }
 }
 }
@@ -175,12 +162,9 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 super.setHeader(name, value);
 String lname = name.toLowerCase(Locale.ENGLISH);
 if (lname.equals(LAST_MODIFIED)) {
-try {
-synchronized (RFC1123_FORMAT) {
-lastModified = RFC1123_FORMAT.parse(value).getTime();
-}
-} catch (Throwable ignore) {
-ExceptionUtils.handleThrowable(ignore);
+long lastModified = FastHttpDateFormat.parseDate(value);
+if (lastModified != -1) {
+this.lastModified = lastModified;
 }
 }
 }
diff --git a/java/org/apache/catalina/ssi/SSIServletExternalResolver.java 
b/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
index cbf2492490..67b1b02da1 100644
--- a/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
+++ b/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
@@ -410,9 +410,6 @@ public class SSIServletExternalResolver implements 
SSIExternalResolver {
 // ie: '/file1.shtml' vs 

(tomcat) branch main updated: Avoid NPE

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

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


The following commit(s) were added to refs/heads/main by this push:
 new b42a0e508c Avoid NPE
b42a0e508c is described below

commit b42a0e508cdc46dc9aab2c390d45074ede1679f5
Author: remm 
AuthorDate: Mon Jan 15 14:38:09 2024 +0100

Avoid NPE

Reported by coverity.
---
 java/org/apache/tomcat/util/net/jsse/LocalStrings.properties | 1 +
 java/org/apache/tomcat/util/net/jsse/PEMFile.java| 6 ++
 2 files changed, 7 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
index 888a2a6761..4e57393326 100644
--- a/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/jsse/LocalStrings.properties
@@ -20,6 +20,7 @@ jsseUtil.excludeProtocol=The SSL protocol [{0}] which is 
supported in this JRE w
 jsseUtil.noDefaultProtocols=Unable to determine a default for 
sslEnabledProtocols. Set an explicit value to ensure the connector can start.
 
 pemFile.noMultiPrimes=The PKCS#1 certificate is in multi-prime format and Java 
does not provide an API for constructing an RSA private key object from that 
format
+pemFile.noPassword=A password is required to decrypt the private key
 pemFile.notValidRFC5915=The provided key file does not conform to RFC 5915
 pemFile.notPbkdf2=The OID [{0}] is not the correct OID for PKBDF2 which is the 
only permitted KDF for PBES2
 pemFile.parseError=Unable to parse the key from [{0}]
diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java 
b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index 0185a62bcb..8b5e8fdc61 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -505,6 +505,9 @@ public class PEMFile {
 
 
 private byte[] deriveKeyPBKDF1(int keyLength, String password, byte[] 
salt) throws NoSuchAlgorithmException {
+if (password == null) {
+throw new 
IllegalArgumentException(sm.getString("pemFile.noPassword"));
+}
 // PBKDF1-MD5 as specified by PKCS#5
 byte[] key = new byte[keyLength];
 
@@ -529,6 +532,9 @@ public class PEMFile {
 
 private byte[] deriveKeyPBKDF2(String algorithm, String password, 
byte[] salt, int iterations, int keyLength)
 throws GeneralSecurityException {
+if (password == null) {
+throw new 
IllegalArgumentException(sm.getString("pemFile.noPassword"));
+}
 SecretKeyFactory secretKeyFactory = 
SecretKeyFactory.getInstance(algorithm);
 KeySpec keySpec;
 keySpec = new PBEKeySpec(password.toCharArray(), salt, iterations, 
keyLength);


-
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

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

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


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

commit 2a04744c13341c43f90274abe2558464115f7d32
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:32:45 2024 +

Fix typo
---
 java/org/apache/catalina/ssi/ResponseIncludeWrapper.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java 
b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
index 3410a82c7a..1a59760f91 100644
--- a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
+++ b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
@@ -87,7 +87,7 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 
 
 /**
- * Return a printwriter, throws and exception if an OutputStream already 
been returned.
+ * Return a printwriter, throws an exception if an OutputStream already 
been returned.
  *
  * @return a PrintWriter object
  *
@@ -108,7 +108,7 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 
 
 /**
- * Return an OutputStream, throws and exception if a printwriter already 
been returned.
+ * Return an OutputStream, throws an exception if a printwriter already 
been returned.
  *
  * @return an OutputStream object
  *


-
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

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

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


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

commit 87f2834c256a26323a6a53d5aa3e10168e073540
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:32:45 2024 +

Fix typo
---
 java/org/apache/catalina/ssi/ResponseIncludeWrapper.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java 
b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
index 2271ea7414..50cb5f09d7 100644
--- a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
+++ b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
@@ -77,7 +77,7 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 
 
 /**
- * Return a printwriter, throws and exception if an OutputStream already 
been returned.
+ * Return a printwriter, throws an exception if an OutputStream already 
been returned.
  *
  * @return a PrintWriter object
  *
@@ -98,7 +98,7 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 
 
 /**
- * Return an OutputStream, throws and exception if a printwriter already 
been returned.
+ * Return an OutputStream, throws an exception if a printwriter already 
been returned.
  *
  * @return an OutputStream object
  *


-
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

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

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


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

commit 9891eca1b0bbe6b4a6a5a17a2e2ffad41daa6f8c
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:32:45 2024 +

Fix typo
---
 java/org/apache/catalina/ssi/ResponseIncludeWrapper.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java 
b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
index 7a06d27735..ed5629d3d8 100644
--- a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
+++ b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
@@ -77,7 +77,7 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 
 
 /**
- * Return a printwriter, throws and exception if an OutputStream already 
been returned.
+ * Return a printwriter, throws an exception if an OutputStream already 
been returned.
  *
  * @return a PrintWriter object
  *
@@ -98,7 +98,7 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 
 
 /**
- * Return an OutputStream, throws and exception if a printwriter already 
been returned.
+ * Return an OutputStream, throws an exception if a printwriter already 
been returned.
  *
  * @return an OutputStream object
  *


-
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

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

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


The following commit(s) were added to refs/heads/main by this push:
 new 896e5d8bc7 Fix typo
896e5d8bc7 is described below

commit 896e5d8bc76ec159d4950e4602bfcebe99233b52
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:32:45 2024 +

Fix typo
---
 java/org/apache/catalina/ssi/ResponseIncludeWrapper.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java 
b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
index 7a06d27735..ed5629d3d8 100644
--- a/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
+++ b/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
@@ -77,7 +77,7 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 
 
 /**
- * Return a printwriter, throws and exception if an OutputStream already 
been returned.
+ * Return a printwriter, throws an exception if an OutputStream already 
been returned.
  *
  * @return a PrintWriter object
  *
@@ -98,7 +98,7 @@ public class ResponseIncludeWrapper extends 
HttpServletResponseWrapper {
 
 
 /**
- * Return an OutputStream, throws and exception if a printwriter already 
been returned.
+ * Return an OutputStream, throws an exception if a printwriter already 
been returned.
  *
  * @return an OutputStream object
  *


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



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

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

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

commit 5d509be3ede12e9616b5b8549613dc50c2e3b16b
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:23:30 2024 +

Code clean-up. Formatting. No functional change.
---
 .../catalina/ssi/ByteArrayServletOutputStream.java |   4 +-
 .../apache/catalina/ssi/ExpressionParseTree.java   |  74 
 .../apache/catalina/ssi/ExpressionTokenizer.java   |  39 ++--
 .../catalina/ssi/ResponseIncludeWrapper.java   |  49 +++--
 java/org/apache/catalina/ssi/SSICommand.java   |  29 ++-
 java/org/apache/catalina/ssi/SSIConditional.java   |  25 ++-
 .../apache/catalina/ssi/SSIConditionalState.java   |  11 +-
 java/org/apache/catalina/ssi/SSIConfig.java|  14 +-
 java/org/apache/catalina/ssi/SSIEcho.java  |  15 +-
 java/org/apache/catalina/ssi/SSIExec.java  |  18 +-
 .../apache/catalina/ssi/SSIExternalResolver.java   |  26 ++-
 java/org/apache/catalina/ssi/SSIFilter.java|  45 ++---
 java/org/apache/catalina/ssi/SSIFlastmod.java  |  20 +--
 java/org/apache/catalina/ssi/SSIFsize.java |  25 ++-
 java/org/apache/catalina/ssi/SSIInclude.java   |  23 +--
 java/org/apache/catalina/ssi/SSIMediator.java  |  70 +++-
 java/org/apache/catalina/ssi/SSIPrintenv.java  |   8 +-
 java/org/apache/catalina/ssi/SSIProcessor.java | 113 +---
 java/org/apache/catalina/ssi/SSIServlet.java   |  86 -
 .../catalina/ssi/SSIServletExternalResolver.java   | 197 -
 .../apache/catalina/ssi/SSIServletRequestUtil.java |  18 +-
 java/org/apache/catalina/ssi/SSISet.java   |  12 +-
 .../catalina/ssi/SSIStopProcessingException.java   |   5 +-
 23 files changed, 389 insertions(+), 537 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java 
b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
index 25cb0ee826..2b364e18a1 100644
--- a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
+++ b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
@@ -23,10 +23,10 @@ import javax.servlet.WriteListener;
 
 
 /**
- * Class that extends ServletOutputStream, used as a wrapper from within
- * SsiInclude
+ * Class that extends ServletOutputStream, used as a wrapper from within 
SsiInclude
  *
  * @author Bip Thelin
+ *
  * @see ServletOutputStream and ByteArrayOutputStream
  */
 public class ByteArrayServletOutputStream extends ServletOutputStream {
diff --git a/java/org/apache/catalina/ssi/ExpressionParseTree.java 
b/java/org/apache/catalina/ssi/ExpressionParseTree.java
index 17774e4ee8..c79623814a 100644
--- a/java/org/apache/catalina/ssi/ExpressionParseTree.java
+++ b/java/org/apache/catalina/ssi/ExpressionParseTree.java
@@ -32,13 +32,13 @@ import org.apache.tomcat.util.ExceptionUtils;
  */
 public class ExpressionParseTree {
 /**
- * Contains the current set of completed nodes. This is a workspace for the
- * parser. Needs to be LinkedList since it can contain {@code null}s.
+ * Contains the current set of completed nodes. This is a workspace for 
the parser. Needs to be LinkedList since it
+ * can contain {@code null}s.
  */
 private final LinkedList nodeStack = new LinkedList<>();
 /**
- * Contains operator nodes that don't yet have values. This is a workspace
- * for the parser. Needs to be LinkedList since it can contain {@code 
null}s.
+ * Contains operator nodes that don't yet have values. This is a workspace 
for the parser. Needs to be LinkedList
+ * since it can contain {@code null}s.
  */
 private final LinkedList oppStack = new LinkedList<>();
 /**
@@ -53,20 +53,20 @@ public class ExpressionParseTree {
 
 /**
  * Creates a new parse tree for the specified expression.
- * @param expr The expression string
+ *
+ * @param exprThe expression string
  * @param ssiMediator Used to evaluated the expressions
+ *
  * @throws ParseException a parsing error occurred
  */
-public ExpressionParseTree(String expr, SSIMediator ssiMediator)
-throws ParseException {
+public ExpressionParseTree(String expr, SSIMediator ssiMediator) throws 
ParseException {
 this.ssiMediator = ssiMediator;
 parseExpression(expr);
 }
 
 
 /**
- * Evaluates the tree and returns true or false. The specified SSIMediator
- * is used to resolve variable references.
+ * Evaluates the tree and returns true or false. The specified SSIMediator 
is used to resolve variable references.
  *
  * @return the evaluation result
  *
@@ -83,8 +83,8 @@ public class ExpressionParseTree {
 
 
 /**
- * Pushes a new operator onto the opp stack, resolving existing opps as
- * needed.
+ * Pushes a new operator onto the opp stack, resolving existing opps as 
needed.
+ *
  * 

(tomcat) 02/02: Align with 9.0.x onwards

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

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

commit 886c988a25872eec14766e89e0a9a19f309381bb
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:33:59 2024 +

Align with 9.0.x onwards
---
 .../apache/catalina/ssi/ExpressionParseTree.java   |  8 ++--
 .../apache/catalina/ssi/LocalStrings.properties| 46 ++
 .../apache/catalina/ssi/LocalStrings_fr.properties | 46 ++
 .../apache/catalina/ssi/LocalStrings_ja.properties | 46 ++
 .../apache/catalina/ssi/LocalStrings_ko.properties | 46 ++
 .../catalina/ssi/LocalStrings_zh_CN.properties | 46 ++
 .../catalina/ssi/ResponseIncludeWrapper.java   |  6 +--
 java/org/apache/catalina/ssi/SSIConfig.java|  6 ++-
 java/org/apache/catalina/ssi/SSIEcho.java  |  9 +++--
 java/org/apache/catalina/ssi/SSIExec.java  |  8 ++--
 java/org/apache/catalina/ssi/SSIFilter.java|  2 +-
 java/org/apache/catalina/ssi/SSIFlastmod.java  |  9 +++--
 java/org/apache/catalina/ssi/SSIFsize.java | 11 --
 java/org/apache/catalina/ssi/SSIInclude.java   | 10 +++--
 java/org/apache/catalina/ssi/SSIMediator.java  | 19 -
 java/org/apache/catalina/ssi/SSIServlet.java   |  2 -
 .../catalina/ssi/SSIServletExternalResolver.java   | 24 +--
 java/org/apache/catalina/ssi/SSISet.java   | 10 +++--
 18 files changed, 303 insertions(+), 51 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ExpressionParseTree.java 
b/java/org/apache/catalina/ssi/ExpressionParseTree.java
index c79623814a..1199f6b1f7 100644
--- a/java/org/apache/catalina/ssi/ExpressionParseTree.java
+++ b/java/org/apache/catalina/ssi/ExpressionParseTree.java
@@ -24,6 +24,7 @@ import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
 import org.apache.tomcat.util.ExceptionUtils;
+import org.apache.tomcat.util.res.StringManager;
 
 /**
  * Represents a parsed expression.
@@ -31,6 +32,7 @@ import org.apache.tomcat.util.ExceptionUtils;
  * @author Paul Speed
  */
 public class ExpressionParseTree {
+private static final StringManager sm = 
StringManager.getManager(ExpressionParseTree.class);
 /**
  * Contains the current set of completed nodes. This is a workspace for 
the parser. Needs to be LinkedList since it
  * can contain {@code null}s.
@@ -214,13 +216,13 @@ public class ExpressionParseTree {
 // Finish off the rest of the opps
 resolveGroup();
 if (nodeStack.size() == 0) {
-throw new ParseException("No nodes created.", et.getIndex());
+throw new 
ParseException(sm.getString("expressionParseTree.noNodes"), et.getIndex());
 }
 if (nodeStack.size() > 1) {
-throw new ParseException("Extra nodes created.", et.getIndex());
+throw new 
ParseException(sm.getString("expressionParseTree.extraNodes"), et.getIndex());
 }
 if (oppStack.size() != 0) {
-throw new ParseException("Unused opp nodes exist.", et.getIndex());
+throw new 
ParseException(sm.getString("expressionParseTree.unusedOpCodes"), 
et.getIndex());
 }
 root = nodeStack.get(0);
 }
diff --git a/java/org/apache/catalina/ssi/LocalStrings.properties 
b/java/org/apache/catalina/ssi/LocalStrings.properties
new file mode 100644
index 00..68736ee66d
--- /dev/null
+++ b/java/org/apache/catalina/ssi/LocalStrings.properties
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+expressionParseTree.extraNodes=Extra nodes created
+expressionParseTree.invalidExpression=Invalid expression [{0}]
+expressionParseTree.noNodes=No nodes created
+expressionParseTree.unusedOpCodes=Unused nodes exist
+
+ssiCommand.invalidAttribute=Invalid attribute [{0}]
+
+ssiEcho.invalidEncoding=Invalid encoding [{0}]
+
+ssiExec.executeFailed=Cannot execute file [{0}]
+
+ssiFlastmod.noLastModified=Cannot get last modification date for file [{0}]
+
+ssiFsize.invalidNumChars=The number of characters cannot be negative
+ssiFsize.noSize=Cannot get size for file [{0}]
+

(tomcat) branch 8.5.x updated (5a2e706b92 -> 886c988a25)

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

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


from 5a2e706b92 Fix logic bug spotted by Coverity Scan
 new 5d509be3ed Code clean-up. Formatting. No functional change.
 new 886c988a25 Align with 9.0.x onwards

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:
 .../catalina/ssi/ByteArrayServletOutputStream.java |   4 +-
 .../apache/catalina/ssi/ExpressionParseTree.java   |  82 +
 .../apache/catalina/ssi/ExpressionTokenizer.java   |  39 ++--
 .../apache/catalina/ssi/LocalStrings.properties|  46 +
 .../apache/catalina/ssi/LocalStrings_fr.properties |  46 +
 .../apache/catalina/ssi/LocalStrings_ja.properties |  46 +
 .../apache/catalina/ssi/LocalStrings_ko.properties |  46 +
 .../catalina/ssi/LocalStrings_zh_CN.properties |  46 +
 .../catalina/ssi/ResponseIncludeWrapper.java   |  51 +++--
 java/org/apache/catalina/ssi/SSICommand.java   |  29 ++-
 java/org/apache/catalina/ssi/SSIConditional.java   |  25 ++-
 .../apache/catalina/ssi/SSIConditionalState.java   |  11 +-
 java/org/apache/catalina/ssi/SSIConfig.java|  20 +-
 java/org/apache/catalina/ssi/SSIEcho.java  |  24 ++-
 java/org/apache/catalina/ssi/SSIExec.java  |  24 +--
 .../apache/catalina/ssi/SSIExternalResolver.java   |  26 +--
 java/org/apache/catalina/ssi/SSIFilter.java|  47 ++---
 java/org/apache/catalina/ssi/SSIFlastmod.java  |  25 ++-
 java/org/apache/catalina/ssi/SSIFsize.java |  34 ++--
 java/org/apache/catalina/ssi/SSIInclude.java   |  29 ++-
 java/org/apache/catalina/ssi/SSIMediator.java  |  83 -
 java/org/apache/catalina/ssi/SSIPrintenv.java  |   8 +-
 java/org/apache/catalina/ssi/SSIProcessor.java | 113 +---
 java/org/apache/catalina/ssi/SSIServlet.java   |  88 -
 .../catalina/ssi/SSIServletExternalResolver.java   | 205 +
 .../apache/catalina/ssi/SSIServletRequestUtil.java |  18 +-
 java/org/apache/catalina/ssi/SSISet.java   |  22 ++-
 .../catalina/ssi/SSIStopProcessingException.java   |   5 +-
 28 files changed, 673 insertions(+), 569 deletions(-)
 create mode 100644 java/org/apache/catalina/ssi/LocalStrings.properties
 create mode 100644 java/org/apache/catalina/ssi/LocalStrings_fr.properties
 create mode 100644 java/org/apache/catalina/ssi/LocalStrings_ja.properties
 create mode 100644 java/org/apache/catalina/ssi/LocalStrings_ko.properties
 create mode 100644 java/org/apache/catalina/ssi/LocalStrings_zh_CN.properties


-
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: Code clean-up. Formatting. No functional change.

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new cef002f0c0 Code clean-up. Formatting. No functional change.
cef002f0c0 is described below

commit cef002f0c0d46657978ed7f44b78df62ac7f4bdc
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:23:15 2024 +

Code clean-up. Formatting. No functional change.
---
 .../catalina/ssi/ByteArrayServletOutputStream.java |   4 +-
 .../apache/catalina/ssi/ExpressionParseTree.java   |  75 +
 .../apache/catalina/ssi/ExpressionTokenizer.java   |  39 +++--
 .../catalina/ssi/ResponseIncludeWrapper.java   |  45 +++---
 java/org/apache/catalina/ssi/SSICommand.java   |  29 ++--
 java/org/apache/catalina/ssi/SSIConditional.java   |  25 ++-
 .../apache/catalina/ssi/SSIConditionalState.java   |  11 +-
 java/org/apache/catalina/ssi/SSIConfig.java|  15 +-
 java/org/apache/catalina/ssi/SSIEcho.java  |  15 +-
 java/org/apache/catalina/ssi/SSIExec.java  |  16 +-
 .../apache/catalina/ssi/SSIExternalResolver.java   |  26 ++--
 java/org/apache/catalina/ssi/SSIFilter.java|  42 ++---
 java/org/apache/catalina/ssi/SSIFlastmod.java  |  14 +-
 java/org/apache/catalina/ssi/SSIFsize.java |  22 ++-
 java/org/apache/catalina/ssi/SSIInclude.java   |  18 +--
 java/org/apache/catalina/ssi/SSIMediator.java  |  80 --
 java/org/apache/catalina/ssi/SSIPrintenv.java  |   8 +-
 java/org/apache/catalina/ssi/SSIProcessor.java | 113 ++
 java/org/apache/catalina/ssi/SSIServlet.java   |  86 ---
 .../catalina/ssi/SSIServletExternalResolver.java   | 171 +
 .../apache/catalina/ssi/SSIServletRequestUtil.java |  18 +--
 java/org/apache/catalina/ssi/SSISet.java   |  13 +-
 .../catalina/ssi/SSIStopProcessingException.java   |   5 +-
 23 files changed, 379 insertions(+), 511 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java 
b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
index 25cb0ee826..2b364e18a1 100644
--- a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
+++ b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
@@ -23,10 +23,10 @@ import javax.servlet.WriteListener;
 
 
 /**
- * Class that extends ServletOutputStream, used as a wrapper from within
- * SsiInclude
+ * Class that extends ServletOutputStream, used as a wrapper from within 
SsiInclude
  *
  * @author Bip Thelin
+ *
  * @see ServletOutputStream and ByteArrayOutputStream
  */
 public class ByteArrayServletOutputStream extends ServletOutputStream {
diff --git a/java/org/apache/catalina/ssi/ExpressionParseTree.java 
b/java/org/apache/catalina/ssi/ExpressionParseTree.java
index ce535d268e..af181050e3 100644
--- a/java/org/apache/catalina/ssi/ExpressionParseTree.java
+++ b/java/org/apache/catalina/ssi/ExpressionParseTree.java
@@ -26,6 +26,7 @@ import java.util.regex.PatternSyntaxException;
 
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
+
 /**
  * Represents a parsed expression.
  *
@@ -34,13 +35,13 @@ import org.apache.tomcat.util.res.StringManager;
 public class ExpressionParseTree {
 private static final StringManager sm = 
StringManager.getManager(ExpressionParseTree.class);
 /**
- * Contains the current set of completed nodes. This is a workspace for the
- * parser. Needs to be LinkedList since it can contain {@code null}s.
+ * Contains the current set of completed nodes. This is a workspace for 
the parser. Needs to be LinkedList since it
+ * can contain {@code null}s.
  */
 private final LinkedList nodeStack = new LinkedList<>();
 /**
- * Contains operator nodes that don't yet have values. This is a workspace
- * for the parser. Needs to be LinkedList since it can contain {@code 
null}s.
+ * Contains operator nodes that don't yet have values. This is a workspace 
for the parser. Needs to be LinkedList
+ * since it can contain {@code null}s.
  */
 private final LinkedList oppStack = new LinkedList<>();
 /**
@@ -55,20 +56,20 @@ public class ExpressionParseTree {
 
 /**
  * Creates a new parse tree for the specified expression.
- * @param expr The expression string
+ *
+ * @param exprThe expression string
  * @param ssiMediator Used to evaluated the expressions
+ *
  * @throws ParseException a parsing error occurred
  */
-public ExpressionParseTree(String expr, SSIMediator ssiMediator)
-throws ParseException {
+public ExpressionParseTree(String expr, SSIMediator ssiMediator) throws 
ParseException {
 this.ssiMediator = ssiMediator;
 parseExpression(expr);
 }
 
 
 /**
- * Evaluates the tree and returns true or false. The specified 

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

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

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


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

commit 62354dc8acb25e73842865df5344b4967141
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:11:19 2024 +

Code clean-up. Formatting. No functional change.
---
 .../catalina/ssi/ByteArrayServletOutputStream.java |   4 +-
 .../apache/catalina/ssi/ExpressionParseTree.java   |  75 +
 .../apache/catalina/ssi/ExpressionTokenizer.java   |  39 +++--
 .../catalina/ssi/ResponseIncludeWrapper.java   |  45 +++---
 java/org/apache/catalina/ssi/SSICommand.java   |  29 ++--
 java/org/apache/catalina/ssi/SSIConditional.java   |  25 ++-
 .../apache/catalina/ssi/SSIConditionalState.java   |  11 +-
 java/org/apache/catalina/ssi/SSIConfig.java|  15 +-
 java/org/apache/catalina/ssi/SSIEcho.java  |  15 +-
 java/org/apache/catalina/ssi/SSIExec.java  |  16 +-
 .../apache/catalina/ssi/SSIExternalResolver.java   |  26 ++--
 java/org/apache/catalina/ssi/SSIFilter.java|  42 ++---
 java/org/apache/catalina/ssi/SSIFlastmod.java  |  14 +-
 java/org/apache/catalina/ssi/SSIFsize.java |  22 ++-
 java/org/apache/catalina/ssi/SSIInclude.java   |  18 +--
 java/org/apache/catalina/ssi/SSIMediator.java  |  80 --
 java/org/apache/catalina/ssi/SSIPrintenv.java  |   8 +-
 java/org/apache/catalina/ssi/SSIProcessor.java | 113 ++
 java/org/apache/catalina/ssi/SSIServlet.java   |  86 ---
 .../catalina/ssi/SSIServletExternalResolver.java   | 171 +
 .../apache/catalina/ssi/SSIServletRequestUtil.java |  18 +--
 java/org/apache/catalina/ssi/SSISet.java   |  13 +-
 .../catalina/ssi/SSIStopProcessingException.java   |   5 +-
 23 files changed, 379 insertions(+), 511 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java 
b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
index 4f1f8d7039..aa713db084 100644
--- a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
+++ b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
@@ -23,10 +23,10 @@ import jakarta.servlet.WriteListener;
 
 
 /**
- * Class that extends ServletOutputStream, used as a wrapper from within
- * SsiInclude
+ * Class that extends ServletOutputStream, used as a wrapper from within 
SsiInclude
  *
  * @author Bip Thelin
+ *
  * @see ServletOutputStream and ByteArrayOutputStream
  */
 public class ByteArrayServletOutputStream extends ServletOutputStream {
diff --git a/java/org/apache/catalina/ssi/ExpressionParseTree.java 
b/java/org/apache/catalina/ssi/ExpressionParseTree.java
index ce535d268e..af181050e3 100644
--- a/java/org/apache/catalina/ssi/ExpressionParseTree.java
+++ b/java/org/apache/catalina/ssi/ExpressionParseTree.java
@@ -26,6 +26,7 @@ import java.util.regex.PatternSyntaxException;
 
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
+
 /**
  * Represents a parsed expression.
  *
@@ -34,13 +35,13 @@ import org.apache.tomcat.util.res.StringManager;
 public class ExpressionParseTree {
 private static final StringManager sm = 
StringManager.getManager(ExpressionParseTree.class);
 /**
- * Contains the current set of completed nodes. This is a workspace for the
- * parser. Needs to be LinkedList since it can contain {@code null}s.
+ * Contains the current set of completed nodes. This is a workspace for 
the parser. Needs to be LinkedList since it
+ * can contain {@code null}s.
  */
 private final LinkedList nodeStack = new LinkedList<>();
 /**
- * Contains operator nodes that don't yet have values. This is a workspace
- * for the parser. Needs to be LinkedList since it can contain {@code 
null}s.
+ * Contains operator nodes that don't yet have values. This is a workspace 
for the parser. Needs to be LinkedList
+ * since it can contain {@code null}s.
  */
 private final LinkedList oppStack = new LinkedList<>();
 /**
@@ -55,20 +56,20 @@ public class ExpressionParseTree {
 
 /**
  * Creates a new parse tree for the specified expression.
- * @param expr The expression string
+ *
+ * @param exprThe expression string
  * @param ssiMediator Used to evaluated the expressions
+ *
  * @throws ParseException a parsing error occurred
  */
-public ExpressionParseTree(String expr, SSIMediator ssiMediator)
-throws ParseException {
+public ExpressionParseTree(String expr, SSIMediator ssiMediator) throws 
ParseException {
 this.ssiMediator = ssiMediator;
 parseExpression(expr);
 }
 
 
 /**
- * Evaluates the tree and returns true or false. The specified 

(tomcat) branch main updated: Code clean-up. Formatting. No functional change.

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

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


The following commit(s) were added to refs/heads/main by this push:
 new 99754a3941 Code clean-up. Formatting. No functional change.
99754a3941 is described below

commit 99754a3941769ff6b89fd530c63571ea1fba6641
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:03:24 2024 +

Code clean-up. Formatting. No functional change.
---
 .../catalina/ssi/ByteArrayServletOutputStream.java |   4 +-
 .../apache/catalina/ssi/ExpressionParseTree.java   |  75 +
 .../apache/catalina/ssi/ExpressionTokenizer.java   |  39 +++--
 .../catalina/ssi/ResponseIncludeWrapper.java   |  45 +++---
 java/org/apache/catalina/ssi/SSICommand.java   |  29 ++--
 java/org/apache/catalina/ssi/SSIConditional.java   |  25 ++-
 .../apache/catalina/ssi/SSIConditionalState.java   |  11 +-
 java/org/apache/catalina/ssi/SSIConfig.java|  13 +-
 java/org/apache/catalina/ssi/SSIEcho.java  |  15 +-
 java/org/apache/catalina/ssi/SSIExec.java  |  13 +-
 .../apache/catalina/ssi/SSIExternalResolver.java   |  26 ++--
 java/org/apache/catalina/ssi/SSIFilter.java|  42 ++---
 java/org/apache/catalina/ssi/SSIFlastmod.java  |  14 +-
 java/org/apache/catalina/ssi/SSIFsize.java |  22 ++-
 java/org/apache/catalina/ssi/SSIInclude.java   |  18 +--
 java/org/apache/catalina/ssi/SSIMediator.java  |  78 --
 java/org/apache/catalina/ssi/SSIPrintenv.java  |   8 +-
 java/org/apache/catalina/ssi/SSIProcessor.java | 111 ++---
 java/org/apache/catalina/ssi/SSIServlet.java   |  86 ---
 .../catalina/ssi/SSIServletExternalResolver.java   | 171 +
 .../apache/catalina/ssi/SSIServletRequestUtil.java |  18 +--
 java/org/apache/catalina/ssi/SSISet.java   |  13 +-
 .../catalina/ssi/SSIStopProcessingException.java   |   5 +-
 23 files changed, 375 insertions(+), 506 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java 
b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
index 4f1f8d7039..aa713db084 100644
--- a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
+++ b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
@@ -23,10 +23,10 @@ import jakarta.servlet.WriteListener;
 
 
 /**
- * Class that extends ServletOutputStream, used as a wrapper from within
- * SsiInclude
+ * Class that extends ServletOutputStream, used as a wrapper from within 
SsiInclude
  *
  * @author Bip Thelin
+ *
  * @see ServletOutputStream and ByteArrayOutputStream
  */
 public class ByteArrayServletOutputStream extends ServletOutputStream {
diff --git a/java/org/apache/catalina/ssi/ExpressionParseTree.java 
b/java/org/apache/catalina/ssi/ExpressionParseTree.java
index ce535d268e..af181050e3 100644
--- a/java/org/apache/catalina/ssi/ExpressionParseTree.java
+++ b/java/org/apache/catalina/ssi/ExpressionParseTree.java
@@ -26,6 +26,7 @@ import java.util.regex.PatternSyntaxException;
 
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
+
 /**
  * Represents a parsed expression.
  *
@@ -34,13 +35,13 @@ import org.apache.tomcat.util.res.StringManager;
 public class ExpressionParseTree {
 private static final StringManager sm = 
StringManager.getManager(ExpressionParseTree.class);
 /**
- * Contains the current set of completed nodes. This is a workspace for the
- * parser. Needs to be LinkedList since it can contain {@code null}s.
+ * Contains the current set of completed nodes. This is a workspace for 
the parser. Needs to be LinkedList since it
+ * can contain {@code null}s.
  */
 private final LinkedList nodeStack = new LinkedList<>();
 /**
- * Contains operator nodes that don't yet have values. This is a workspace
- * for the parser. Needs to be LinkedList since it can contain {@code 
null}s.
+ * Contains operator nodes that don't yet have values. This is a workspace 
for the parser. Needs to be LinkedList
+ * since it can contain {@code null}s.
  */
 private final LinkedList oppStack = new LinkedList<>();
 /**
@@ -55,20 +56,20 @@ public class ExpressionParseTree {
 
 /**
  * Creates a new parse tree for the specified expression.
- * @param expr The expression string
+ *
+ * @param exprThe expression string
  * @param ssiMediator Used to evaluated the expressions
+ *
  * @throws ParseException a parsing error occurred
  */
-public ExpressionParseTree(String expr, SSIMediator ssiMediator)
-throws ParseException {
+public ExpressionParseTree(String expr, SSIMediator ssiMediator) throws 
ParseException {
 this.ssiMediator = ssiMediator;
 parseExpression(expr);
 }
 
 
 /**
- * Evaluates the tree and returns true or false. The specified 

Re: Supposed to provide performance at daemon thread in tomcat

2024-01-15 Thread koteswara Rao Gundapaneni
hi all,

please find my sample example.

On Mon, Jan 15, 2024 at 1:53 AM Mark Thomas  wrote:

> On 15/01/2024 08:45, koteswara Rao Gundapaneni wrote:
> > On Sun, 14 Jan 2024, 18:13 koteswara Rao Gundapaneni, <
> > koti.gundapan...@gmail.com> wrote:
> >
> >> hi
> >>
> >> Daemon threads have identified the performance issue inorder to
> complete .
> >>
> >
> >
> > Thread which is set as daemon by default has performance bottleneck
>
> If that were the case, there would be a general performance issue for
> every Java application.
>
> I am not aware of any general Java performance issue. You have not
> provided any evidence to support your claim that there is a performance
> issue.
>
> > I explain that as below
> >
> > myeg.setDaemon(true);
> > myeg.start();
> >
> >
> > the above start() method is taking long time to complete which is by
> > default performance bottleneck
>
> You have not explained what object "myeg" is. Based on your previous
> statements and the methods called, it appears to be an instance of Thread.
>
> Thread.start() is unlikely to take a long time to complete. Thread.run()
> might take a long time to complete but that will depend on the run()
> method.
>
> >> so bootstrap has its performance issue as this loader thread is using
> >> daemon thread.
>
> Again, you have provided no evidence to support this statement.
>
> > In our code base we have lot of places where we have the code as below as
> > mentioned above.
> >
> > myeg.setDaemon(true);
> > myeg.start();
> >
> >>
> >> inorder to resolve the issue we will yield the corresponding thread
> >
> >
> > Inorder to limit the time taking for above line of code we have the
> > solution like below
> >
> > myeg.setDaemon(true);
> > myeg.start();
> > myeg.yield();
>
> This is nonsense.
>
> The call to vield() happens after the call to start(). It is impossible
> for the call to yield() to make the call to start() faster.
>
> > the yield method declared as above will reduce the time taking for start
> > method
>
> Again, this is nonsense. What you are stating is logically impossible.
>
> > Hope this will make sense if not I will write it in my own language
> telugu.
>
> In additional to reviewing the above nonsense, I have also reviewed the
> proposed change to Bootstrap.java that claims to "fix" whatever issue is
> observed.
>
> The proposed code doesn't even compile due to basic errors such as
> missing ';'.
>
> The proposed code attempts to call a String method (contains())on a
> String array.
>
> The proposed code attempts to assign a String to a String array.
>
> The proposed code contains multiple instances of unhandled checked
> exceptions.
>
> The proposed code attempts to pass a String when a String array is
> required.
>
> The proposed code attempts to compare a Method instance with a String
> instance
>
> With the above errors fixed the code compiles and, somewhat
> miraculously, Tomcat starts. The code has no effect until Tomcat stops
> (because of the call to daemon.setAwait(true). During the stop process a
> NoSuchMethodException is thrown because of the attempt to call the
> Catalina.yield() method that does not exist.
>
> So, in summary, we have:
>
> - a claim of a performance issue that does not exist
>
> - a claimed solution that is logically impossible
>
> - a proposed patch the doesn't compile and is full of errors
>
> - a proposed patch that, when "fixed", doesn't do anything apart from
>trigger an exception on shutdown
>
> I will not be engaging any further in this thread.
>
> Responding to threads like this wastes the Tomcat community's time and
> detracts the community from useful work. I consider threads like this to
> be harmful to the Tomcat community. Should you start further threads
> like this it is likely that you will be blocked from posting to the
> Tomcat mailing lists and/or be blocked from interacting with the Tomcat
> project at Github and/or be blocked from interacting with the Bugzilla
> instance used by Tomcat and/or blocked from interacting with the Tomcat
> project via any other services.
>
> Mark
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

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

Re: Tomcat 10.1.x uploaded to Coverity for analysis

2024-01-15 Thread Mark Thomas

On 15/01/2024 09:43, Rémy Maucherat wrote:

On Mon, Jan 15, 2024 at 9:30 AM Mark Thomas  wrote:


Hi all,

I have just uploaded the latest 10.1.x to Coverity scan for analysis.

It is going to take a while to process the Coverity build results. I'm
expecting the new results to be available in the UI in a few hours or so.


It only took 30 minutes. Thanks !


No problem.

It is fairly easy to do so I can do this more often if needed.

We could potentially set up the CI to do this - probably as part of the 
nightly build.


Mark

-
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 logic bug spotted by Coverity Scan

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 5a2e706b92 Fix logic bug spotted by Coverity Scan
5a2e706b92 is described below

commit 5a2e706b92aa0921268fee9f1b0bdf9b38ebfe62
Author: Mark Thomas 
AuthorDate: Mon Jan 15 10:11:59 2024 +

Fix logic bug spotted by Coverity Scan
---
 .../tomcat/util/digester/ServiceBindingPropertySource.java   | 2 +-
 webapps/docs/changelog.xml   | 9 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java 
b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
index a96e5d8285..997ce354db 100644
--- a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
+++ b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
@@ -139,7 +139,7 @@ public class ServiceBindingPropertySource implements 
IntrospectionUtils.SecurePr
 int length = bytes.length;
 
 if (chomp) {
-if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
2] == '\n') {
+if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
1] == '\n') {
 length -= 2;
 } else if (length > 0) {
 byte c = bytes[length - 1];
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0a27c6b585..58b47a91fe 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Fix ServiceBindingPropertySource so that trailing \r\n
+sequences are correctly removed from files containing property values
+when configured to do so. Bug identified by Coverity Scan. (markt)
+  
+
+  
 
 
   


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



(tomcat) branch 9.0.x updated: Fix logic bug spotted by Coverity Scan

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new e087a29cd4 Fix logic bug spotted by Coverity Scan
e087a29cd4 is described below

commit e087a29cd4e69f1edb838e5a117b4713288c39f3
Author: Mark Thomas 
AuthorDate: Mon Jan 15 10:11:59 2024 +

Fix logic bug spotted by Coverity Scan
---
 .../apache/tomcat/util/digester/ServiceBindingPropertySource.java| 2 +-
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java 
b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
index a96e5d8285..997ce354db 100644
--- a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
+++ b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
@@ -139,7 +139,7 @@ public class ServiceBindingPropertySource implements 
IntrospectionUtils.SecurePr
 int length = bytes.length;
 
 if (chomp) {
-if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
2] == '\n') {
+if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
1] == '\n') {
 length -= 2;
 } else if (length > 0) {
 byte c = bytes[length - 1];
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c5803e3d2f..4f6ead9029 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,11 @@
 that is no longer included in the JAR. Based on pull request
 684 by Jendrik Johannes. (markt)
   
+  
+Fix ServiceBindingPropertySource so that trailing \r\n
+sequences are correctly removed from files containing property values
+when configured to do so. Bug identified by Coverity Scan. (markt)
+  
 
   
 


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



(tomcat) branch 10.1.x updated: Fix logic bug spotted by Coverity Scan

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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 2f791cfeae Fix logic bug spotted by Coverity Scan
2f791cfeae is described below

commit 2f791cfeae3178ad786118862df1af2a6c32ea71
Author: Mark Thomas 
AuthorDate: Mon Jan 15 10:11:59 2024 +

Fix logic bug spotted by Coverity Scan
---
 .../apache/tomcat/util/digester/ServiceBindingPropertySource.java| 2 +-
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java 
b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
index a96e5d8285..997ce354db 100644
--- a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
+++ b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
@@ -139,7 +139,7 @@ public class ServiceBindingPropertySource implements 
IntrospectionUtils.SecurePr
 int length = bytes.length;
 
 if (chomp) {
-if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
2] == '\n') {
+if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
1] == '\n') {
 length -= 2;
 } else if (length > 0) {
 byte c = bytes[length - 1];
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a509a06dc1..52b5650875 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,11 @@
 that is no longer included in the JAR. Based on pull request
 684 by Jendrik Johannes. (markt)
   
+  
+Fix ServiceBindingPropertySource so that trailing \r\n
+sequences are correctly removed from files containing property values
+when configured to do so. Bug identified by Coverity Scan. (markt)
+  
 
   
   


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



(tomcat) branch main updated: Fix logic bug spotted by Coverity Scan

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

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


The following commit(s) were added to refs/heads/main by this push:
 new bee714eb1d Fix logic bug spotted by Coverity Scan
bee714eb1d is described below

commit bee714eb1dabfcc07bf410e1145f6c580f14539d
Author: Mark Thomas 
AuthorDate: Mon Jan 15 10:11:59 2024 +

Fix logic bug spotted by Coverity Scan
---
 .../apache/tomcat/util/digester/ServiceBindingPropertySource.java| 2 +-
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java 
b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
index 89617c9cfb..bd06630f01 100644
--- a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
+++ b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
@@ -116,7 +116,7 @@ public class ServiceBindingPropertySource implements 
IntrospectionUtils.Property
 int length = bytes.length;
 
 if (chomp) {
-if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
2] == '\n') {
+if(length > 1 && bytes[length - 2] == '\r' && bytes[length - 
1] == '\n') {
 length -= 2;
 } else if (length > 0) {
 byte c = bytes[length - 1];
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6e9ffb917c..aa7fce0034 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -120,6 +120,11 @@
 that is no longer included in the JAR. Based on pull request
 684 by Jendrik Johannes. (markt)
   
+  
+Fix ServiceBindingPropertySource so that trailing \r\n
+sequences are correctly removed from files containing property values
+when configured to do so. Bug identified by Coverity Scan. (markt)
+  
 
   
   


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



Re: Supposed to provide performance at daemon thread in tomcat

2024-01-15 Thread Mark Thomas

On 15/01/2024 08:45, koteswara Rao Gundapaneni wrote:

On Sun, 14 Jan 2024, 18:13 koteswara Rao Gundapaneni, <
koti.gundapan...@gmail.com> wrote:


hi

Daemon threads have identified the performance issue inorder to complete .




Thread which is set as daemon by default has performance bottleneck


If that were the case, there would be a general performance issue for 
every Java application.


I am not aware of any general Java performance issue. You have not 
provided any evidence to support your claim that there is a performance 
issue.



I explain that as below

myeg.setDaemon(true);
myeg.start();


the above start() method is taking long time to complete which is by
default performance bottleneck


You have not explained what object "myeg" is. Based on your previous 
statements and the methods called, it appears to be an instance of Thread.


Thread.start() is unlikely to take a long time to complete. Thread.run() 
might take a long time to complete but that will depend on the run() method.



so bootstrap has its performance issue as this loader thread is using
daemon thread.


Again, you have provided no evidence to support this statement.


In our code base we have lot of places where we have the code as below as
mentioned above.

myeg.setDaemon(true);
myeg.start();



inorder to resolve the issue we will yield the corresponding thread



Inorder to limit the time taking for above line of code we have the
solution like below

myeg.setDaemon(true);
myeg.start();
myeg.yield();


This is nonsense.

The call to vield() happens after the call to start(). It is impossible 
for the call to yield() to make the call to start() faster.



the yield method declared as above will reduce the time taking for start
method


Again, this is nonsense. What you are stating is logically impossible.


Hope this will make sense if not I will write it in my own language telugu.


In additional to reviewing the above nonsense, I have also reviewed the 
proposed change to Bootstrap.java that claims to "fix" whatever issue is 
observed.


The proposed code doesn't even compile due to basic errors such as 
missing ';'.


The proposed code attempts to call a String method (contains())on a 
String array.


The proposed code attempts to assign a String to a String array.

The proposed code contains multiple instances of unhandled checked 
exceptions.


The proposed code attempts to pass a String when a String array is required.

The proposed code attempts to compare a Method instance with a String 
instance


With the above errors fixed the code compiles and, somewhat 
miraculously, Tomcat starts. The code has no effect until Tomcat stops 
(because of the call to daemon.setAwait(true). During the stop process a 
NoSuchMethodException is thrown because of the attempt to call the 
Catalina.yield() method that does not exist.


So, in summary, we have:

- a claim of a performance issue that does not exist

- a claimed solution that is logically impossible

- a proposed patch the doesn't compile and is full of errors

- a proposed patch that, when "fixed", doesn't do anything apart from
  trigger an exception on shutdown

I will not be engaging any further in this thread.

Responding to threads like this wastes the Tomcat community's time and 
detracts the community from useful work. I consider threads like this to 
be harmful to the Tomcat community. Should you start further threads 
like this it is likely that you will be blocked from posting to the 
Tomcat mailing lists and/or be blocked from interacting with the Tomcat 
project at Github and/or be blocked from interacting with the Bugzilla 
instance used by Tomcat and/or blocked from interacting with the Tomcat 
project via any other services.


Mark

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



Re: [PR] Remove org.apache.catalina.ssi from tomcat-embed-core.jar.tmp.bnd [tomcat]

2024-01-15 Thread via GitHub


jjohannes commented on PR #684:
URL: https://github.com/apache/tomcat/pull/684#issuecomment-1891752142

   Thanks @markt-asf!


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

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

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


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



Re: Tomcat 10.1.x uploaded to Coverity for analysis

2024-01-15 Thread Rémy Maucherat
On Mon, Jan 15, 2024 at 9:30 AM Mark Thomas  wrote:
>
> Hi all,
>
> I have just uploaded the latest 10.1.x to Coverity scan for analysis.
>
> It is going to take a while to process the Coverity build results. I'm
> expecting the new results to be available in the UI in a few hours or so.

It only took 30 minutes. Thanks !

Rémy

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

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



Re: Supposed to provide performance at daemon thread in tomcat

2024-01-15 Thread Romain Manni-Bucau
Hi Koti,

There is not much between a daemon and not daemon thread in the JVM so
until you:

* start tomcat in an already (over)loaded environment (OSGi, multi-server
instances)
or
* have some agent or plugin using AttachCurrentThreadAsDaemon extension
point

there is no reason using yield would help.

So high level I think it makes sense for you to create instructions to
reproduce the issue (you create a github repository with scripts or a
readme to explain how to evaluate and identity this slowness for anyone
willing to help on this topic) cause technically it looks like you don't
fix the root cause of your issue but a side effect.

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



Le lun. 15 janv. 2024 à 09:45, koteswara Rao Gundapaneni <
koti.gundapan...@gmail.com> a écrit :

> On Sun, 14 Jan 2024, 18:13 koteswara Rao Gundapaneni, <
> koti.gundapan...@gmail.com> wrote:
>
> > hi
> >
> > Daemon threads have identified the performance issue inorder to complete
> .
> >
>
>
> Thread which is set as daemon by default has performance bottleneck
>
> I explain that as below
>
> myeg.setDaemon(true);
> myeg.start();
>
>
> the above start() method is taking long time to complete which is by
> default performance bottleneck
>
> >
> > so bootstrap has its performance issue as this loader thread is using
> > daemon thread.
> >
>
>
> In our code base we have lot of places where we have the code as below as
> mentioned above.
>
> myeg.setDaemon(true);
> myeg.start();
>
> >
> > inorder to resolve the issue we will yield the corresponding thread
> >
>
>
> Inorder to limit the time taking for above line of code we have the
> solution like below
>
> myeg.setDaemon(true);
> myeg.start();
> myeg.yield();
>
>
> the yield method declared as above will reduce the time taking for start
> method
>
>
>
> Hope this will make sense if not I will write it in my own language telugu.
>
>
>
> regards,
> > koti
> >
> >
> > On Sun, Jan 14, 2024 at 4:13 AM Mark Thomas  wrote:
> >
> >> You have yet to provide an explanation of the problem you are trying to
> >> solve.
> >>
> >> Unless and until you provide the information requested, further messages
> >> from you on this topic will be ignored.
> >>
> >> Mark
> >>
> >>
> >> On 14/01/2024 12:05, koteswara Rao Gundapaneni wrote:
> >> > hi team
> >> >
> >> > before clicking the link or check new private window in mozilla
> >> >
> >> > image.png
> >> >
> >> >
> >> >
> >> > when we browse the following link
> >> >
> >> >
> >>
> https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
> >> <
> >>
> https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
> >> >
> >> >
> >> >
> >> > image.png
> >> >
> >> > Here the code page is shown as above
> >> >
> >> >
> >> >
> >> > On Fri, Jan 12, 2024 at 6:41 PM koteswara Rao Gundapaneni
> >> > mailto:koti.gundapan...@gmail.com>>
> wrote:
> >> >
> >> >
> >> > hi mark,
> >> >
> >> > please check if the code is now available at your end I verified
> >> > from my end it can be visible
> >> >
> >> > On Fri, Jan 12, 2024 at 1:28 AM koteswara Rao Gundapaneni
> >> > mailto:koti.gundapan...@gmail.com>>
> >> wrote:
> >> >
> >> >
> >> > Sorry for the inconvenience as its been a private repo just
> now
> >> > i committed my changes to a new public repo
> >> >
> >> >
> >>
> https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
> >> <
> >>
> https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
> >> >
> >> >
> >> > Please find my attested changes in whole file
> 'Bootstrap.java'.
> >> >
> >> >
> >> >
> >> > On Fri, Jan 12, 2024 at 12:24 AM Mark Thomas <
> ma...@apache.org
> >> > > wrote:
> >> >
> >> > On 12/01/2024 08:16, koteswara Rao Gundapaneni wrote:
> >> >  > Hi Team,
> >> >  >
> >> >  > As its milestone contribution for me I have added my
> >> > branch along with the
> >> >  > pr created,
> >> >  >
> >> >  > Please add the reviewer here to commit the changes.
> >> >  >
> >> >  > Comparing
> >> singlemanager...KoteswararaoGundapaneni-patch-1 ·
> >> >  > KoteswararaoGundapaneni/MYREPO (github.com
> >> > )
> >> >  >
> >> > <
> >>
> https://github.com/KoteswararaoGundapaneni/MYREPO/compare/singlemanager...KoteswararaoGundapaneni-patch-1
> >> <
> >>
> https://github.com/KoteswararaoGundapaneni/MYREPO/compare/singlemanager...KoteswararaoGundapaneni-patch-1
> >> >>
> >> >
> >> > That URI returns a 404.
> >> >
> >> >  

Re: [PR] Remove org.apache.catalina.ssi from tomcat-embed-core.jar.tmp.bnd [tomcat]

2024-01-15 Thread via GitHub


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

   Fixed manually in main for 11.0.x (with change log entry) and then 
back-ported (cherry-picked) to 10.1.x and 9.0.x.


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

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

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


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



Re: [PR] Remove org.apache.catalina.ssi from tomcat-embed-core.jar.tmp.bnd [tomcat]

2024-01-15 Thread via GitHub


markt-asf closed pull request #684: Remove org.apache.catalina.ssi from 
tomcat-embed-core.jar.tmp.bnd
URL: https://github.com/apache/tomcat/pull/684


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

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

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


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



(tomcat) branch 9.0.x updated: Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new acd55aba0a Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar
acd55aba0a is described below

commit acd55aba0adc83d7f7bad21765a8dd312bc5107b
Author: Mark Thomas 
AuthorDate: Mon Jan 15 08:40:38 2024 +

Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar

Remove reference to org.apache.catalina.ssi package that is no longer
included in the JAR.

Based on pull request #684 by Jendrik Johannes
---
 res/bnd/tomcat-embed-core.jar.tmp.bnd |  1 -
 webapps/docs/changelog.xml| 10 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/res/bnd/tomcat-embed-core.jar.tmp.bnd 
b/res/bnd/tomcat-embed-core.jar.tmp.bnd
index 7b9966416b..60267c1c51 100644
--- a/res/bnd/tomcat-embed-core.jar.tmp.bnd
+++ b/res/bnd/tomcat-embed-core.jar.tmp.bnd
@@ -38,7 +38,6 @@ Export-Package: \
 org.apache.catalina.security,\
 org.apache.catalina.servlets,\
 org.apache.catalina.session,\
-org.apache.catalina.ssi,\
 org.apache.catalina.startup,\
 org.apache.catalina.users,\
 org.apache.catalina.util,\
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f3eedf94ba..c5803e3d2f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,16 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar
+by removing reference to org.apache.catalina.ssi package
+that is no longer included in the JAR. Based on pull request
+684 by Jendrik Johannes. (markt)
+  
+
+  
 
 
   


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



(tomcat) branch 10.1.x updated: Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar

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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 25ca8a03bf Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar
25ca8a03bf is described below

commit 25ca8a03bfc2d75c7c581bb6555c35a7eef4f707
Author: Mark Thomas 
AuthorDate: Mon Jan 15 08:40:38 2024 +

Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar

Remove reference to org.apache.catalina.ssi package that is no longer
included in the JAR.

Based on pull request #684 by Jendrik Johannes
---
 res/bnd/tomcat-embed-core.jar.tmp.bnd |  1 -
 webapps/docs/changelog.xml| 10 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/res/bnd/tomcat-embed-core.jar.tmp.bnd 
b/res/bnd/tomcat-embed-core.jar.tmp.bnd
index 7e83e60f56..558c2b43d6 100644
--- a/res/bnd/tomcat-embed-core.jar.tmp.bnd
+++ b/res/bnd/tomcat-embed-core.jar.tmp.bnd
@@ -38,7 +38,6 @@ Export-Package: \
 org.apache.catalina.security,\
 org.apache.catalina.servlets,\
 org.apache.catalina.session,\
-org.apache.catalina.ssi,\
 org.apache.catalina.startup,\
 org.apache.catalina.users,\
 org.apache.catalina.util,\
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9b16f0fd0b..a509a06dc1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,16 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar
+by removing reference to org.apache.catalina.ssi package
+that is no longer included in the JAR. Based on pull request
+684 by Jendrik Johannes. (markt)
+  
+
+  
   
 
   


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



Re: Supposed to provide performance at daemon thread in tomcat

2024-01-15 Thread koteswara Rao Gundapaneni
On Sun, 14 Jan 2024, 18:13 koteswara Rao Gundapaneni, <
koti.gundapan...@gmail.com> wrote:

> hi
>
> Daemon threads have identified the performance issue inorder to complete .
>


Thread which is set as daemon by default has performance bottleneck

I explain that as below

myeg.setDaemon(true);
myeg.start();


the above start() method is taking long time to complete which is by
default performance bottleneck

>
> so bootstrap has its performance issue as this loader thread is using
> daemon thread.
>


In our code base we have lot of places where we have the code as below as
mentioned above.

myeg.setDaemon(true);
myeg.start();

>
> inorder to resolve the issue we will yield the corresponding thread
>


Inorder to limit the time taking for above line of code we have the
solution like below

myeg.setDaemon(true);
myeg.start();
myeg.yield();


the yield method declared as above will reduce the time taking for start
method



Hope this will make sense if not I will write it in my own language telugu.



regards,
> koti
>
>
> On Sun, Jan 14, 2024 at 4:13 AM Mark Thomas  wrote:
>
>> You have yet to provide an explanation of the problem you are trying to
>> solve.
>>
>> Unless and until you provide the information requested, further messages
>> from you on this topic will be ignored.
>>
>> Mark
>>
>>
>> On 14/01/2024 12:05, koteswara Rao Gundapaneni wrote:
>> > hi team
>> >
>> > before clicking the link or check new private window in mozilla
>> >
>> > image.png
>> >
>> >
>> >
>> > when we browse the following link
>> >
>> >
>> https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
>> <
>> https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
>> >
>> >
>> >
>> > image.png
>> >
>> > Here the code page is shown as above
>> >
>> >
>> >
>> > On Fri, Jan 12, 2024 at 6:41 PM koteswara Rao Gundapaneni
>> > mailto:koti.gundapan...@gmail.com>> wrote:
>> >
>> >
>> > hi mark,
>> >
>> > please check if the code is now available at your end I verified
>> > from my end it can be visible
>> >
>> > On Fri, Jan 12, 2024 at 1:28 AM koteswara Rao Gundapaneni
>> > mailto:koti.gundapan...@gmail.com>>
>> wrote:
>> >
>> >
>> > Sorry for the inconvenience as its been a private repo just now
>> > i committed my changes to a new public repo
>> >
>> >
>> https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
>> <
>> https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
>> >
>> >
>> > Please find my attested changes in whole file 'Bootstrap.java'.
>> >
>> >
>> >
>> > On Fri, Jan 12, 2024 at 12:24 AM Mark Thomas > > > wrote:
>> >
>> > On 12/01/2024 08:16, koteswara Rao Gundapaneni wrote:
>> >  > Hi Team,
>> >  >
>> >  > As its milestone contribution for me I have added my
>> > branch along with the
>> >  > pr created,
>> >  >
>> >  > Please add the reviewer here to commit the changes.
>> >  >
>> >  > Comparing
>> singlemanager...KoteswararaoGundapaneni-patch-1 ·
>> >  > KoteswararaoGundapaneni/MYREPO (github.com
>> > )
>> >  >
>> > <
>> https://github.com/KoteswararaoGundapaneni/MYREPO/compare/singlemanager...KoteswararaoGundapaneni-patch-1
>> <
>> https://github.com/KoteswararaoGundapaneni/MYREPO/compare/singlemanager...KoteswararaoGundapaneni-patch-1
>> >>
>> >
>> > That URI returns a 404.
>> >
>> > Unless and until you provide the information requested,
>> > further messages
>> > from you on this topic are likely to be ignored.
>> >
>> > Mark
>> >
>> >
>> >
>> >  >
>> >  >
>> >  > -- Forwarded message -
>> >  > From: Mark Thomas > > >
>> >  > Date: Sat, Jan 6, 2024 at 2:05 AM
>> >  > Subject: Re: Supposed to provide performance at daemon
>> > thread in tomcat
>> >  > To: mailto:dev@tomcat.apache.org
>> >>
>> >  >
>> >  >
>> >  > Please read my previous response and follow the
>> > instructions you were given.
>> >  >
>> >  > Mark
>> >  >
>> >  >
>> >  > On 06/01/2024 06:26, koteswara Rao Gundapaneni wrote:
>> >  >> Hi All,
>> >  >>
>> >  >> Somebody helps to give permissions to create the pull
>> > request as I have
>> >  >> been trying to give the change at latest.
>> >  >>
>> >  >> regards,
>> >  >> Koti
>> >  >>
>> >  >> On Fri, Jan 5, 2024 at 12:12 AM Mark Thomas
>> > mailto:ma...@apache.org>> wrote:
>> >  >>
>> >  >>> 

(tomcat) branch main updated: Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar

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

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


The following commit(s) were added to refs/heads/main by this push:
 new 4802008e11 Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar
4802008e11 is described below

commit 4802008e11c29b587be156275c66df0682aff66a
Author: Mark Thomas 
AuthorDate: Mon Jan 15 08:40:38 2024 +

Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar

Remove reference to org.apache.catalina.ssi package that is no longer
included in the JAR.

Based on pull request #684 by Jendrik Johannes
---
 res/bnd/tomcat-embed-core.jar.tmp.bnd | 1 -
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/res/bnd/tomcat-embed-core.jar.tmp.bnd 
b/res/bnd/tomcat-embed-core.jar.tmp.bnd
index 2c0f8e7495..0e6c768997 100644
--- a/res/bnd/tomcat-embed-core.jar.tmp.bnd
+++ b/res/bnd/tomcat-embed-core.jar.tmp.bnd
@@ -38,7 +38,6 @@ Export-Package: \
 org.apache.catalina.security,\
 org.apache.catalina.servlets,\
 org.apache.catalina.session,\
-org.apache.catalina.ssi,\
 org.apache.catalina.startup,\
 org.apache.catalina.users,\
 org.apache.catalina.util,\
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4149652677..6e9ffb917c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,12 @@
 expected to be especially useful with applications using the Jakarta
 WebSocket API. (markt)
   
+  
+Correct JPMS and OSGi meta-data for tomcat-enbed-core.jar
+by removing reference to org.apache.catalina.ssi package
+that is no longer included in the JAR. Based on pull request
+684 by Jendrik Johannes. (markt)
+  
 
   
   


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



Tomcat 10.1.x uploaded to Coverity for analysis

2024-01-15 Thread Mark Thomas

Hi all,

I have just uploaded the latest 10.1.x to Coverity scan for analysis.

It is going to take a while to process the Coverity build results. I'm 
expecting the new results to be available in the UI in a few hours or so.


Mark

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



[Bug 68480] Add cipher alias for TLSv1.3

2024-01-15 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68480

Hui Li  changed:

   What|Removed |Added

 CC||lidot...@gmail.com

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



[Bug 68480] New: Add cipher alias for TLSv1.3

2024-01-15 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68480

Bug ID: 68480
   Summary: Add cipher alias for TLSv1.3
   Product: Tomcat 10
   Version: unspecified
  Hardware: PC
OS: Mac OS X 10.1
Status: NEW
  Severity: normal
  Priority: P2
 Component: Util
  Assignee: dev@tomcat.apache.org
  Reporter: lidot...@gmail.com
  Target Milestone: --

The request for adding cipher alias for TLSv1.3, so that could set ciphers for
TLSv1.3 easily.

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



Re: Supposed to provide performance at daemon thread in tomcat

2024-01-15 Thread Mark Thomas

On 14/01/2024 12:43, koteswara Rao Gundapaneni wrote:

hi

Daemon threads have identified the performance issue inorder to complete .

so bootstrap has its performance issue as this loader thread is using
daemon thread.

inorder to resolve the issue we will yield the corresponding thread


That explanation makes no sense.

If English is not your first language, try using your first language. 
Someone here likely speaks it and those that don't can use Google translate.


Mark



regards,
koti


On Sun, Jan 14, 2024 at 4:13 AM Mark Thomas  wrote:


You have yet to provide an explanation of the problem you are trying to
solve.

Unless and until you provide the information requested, further messages
from you on this topic will be ignored.

Mark


On 14/01/2024 12:05, koteswara Rao Gundapaneni wrote:

hi team

before clicking the link or check new private window in mozilla

image.png



when we browse the following link



https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
<
https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master




image.png

Here the code page is shown as above



On Fri, Jan 12, 2024 at 6:41 PM koteswara Rao Gundapaneni
mailto:koti.gundapan...@gmail.com>> wrote:


 hi mark,

 please check if the code is now available at your end I verified
 from my end it can be visible

 On Fri, Jan 12, 2024 at 1:28 AM koteswara Rao Gundapaneni
 mailto:koti.gundapan...@gmail.com>>

wrote:



 Sorry for the inconvenience as its been a private repo just now
 i committed my changes to a new public repo



https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master
<
https://github.com/KoteswararaoGundapaneni/KotiSpringRepository/tree/master



 Please find my attested changes in whole file 'Bootstrap.java'.



 On Fri, Jan 12, 2024 at 12:24 AM Mark Thomas mailto:ma...@apache.org>> wrote:

 On 12/01/2024 08:16, koteswara Rao Gundapaneni wrote:
  > Hi Team,
  >
  > As its milestone contribution for me I have added my
 branch along with the
  > pr created,
  >
  > Please add the reviewer here to commit the changes.
  >
  > Comparing singlemanager...KoteswararaoGundapaneni-patch-1

·

  > KoteswararaoGundapaneni/MYREPO (github.com
 )
  >
 <

https://github.com/KoteswararaoGundapaneni/MYREPO/compare/singlemanager...KoteswararaoGundapaneni-patch-1
<
https://github.com/KoteswararaoGundapaneni/MYREPO/compare/singlemanager...KoteswararaoGundapaneni-patch-1




 That URI returns a 404.

 Unless and until you provide the information requested,
 further messages
 from you on this topic are likely to be ignored.

 Mark



  >
  >
  > -- Forwarded message -
  > From: Mark Thomas mailto:ma...@apache.org>>
  > Date: Sat, Jan 6, 2024 at 2:05 AM
  > Subject: Re: Supposed to provide performance at daemon
 thread in tomcat
  > To: mailto:dev@tomcat.apache.org



  >
  >
  > Please read my previous response and follow the
 instructions you were given.
  >
  > Mark
  >
  >
  > On 06/01/2024 06:26, koteswara Rao Gundapaneni wrote:
  >> Hi All,
  >>
  >> Somebody helps to give permissions to create the pull
 request as I have
  >> been trying to give the change at latest.
  >>
  >> regards,
  >> Koti
  >>
  >> On Fri, Jan 5, 2024 at 12:12 AM Mark Thomas
 mailto:ma...@apache.org>> wrote:
  >>
  >>> On 05/01/2024 05:15, koteswara Rao Gundapaneni wrote:
   It seems there are further permissions to be  added at
 Github
  
   *Error received via Github is as : **Pull request
 creation failed.
   Validation failed: must be a collaborator*
  >>>
  >>> Anyone can submit a pull request to the Tomcat
 repository. The only
  >>> exception is users who have been blocked for spam/abuse.
  >>>
   Actually i tried creating the pull request for
 providing the solution
  > for
   daemon thread performance issue
  >>>
  >>> Please provide a link to your branch with the proposed

fix.

  >>>
  >>> Please also provide a better description of the problem
 you are trying
  >>> to solve.
  >>>
  >>> Mark
  >>>
  

(tomcat) branch 8.5.x updated: Align with 9.0.x onwards

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 705838d34c Align with 9.0.x onwards
705838d34c is described below

commit 705838d34c951dd39face65a152200b8c3958383
Author: Mark Thomas 
AuthorDate: Mon Jan 15 08:05:57 2024 +

Align with 9.0.x onwards
---
 java/org/apache/catalina/session/ManagerBase.java | 11 ++-
 java/org/apache/catalina/session/StoreBase.java   | 11 ++-
 2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/catalina/session/ManagerBase.java 
b/java/org/apache/catalina/session/ManagerBase.java
index 514d7603e2..7e048d1862 100644
--- a/java/org/apache/catalina/session/ManagerBase.java
+++ b/java/org/apache/catalina/session/ManagerBase.java
@@ -46,6 +46,7 @@ import org.apache.catalina.SessionIdGenerator;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.catalina.util.SessionIdGeneratorBase;
 import org.apache.catalina.util.StandardSessionIdGenerator;
+import org.apache.catalina.util.ToStringUtil;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
@@ -1247,15 +1248,7 @@ public abstract class ManagerBase extends 
LifecycleMBeanBase implements Manager
 
 @Override
 public String toString() {
-StringBuilder sb = new StringBuilder(this.getClass().getName());
-sb.append('[');
-if (context == null) {
-sb.append("Context is null");
-} else {
-sb.append(context.getName());
-}
-sb.append(']');
-return sb.toString();
+return ToStringUtil.toString(this, context);
 }
 
 
diff --git a/java/org/apache/catalina/session/StoreBase.java 
b/java/org/apache/catalina/session/StoreBase.java
index 4b76462634..222864a6d6 100644
--- a/java/org/apache/catalina/session/StoreBase.java
+++ b/java/org/apache/catalina/session/StoreBase.java
@@ -29,6 +29,7 @@ import org.apache.catalina.Manager;
 import org.apache.catalina.Store;
 import org.apache.catalina.util.CustomObjectInputStream;
 import org.apache.catalina.util.LifecycleBase;
+import org.apache.catalina.util.ToStringUtil;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -270,14 +271,6 @@ public abstract class StoreBase extends LifecycleBase 
implements Store {
  */
 @Override
 public String toString() {
-StringBuilder sb = new StringBuilder(this.getClass().getName());
-sb.append('[');
-if (manager == null) {
-sb.append("Manager is null");
-} else {
-sb.append(manager);
-}
-sb.append(']');
-return sb.toString();
+return ToStringUtil.toString(this, manager);
 }
 }


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