[tomcat] branch main updated: Silence a couple more deprecation warnings

2021-07-27 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 a535913  Silence a couple more deprecation warnings
a535913 is described below

commit a53591356d7302f556d8931fce01e74a2ec60e75
Author: Mark Thomas 
AuthorDate: Tue Jul 27 21:58:20 2021 +0100

Silence a couple more deprecation warnings
---
 java/org/apache/catalina/loader/WebappClassLoaderBase.java | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index f3798c5..3b63625 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -2381,6 +2381,12 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
  *
  * @return the loaded class, or null if the class isn't found
  */
+/*
+ * The use of getPackage() is appropriate given that the code is checking
+ * if the package is sealed. Therefore, parent class loaders need to be
+ * checked.
+ */
+@SuppressWarnings("deprecation")
 protected Class findClassInternal(String name) {
 
 checkStateForResourceLoading(name);
@@ -2473,6 +2479,7 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
 int pos = name.lastIndexOf('.');
 if (pos != -1) {
 String packageName = name.substring(0, pos);
+
 Package pkg = getPackage(packageName);
 
 // Define the package (if null)

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



[tomcat] branch 8.5.x updated: Simplify code - no functional change

2021-07-27 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 8972e7b  Simplify code - no functional change
8972e7b is described below

commit 8972e7b80186fc38a4f2bbcd97cc60e608bf1d06
Author: Mark Thomas 
AuthorDate: Tue Jul 27 21:53:08 2021 +0100

Simplify code - no functional change
---
 .../catalina/loader/WebappClassLoaderBase.java | 69 ++
 1 file changed, 31 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index b73e992..e7a35db 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -2436,49 +2436,42 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
 }
 }
 
-// Looking up the package
-String packageName = null;
-int pos = name.lastIndexOf('.');
-if (pos != -1) {
-packageName = name.substring(0, pos);
-}
-
-Package pkg = null;
-
-if (packageName != null) {
-pkg = getPackage(packageName);
-// Define the package (if null)
-if (pkg == null) {
-try {
-if (manifest == null) {
-definePackage(packageName, null, null, null, null, 
null, null, null);
-} else {
-definePackage(packageName, manifest, codeBase);
+if (securityManager != null) {
+// Looking up the package
+int pos = name.lastIndexOf('.');
+if (pos != -1) {
+String packageName = name.substring(0, pos);
+Package pkg = getPackage(packageName);
+
+// Define the package (if null)
+if (pkg == null) {
+try {
+if (manifest == null) {
+definePackage(packageName, null, null, null, 
null, null, null, null);
+} else {
+definePackage(packageName, manifest, codeBase);
+}
+} catch (IllegalArgumentException e) {
+// Ignore: normal error due to dual definition of 
package
 }
-} catch (IllegalArgumentException e) {
-// Ignore: normal error due to dual definition of 
package
+pkg = getPackage(packageName);
 }
-pkg = getPackage(packageName);
-}
-}
-
-if (securityManager != null) {
 
-// Checking sealing
-if (pkg != null) {
-boolean sealCheck = true;
-if (pkg.isSealed()) {
-sealCheck = pkg.isSealed(codeBase);
-} else {
-sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
-}
-if (!sealCheck) {
-throw new SecurityException
-("Sealing violation loading " + name + " : Package 
"
- + packageName + " is sealed.");
+// Checking sealing
+if (pkg != null) {
+boolean sealCheck = true;
+if (pkg.isSealed()) {
+sealCheck = pkg.isSealed(codeBase);
+} else {
+sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
+}
+if (!sealCheck) {
+throw new SecurityException
+("Sealing violation loading " + name + " : 
Package "
+ + packageName + " is sealed.");
+}
 }
 }
-
 }
 
 try {

-
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: Simplify code - no functional change

2021-07-27 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 d873f31  Simplify code - no functional change
d873f31 is described below

commit d873f31ca0f64ba1f8c757b6e123196c3bc3de77
Author: Mark Thomas 
AuthorDate: Tue Jul 27 21:53:08 2021 +0100

Simplify code - no functional change
---
 .../catalina/loader/WebappClassLoaderBase.java | 69 ++
 1 file changed, 31 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index 4137fcf..0d2bb7c 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -2430,49 +2430,42 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
 }
 }
 
-// Looking up the package
-String packageName = null;
-int pos = name.lastIndexOf('.');
-if (pos != -1) {
-packageName = name.substring(0, pos);
-}
-
-Package pkg = null;
-
-if (packageName != null) {
-pkg = getPackage(packageName);
-// Define the package (if null)
-if (pkg == null) {
-try {
-if (manifest == null) {
-definePackage(packageName, null, null, null, null, 
null, null, null);
-} else {
-definePackage(packageName, manifest, codeBase);
+if (securityManager != null) {
+// Looking up the package
+int pos = name.lastIndexOf('.');
+if (pos != -1) {
+String packageName = name.substring(0, pos);
+Package pkg = getPackage(packageName);
+
+// Define the package (if null)
+if (pkg == null) {
+try {
+if (manifest == null) {
+definePackage(packageName, null, null, null, 
null, null, null, null);
+} else {
+definePackage(packageName, manifest, codeBase);
+}
+} catch (IllegalArgumentException e) {
+// Ignore: normal error due to dual definition of 
package
 }
-} catch (IllegalArgumentException e) {
-// Ignore: normal error due to dual definition of 
package
+pkg = getPackage(packageName);
 }
-pkg = getPackage(packageName);
-}
-}
-
-if (securityManager != null) {
 
-// Checking sealing
-if (pkg != null) {
-boolean sealCheck = true;
-if (pkg.isSealed()) {
-sealCheck = pkg.isSealed(codeBase);
-} else {
-sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
-}
-if (!sealCheck) {
-throw new SecurityException
-("Sealing violation loading " + name + " : Package 
"
- + packageName + " is sealed.");
+// Checking sealing
+if (pkg != null) {
+boolean sealCheck = true;
+if (pkg.isSealed()) {
+sealCheck = pkg.isSealed(codeBase);
+} else {
+sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
+}
+if (!sealCheck) {
+throw new SecurityException
+("Sealing violation loading " + name + " : 
Package "
+ + packageName + " is sealed.");
+}
 }
 }
-
 }
 
 try {

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



[tomcat] branch 10.0.x updated: Simplify code - no functional change

2021-07-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 42de6e5  Simplify code - no functional change
42de6e5 is described below

commit 42de6e59ca95b261bef613a49ca85ec68fc2d428
Author: Mark Thomas 
AuthorDate: Tue Jul 27 21:53:08 2021 +0100

Simplify code - no functional change
---
 .../catalina/loader/WebappClassLoaderBase.java | 69 ++
 1 file changed, 31 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index f5c4c4f..f3798c5 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -2468,49 +2468,42 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
 }
 }
 
-// Looking up the package
-String packageName = null;
-int pos = name.lastIndexOf('.');
-if (pos != -1) {
-packageName = name.substring(0, pos);
-}
-
-Package pkg = null;
-
-if (packageName != null) {
-pkg = getPackage(packageName);
-// Define the package (if null)
-if (pkg == null) {
-try {
-if (manifest == null) {
-definePackage(packageName, null, null, null, null, 
null, null, null);
-} else {
-definePackage(packageName, manifest, codeBase);
+if (securityManager != null) {
+// Looking up the package
+int pos = name.lastIndexOf('.');
+if (pos != -1) {
+String packageName = name.substring(0, pos);
+Package pkg = getPackage(packageName);
+
+// Define the package (if null)
+if (pkg == null) {
+try {
+if (manifest == null) {
+definePackage(packageName, null, null, null, 
null, null, null, null);
+} else {
+definePackage(packageName, manifest, codeBase);
+}
+} catch (IllegalArgumentException e) {
+// Ignore: normal error due to dual definition of 
package
 }
-} catch (IllegalArgumentException e) {
-// Ignore: normal error due to dual definition of 
package
+pkg = getPackage(packageName);
 }
-pkg = getPackage(packageName);
-}
-}
-
-if (securityManager != null) {
 
-// Checking sealing
-if (pkg != null) {
-boolean sealCheck = true;
-if (pkg.isSealed()) {
-sealCheck = pkg.isSealed(codeBase);
-} else {
-sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
-}
-if (!sealCheck) {
-throw new SecurityException
-("Sealing violation loading " + name + " : Package 
"
- + packageName + " is sealed.");
+// Checking sealing
+if (pkg != null) {
+boolean sealCheck = true;
+if (pkg.isSealed()) {
+sealCheck = pkg.isSealed(codeBase);
+} else {
+sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
+}
+if (!sealCheck) {
+throw new SecurityException
+("Sealing violation loading " + name + " : 
Package "
+ + packageName + " is sealed.");
+}
 }
 }
-
 }
 
 try {

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



[tomcat] branch main updated: Simplify code - no functional change

2021-07-27 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 99b4e28  Simplify code - no functional change
99b4e28 is described below

commit 99b4e286f77f153340dfd8b3e9629cd139b0e3c1
Author: Mark Thomas 
AuthorDate: Tue Jul 27 21:53:08 2021 +0100

Simplify code - no functional change
---
 .../catalina/loader/WebappClassLoaderBase.java | 69 ++
 1 file changed, 31 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index f5c4c4f..f3798c5 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -2468,49 +2468,42 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
 }
 }
 
-// Looking up the package
-String packageName = null;
-int pos = name.lastIndexOf('.');
-if (pos != -1) {
-packageName = name.substring(0, pos);
-}
-
-Package pkg = null;
-
-if (packageName != null) {
-pkg = getPackage(packageName);
-// Define the package (if null)
-if (pkg == null) {
-try {
-if (manifest == null) {
-definePackage(packageName, null, null, null, null, 
null, null, null);
-} else {
-definePackage(packageName, manifest, codeBase);
+if (securityManager != null) {
+// Looking up the package
+int pos = name.lastIndexOf('.');
+if (pos != -1) {
+String packageName = name.substring(0, pos);
+Package pkg = getPackage(packageName);
+
+// Define the package (if null)
+if (pkg == null) {
+try {
+if (manifest == null) {
+definePackage(packageName, null, null, null, 
null, null, null, null);
+} else {
+definePackage(packageName, manifest, codeBase);
+}
+} catch (IllegalArgumentException e) {
+// Ignore: normal error due to dual definition of 
package
 }
-} catch (IllegalArgumentException e) {
-// Ignore: normal error due to dual definition of 
package
+pkg = getPackage(packageName);
 }
-pkg = getPackage(packageName);
-}
-}
-
-if (securityManager != null) {
 
-// Checking sealing
-if (pkg != null) {
-boolean sealCheck = true;
-if (pkg.isSealed()) {
-sealCheck = pkg.isSealed(codeBase);
-} else {
-sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
-}
-if (!sealCheck) {
-throw new SecurityException
-("Sealing violation loading " + name + " : Package 
"
- + packageName + " is sealed.");
+// Checking sealing
+if (pkg != null) {
+boolean sealCheck = true;
+if (pkg.isSealed()) {
+sealCheck = pkg.isSealed(codeBase);
+} else {
+sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
+}
+if (!sealCheck) {
+throw new SecurityException
+("Sealing violation loading " + name + " : 
Package "
+ + packageName + " is sealed.");
+}
 }
 }
-
 }
 
 try {

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



[tomcat] branch main updated: Fix building Javadoc for Java 11

2021-07-27 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 3fffc31  Fix building Javadoc for Java 11
3fffc31 is described below

commit 3fffc3111775683c20daa3675f918f94b95b8193
Author: Mark Thomas 
AuthorDate: Tue Jul 27 21:33:17 2021 +0100

Fix building Javadoc for Java 11
---
 build.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build.xml b/build.xml
index 2f02de7..4d6775e 100644
--- a/build.xml
+++ b/build.xml
@@ -2400,8 +2400,8 @@ Apache Tomcat ${version} native binaries for Win64 
AMD64/EMT64 platform.
   
   
   
-  https://docs.oracle.com/javase/8/docs/api/"/>
-  https://javaee.github.io/javaee-spec/javadocs/"/>
+  https://docs.oracle.com/en/java/javase/11/docs/api/"/>
+  https://jakarta.ee/specifications/platform/9/apidocs/"/>
   
 
 

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



[tomcat] branch main updated: Silence these warnings

2021-07-27 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 71d1c46  Silence these warnings
71d1c46 is described below

commit 71d1c466089d7a740180bc0fec4bfa8796694075
Author: Mark Thomas 
AuthorDate: Tue Jul 27 21:14:11 2021 +0100

Silence these warnings

A code review suggests that the use of the deprecated
Proxy.getPorxyClass() method within jdbc-pool is safe.
---
 .../src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java  | 7 +++
 .../jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java  | 7 +++
 .../jdbc/pool/interceptor/StatementDecoratorInterceptor.java   | 7 +++
 3 files changed, 21 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
index 37fb7a3..7e0232d 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
@@ -361,6 +361,13 @@ public class ConnectionPool {
  * @return constructor used to instantiate the wrapper object
  * @throws NoSuchMethodException Failed to get a constructor
  */
+/*
+ * Neither the class nor the constructor are exposed outside of jdbc-pool.
+ * Given the comments in the jdbc-pool code regarding caching for
+ * performance, continue to use Proxy.getProxyClass(). This will need to be
+ * revisited if that method is marked for removal.
+ */
+@SuppressWarnings("deprecation")
 public Constructor getProxyConstructor(boolean xa) throws 
NoSuchMethodException {
 //cache the constructor
 if (proxyClassConstructor == null ) {
diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
index 521886e..b0820e6 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
@@ -91,6 +91,13 @@ public abstract class  AbstractCreateStatementInterceptor 
extends JdbcIntercepto
  * @return - returns a constructor used to create new instances
  * @throws NoSuchMethodException Constructor not found
  */
+/*
+ * Neither the class nor the constructor are exposed outside of jdbc-pool.
+ * Given the comments in the jdbc-pool code regarding caching for
+ * performance, continue to use Proxy.getProxyClass(). This will need to be
+ * revisited if that method is marked for removal.
+ */
+@SuppressWarnings("deprecation")
 protected Constructor getConstructor(int idx, Class clazz) throws 
NoSuchMethodException {
 if (constructors[idx] == null) {
 Class proxyClass = 
Proxy.getProxyClass(AbstractCreateStatementInterceptor.class.getClassLoader(),
diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
index f3d2a30..20d7002 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
@@ -54,6 +54,13 @@ public class StatementDecoratorInterceptor extends 
AbstractCreateStatementInterc
 // nothing to do
 }
 
+/*
+ * Neither the class nor the constructor are exposed outside of jdbc-pool.
+ * Given the comments in the jdbc-pool code regarding caching for
+ * performance, continue to use Proxy.getProxyClass(). This will need to be
+ * revisited if that method is marked for removal.
+ */
+@SuppressWarnings("deprecation")
 protected Constructor getResultSetConstructor() throws 
NoSuchMethodException {
 if (resultSetConstructor == null) {
 Class proxyClass = 
Proxy.getProxyClass(StatementDecoratorInterceptor.class.getClassLoader(),

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



[tomcat] branch main updated: Silence warnings we can't avoid

2021-07-27 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 7137cf9  Silence warnings we can't avoid
7137cf9 is described below

commit 7137cf9cc4573afca5b25b1d7789a2ab518a3cfd
Author: Mark Thomas 
AuthorDate: Tue Jul 27 19:31:45 2021 +0100

Silence warnings we can't avoid
---
 java/org/apache/catalina/tribes/io/ReplicationStream.java  | 3 ++-
 java/org/apache/catalina/util/CustomObjectInputStream.java | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/tribes/io/ReplicationStream.java 
b/java/org/apache/catalina/tribes/io/ReplicationStream.java
index bef441f..70265fd 100644
--- a/java/org/apache/catalina/tribes/io/ReplicationStream.java
+++ b/java/org/apache/catalina/tribes/io/ReplicationStream.java
@@ -134,7 +134,8 @@ public final class ReplicationStream extends 
ObjectInputStream {
 classObjs[i] = cl;
 }
 try {
-// @SuppressWarnings("deprecation") Java 9
+// No way to avoid this at the moment
+@SuppressWarnings("deprecation")
 Class proxyClass = Proxy.getProxyClass(hasNonPublicInterface ? 
nonPublicLoader
 : latestLoader, classObjs);
 return proxyClass;
diff --git a/java/org/apache/catalina/util/CustomObjectInputStream.java 
b/java/org/apache/catalina/util/CustomObjectInputStream.java
index 539b601..49bdb74 100644
--- a/java/org/apache/catalina/util/CustomObjectInputStream.java
+++ b/java/org/apache/catalina/util/CustomObjectInputStream.java
@@ -185,7 +185,8 @@ public final class CustomObjectInputStream extends 
ObjectInputStream {
 }
 
 try {
-// @SuppressWarnings("deprecation") Java 9
+// No way to avoid this at the moment
+@SuppressWarnings("deprecation")
 Class proxyClass = Proxy.getProxyClass(classLoader, 
cinterfaces);
 return proxyClass;
 } catch (IllegalArgumentException e) {

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



[tomcat] branch main updated: Avoid deprecation warnings for isAccessible

2021-07-27 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 1bb6c6f  Avoid deprecation warnings for isAccessible
1bb6c6f is described below

commit 1bb6c6fe885a266531ed4fa11619ce3eaee9e3b5
Author: Mark Thomas 
AuthorDate: Tue Jul 27 18:06:28 2021 +0100

Avoid deprecation warnings for isAccessible

Take the opportunity to simplify the code.
---
 .../catalina/core/DefaultInstanceManager.java  | 46 ++
 1 file changed, 20 insertions(+), 26 deletions(-)

diff --git a/java/org/apache/catalina/core/DefaultInstanceManager.java 
b/java/org/apache/catalina/core/DefaultInstanceManager.java
index c82f1cc..f673334 100644
--- a/java/org/apache/catalina/core/DefaultInstanceManager.java
+++ b/java/org/apache/catalina/core/DefaultInstanceManager.java
@@ -225,13 +225,12 @@ public class DefaultInstanceManager implements 
InstanceManager {
 AnnotationCacheEntry[] annotations = annotationCache.get(clazz);
 for (AnnotationCacheEntry entry : annotations) {
 if (entry.getType() == AnnotationCacheEntryType.POST_CONSTRUCT) {
+// This will always return a new Method instance
+// Making this instance accessible does not affect other 
instances
 Method postConstruct = getMethod(clazz, entry);
-synchronized (postConstruct) {
-boolean accessibility = postConstruct.isAccessible();
-postConstruct.setAccessible(true);
-postConstruct.invoke(instance);
-postConstruct.setAccessible(accessibility);
-}
+// If this doesn't work, just let invoke() fail
+postConstruct.trySetAccessible();
+postConstruct.invoke(instance);
 }
 }
 }
@@ -263,13 +262,12 @@ public class DefaultInstanceManager implements 
InstanceManager {
 }
 for (AnnotationCacheEntry entry : annotations) {
 if (entry.getType() == AnnotationCacheEntryType.PRE_DESTROY) {
+// This will always return a new Method instance
+// Making this instance accessible does not affect other 
instances
 Method preDestroy = getMethod(clazz, entry);
-synchronized (preDestroy) {
-boolean accessibility = preDestroy.isAccessible();
-preDestroy.setAccessible(true);
-preDestroy.invoke(instance);
-preDestroy.setAccessible(accessibility);
-}
+// If this doesn't work, just let invoke() fail
+preDestroy.trySetAccessible();
+preDestroy.invoke(instance);
 }
 }
 }
@@ -572,7 +570,6 @@ public class DefaultInstanceManager implements 
InstanceManager {
 throws NamingException, IllegalAccessException {
 
 Object lookedupResource;
-boolean accessibility;
 
 String normalizedName = normalize(name);
 
@@ -583,12 +580,11 @@ public class DefaultInstanceManager implements 
InstanceManager {
 context.lookup(clazz.getName() + "/" + field.getName());
 }
 
-synchronized (field) {
-accessibility = field.isAccessible();
-field.setAccessible(true);
-field.set(instance, lookedupResource);
-field.setAccessible(accessibility);
-}
+// This will always be a new Field instance
+// Making this instance accessible does not affect other instances
+// If this doens't work, just let set() fail
+field.trySetAccessible();
+field.set(instance, lookedupResource);
 }
 
 /**
@@ -614,7 +610,6 @@ public class DefaultInstanceManager implements 
InstanceManager {
 }
 
 Object lookedupResource;
-boolean accessibility;
 
 String normalizedName = normalize(name);
 
@@ -625,12 +620,11 @@ public class DefaultInstanceManager implements 
InstanceManager {
 clazz.getName() + "/" + 
Introspection.getPropertyName(method));
 }
 
-synchronized (method) {
-accessibility = method.isAccessible();
-method.setAccessible(true);
-method.invoke(instance, lookedupResource);
-method.setAccessible(accessibility);
-}
+// This will always be a new Method instance
+// Making this instance accessible does not affect other instances
+// If this doens't work, just let invoke() fail
+method.trySetAccessible();
+method.invoke(instance, lookedupResource);
 }
 
 private static void loadProperties(Set classNames, String 
resourceName,

-
To unsubscribe, e-m

[tomcat] branch main updated: Update Travis to use Java 11 for all 10.1.x builds

2021-07-27 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 1c843d8  Update Travis to use Java 11 for all 10.1.x builds
1c843d8 is described below

commit 1c843d8091aa2f7e4b42db55809cb75d5d3e7d4f
Author: Mark Thomas 
AuthorDate: Tue Jul 27 17:03:05 2021 +0100

Update Travis to use Java 11 for all 10.1.x builds
---
 .travis.yml | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e0afb7a..ab3ca35 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,9 +20,9 @@ jobs:
   - arch: s390x
 jdk: openjdk11
   - arch: arm64
-jdk: oraclejdk8
+jdk: oraclejdk11
   - arch: ppc64le
-jdk: oraclejdk8
+jdk: oraclejdk11
 
 addons:
 apt:
@@ -40,13 +40,13 @@ addons:
 install:
 - ARCH=`uname -p`
 - echo $ARCH
-- 
JDK_X64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u282b08.tar.gz";
-- 
JDK_ARM64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jdk_aarch64_linux_hotspot_jdk8u282-b08.tar.gz";
-- 
JDK_s390x="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.10_9.tar.gz";
-- 
JDK_ppc64le="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jdk_ppc64le_linux_hotspot_8u282b08.tar.gz";
+- 
JDK_X64="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.11%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.11_9.tar.gz";
+- 
JDK_ARM64="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.11%2B9/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.11_9.tar.gz";
+- 
JDK_s390x="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.11%2B9/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.11_9.tar.gz";
+- 
JDK_ppc64le="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.11%2B9/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.11_9.tar.gz";
 - if test "X$ARCH" = "Xaarch64"; then JDK_URL=$JDK_ARM64; elif test 
"$ARCH" = "ppc64le"; then JDK_URL=$JDK_ppc64le; elif test "$ARCH" = "s390x"; 
then JDK_URL=$JDK_s390x; else JDK_URL=$JDK_X64; fi
 - wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz
-- if test "$ARCH" = "s390x"; then mv jdk-11* jdk; else mv jdk8* jdk; fi
+- mv jdk-11* jdk
 - export JAVA_HOME=`pwd`/jdk
 - wget -q 
https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.11-bin.tar.gz && 
tar xzf apache-ant-*-bin.tar.gz
 - export ANT_HOME=`pwd`/apache-ant-1.10.11

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



[tomcat] branch main updated: Drop Java 8 for Linux. Move Windows build to Java 11.

2021-07-27 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 aa919f6  Drop Java 8 for Linux. Move Windows build to Java 11.
aa919f6 is described below

commit aa919f6be1a75d4b9615bb7e0f76f85119af2c1b
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:55:32 2021 +0100

Drop Java 8 for Linux. Move Windows build to Java 11.
---
 .github/workflows/ci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e2b5177..52b1fa9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -28,11 +28,11 @@ jobs:
 strategy:
   fail-fast: false
   matrix:
-java: [ 8, 11, 16, 17-ea ]
+java: [ 11, 16, 17-ea ]
 os: [ ubuntu-latest ]
 include:
 - os: windows-latest
-  java: 8
+  java: 11
 name: JDK${{ matrix.java }} ${{ matrix.os }}
 runs-on: ${{ matrix.os }}
 steps:

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



[tomcat] branch main updated: Fix IDE warning re NPE

2021-07-27 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 689438c  Fix IDE warning re NPE
689438c is described below

commit 689438c04bba34b1a81c5ccbcefdc3b8f8c9a654
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:51:24 2021 +0100

Fix IDE warning re NPE
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index e69fc74..4181ba2 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1022,7 +1022,9 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 }
 }
 } catch (CancelledKeyException ckx) {
-socketWrapper.close();
+if (socketWrapper != null) {
+socketWrapper.close();
+}
 }
 }
 } catch (ConcurrentModificationException cme) {

-
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 format with 9.0.x

2021-07-27 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 ef164a3  Align format with 9.0.x
ef164a3 is described below

commit ef164a362e0f2bc3e7c9e731097fc0397cae31ea
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:47:54 2021 +0100

Align format with 9.0.x
---
 java/org/apache/naming/NamingContext.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 4fc8b41..faed240 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -843,9 +843,8 @@ public class NamingContext implements Context {
 }
 } else if (entry.type == NamingEntry.REFERENCE) {
 try {
-Object obj = NamingManager.getObjectInstance
-(entry.value, name, this, env);
-if(entry.value instanceof ResourceRef) {
+Object obj = NamingManager.getObjectInstance(entry.value, 
name, this, env);
+if (entry.value instanceof ResourceRef) {
 boolean singleton = Boolean.parseBoolean(
 (String) ((ResourceRef) entry.value).get(
 "singleton").getContent());

-
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 use of Class.newInstance()

2021-07-27 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 e70ef19  Avoid use of Class.newInstance()
e70ef19 is described below

commit e70ef198a8970ccb6bb7ae5f148e52d0995f607a
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:47:54 2021 +0100

Avoid use of Class.newInstance()
---
 java/org/apache/catalina/startup/Catalina.java | 4 ++--
 java/org/apache/naming/NamingContext.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/startup/Catalina.java 
b/java/org/apache/catalina/startup/Catalina.java
index 9b606e6..caab5fe 100644
--- a/java/org/apache/catalina/startup/Catalina.java
+++ b/java/org/apache/catalina/startup/Catalina.java
@@ -558,8 +558,8 @@ public class Catalina {
 // Load loader
 String loaderClassName = generatedCodePackage + 
".DigesterGeneratedCodeLoader";
 try {
-Digester.GeneratedCodeLoader loader =
-(Digester.GeneratedCodeLoader) 
Catalina.class.getClassLoader().loadClass(loaderClassName).newInstance();
+Digester.GeneratedCodeLoader loader = 
(Digester.GeneratedCodeLoader)
+
Catalina.class.getClassLoader().loadClass(loaderClassName).getDeclaredConstructor().newInstance();
 Digester.setGeneratedCodeLoader(loader);
 } catch (Exception e) {
 if (log.isDebugEnabled()) {
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 30b8c95..cefa30f 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -868,7 +868,7 @@ public class NamingContext implements Context {
 // Note: This may need manual constructor reflection 
configuration
 Reference reference = (Reference) entry.value;
 Class factoryClass = 
getClass().getClassLoader().loadClass(reference.getFactoryClassName());
-ObjectFactory factory = (ObjectFactory) 
factoryClass.newInstance();
+ObjectFactory factory = (ObjectFactory) 
factoryClass.getDeclaredConstructor().newInstance();
 obj = factory.getObjectInstance(entry.value, name, 
this, env);
 }
 if (entry.value instanceof ResourceRef) {

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



[tomcat] branch 10.0.x updated: Avoid use of Class.newInstance()

2021-07-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 555fd62  Avoid use of Class.newInstance()
555fd62 is described below

commit 555fd623234b3df9225d1b78557326c9b6e1b2ca
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:47:54 2021 +0100

Avoid use of Class.newInstance()
---
 java/org/apache/catalina/startup/Catalina.java | 4 ++--
 java/org/apache/naming/NamingContext.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/startup/Catalina.java 
b/java/org/apache/catalina/startup/Catalina.java
index 69f22a0..d1e1705 100644
--- a/java/org/apache/catalina/startup/Catalina.java
+++ b/java/org/apache/catalina/startup/Catalina.java
@@ -583,8 +583,8 @@ public class Catalina {
 // Load loader
 String loaderClassName = generatedCodePackage + 
".DigesterGeneratedCodeLoader";
 try {
-Digester.GeneratedCodeLoader loader =
-(Digester.GeneratedCodeLoader) 
Catalina.class.getClassLoader().loadClass(loaderClassName).newInstance();
+Digester.GeneratedCodeLoader loader = 
(Digester.GeneratedCodeLoader)
+
Catalina.class.getClassLoader().loadClass(loaderClassName).getDeclaredConstructor().newInstance();
 Digester.setGeneratedCodeLoader(loader);
 } catch (Exception e) {
 if (log.isDebugEnabled()) {
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 30b8c95..cefa30f 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -868,7 +868,7 @@ public class NamingContext implements Context {
 // Note: This may need manual constructor reflection 
configuration
 Reference reference = (Reference) entry.value;
 Class factoryClass = 
getClass().getClassLoader().loadClass(reference.getFactoryClassName());
-ObjectFactory factory = (ObjectFactory) 
factoryClass.newInstance();
+ObjectFactory factory = (ObjectFactory) 
factoryClass.getDeclaredConstructor().newInstance();
 obj = factory.getObjectInstance(entry.value, name, 
this, env);
 }
 if (entry.value instanceof ResourceRef) {

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



[tomcat] branch main updated: Avoid use of Class.newInstance()

2021-07-27 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 08eae2b  Avoid use of Class.newInstance()
08eae2b is described below

commit 08eae2bbe9cee174a56cefd5b61546a73f584757
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:47:54 2021 +0100

Avoid use of Class.newInstance()
---
 java/org/apache/catalina/startup/Catalina.java | 4 ++--
 java/org/apache/naming/NamingContext.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/startup/Catalina.java 
b/java/org/apache/catalina/startup/Catalina.java
index 69f22a0..d1e1705 100644
--- a/java/org/apache/catalina/startup/Catalina.java
+++ b/java/org/apache/catalina/startup/Catalina.java
@@ -583,8 +583,8 @@ public class Catalina {
 // Load loader
 String loaderClassName = generatedCodePackage + 
".DigesterGeneratedCodeLoader";
 try {
-Digester.GeneratedCodeLoader loader =
-(Digester.GeneratedCodeLoader) 
Catalina.class.getClassLoader().loadClass(loaderClassName).newInstance();
+Digester.GeneratedCodeLoader loader = 
(Digester.GeneratedCodeLoader)
+
Catalina.class.getClassLoader().loadClass(loaderClassName).getDeclaredConstructor().newInstance();
 Digester.setGeneratedCodeLoader(loader);
 } catch (Exception e) {
 if (log.isDebugEnabled()) {
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 30b8c95..cefa30f 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -868,7 +868,7 @@ public class NamingContext implements Context {
 // Note: This may need manual constructor reflection 
configuration
 Reference reference = (Reference) entry.value;
 Class factoryClass = 
getClass().getClassLoader().loadClass(reference.getFactoryClassName());
-ObjectFactory factory = (ObjectFactory) 
factoryClass.newInstance();
+ObjectFactory factory = (ObjectFactory) 
factoryClass.getDeclaredConstructor().newInstance();
 obj = factory.getObjectInstance(entry.value, name, 
this, env);
 }
 if (entry.value instanceof ResourceRef) {

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



[tomcat] branch main updated (46a8745 -> bc11f60)

2021-07-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 46a8745  Simplify
 new abd84d2  Fix redundant specification of type arguments warnings
 new bc11f60  Handle new TLS handshake state.

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:
 .../servlet/jsp/el/ImplicitObjectELResolver.java | 20 ++--
 .../catalina/authenticator/DigestAuthenticator.java  |  2 +-
 .../catalina/filters/CsrfPreventionFilter.java   |  2 +-
 java/org/apache/catalina/realm/LockOutRealm.java |  2 +-
 .../apache/catalina/tribes/util/StringManager.java   |  2 +-
 .../coyote/http2/Http2AsyncUpgradeHandler.java   |  4 ++--
 .../collections/ManagedConcurrentWeakHashMap.java|  6 +++---
 java/org/apache/tomcat/util/net/Nio2Channel.java |  4 ++--
 java/org/apache/tomcat/util/net/Nio2Endpoint.java|  8 
 .../apache/tomcat/util/net/SecureNio2Channel.java|  4 ++--
 java/org/apache/tomcat/util/res/StringManager.java   |  2 +-
 .../tomcat/websocket/AsyncChannelWrapperSecure.java  |  9 ++---
 .../apache/tomcat/websocket/LocalStrings.properties  |  2 +-
 .../tomcat/websocket/LocalStrings_fr.properties  |  2 +-
 .../tomcat/websocket/LocalStrings_ja.properties  |  2 +-
 .../tomcat/websocket/LocalStrings_ko.properties  |  2 +-
 .../tomcat/websocket/LocalStrings_zh_CN.properties   |  1 -
 test/org/apache/catalina/valves/Benchmarks.java  | 20 ++--
 .../websocket/drawboard/DrawboardEndpoint.java   |  2 +-
 19 files changed, 49 insertions(+), 47 deletions(-)

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



[tomcat] 02/02: Handle new TLS handshake state.

2021-07-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit bc11f601e2ea0cc1e0d858a8e35ab2ae37fd214b
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:44:30 2021 +0100

Handle new TLS handshake state.

Only applies to DLTS so is always an error here
---
 java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java | 9 ++---
 java/org/apache/tomcat/websocket/LocalStrings.properties| 2 +-
 java/org/apache/tomcat/websocket/LocalStrings_fr.properties | 2 +-
 java/org/apache/tomcat/websocket/LocalStrings_ja.properties | 2 +-
 java/org/apache/tomcat/websocket/LocalStrings_ko.properties | 2 +-
 java/org/apache/tomcat/websocket/LocalStrings_zh_CN.properties  | 1 -
 6 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java 
b/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java
index a72949e..34485e9 100644
--- a/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java
+++ b/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java
@@ -411,9 +411,12 @@ public class AsyncChannelWrapperSecure implements 
AsyncChannelWrapper {
 handshaking = false;
 break;
 }
-case NOT_HANDSHAKING: {
-throw new SSLException(
-
sm.getString("asyncChannelWrapperSecure.notHandshaking"));
+case NOT_HANDSHAKING:
+// Don't expect to see this during a handshake
+case NEED_UNWRAP_AGAIN: {
+// Only applies to DLTS
+throw new SSLException(sm.getString(
+
"asyncChannelWrapperSecure.unexpectedHandshakeState", handshakeStatus));
 }
 }
 }
diff --git a/java/org/apache/tomcat/websocket/LocalStrings.properties 
b/java/org/apache/tomcat/websocket/LocalStrings.properties
index 382cc04..9031baf 100644
--- a/java/org/apache/tomcat/websocket/LocalStrings.properties
+++ b/java/org/apache/tomcat/websocket/LocalStrings.properties
@@ -22,10 +22,10 @@ asyncChannelWrapperSecure.closeFail=Failed to close channel 
cleanly
 asyncChannelWrapperSecure.concurrentRead=Concurrent read operations are not 
permitted
 asyncChannelWrapperSecure.concurrentWrite=Concurrent write operations are not 
permitted
 asyncChannelWrapperSecure.eof=Unexpected end of stream
-asyncChannelWrapperSecure.notHandshaking=Unexpected state [NOT_HANDSHAKING] 
during TLS handshake
 asyncChannelWrapperSecure.statusUnwrap=Unexpected Status of SSLEngineResult 
after an unwrap() operation
 asyncChannelWrapperSecure.statusWrap=Unexpected Status of SSLEngineResult 
after a wrap() operation
 asyncChannelWrapperSecure.tooBig=The result [{0}] is too big to be expressed 
as an Integer
+asyncChannelWrapperSecure.unexpectedHandshakeState=Unexpected state [{0}] 
during TLS handshake
 asyncChannelWrapperSecure.wrongStateRead=Flag that indicates a read is in 
progress was found to be false (it should have been true) when trying to 
complete a read operation
 asyncChannelWrapperSecure.wrongStateWrite=Flag that indicates a write is in 
progress was found to be false (it should have been true) when trying to 
complete a write operation
 
diff --git a/java/org/apache/tomcat/websocket/LocalStrings_fr.properties 
b/java/org/apache/tomcat/websocket/LocalStrings_fr.properties
index 72f3c1e..acaa7c1 100644
--- a/java/org/apache/tomcat/websocket/LocalStrings_fr.properties
+++ b/java/org/apache/tomcat/websocket/LocalStrings_fr.properties
@@ -22,10 +22,10 @@ asyncChannelWrapperSecure.closeFail=Impossible de fermer 
proprement le canal
 asyncChannelWrapperSecure.concurrentRead=Les opérations de lecture 
concurrentes ne sont pas permises
 asyncChannelWrapperSecure.concurrentWrite=Les opérations d'écriture 
concurrentes ne sont pas permises
 asyncChannelWrapperSecure.eof=Fin de flux inattendue
-asyncChannelWrapperSecure.notHandshaking=Etat NOT_HANDSHAKING inattendu 
pendant la négociation TLS
 asyncChannelWrapperSecure.statusUnwrap=Etat inattendu de SSLEngineResult après 
une opération unwrap()
 asyncChannelWrapperSecure.statusWrap=Etat inattendu de SSLEngineResult après 
une opération wrap()
 asyncChannelWrapperSecure.tooBig=Le résultat [{0}] est trop grand pour pouvoir 
être converti en Integer
+asyncChannelWrapperSecure.unexpectedHandshakeState=Etat [{0}] inattendu 
pendant la négociation TLS
 asyncChannelWrapperSecure.wrongStateRead=L'indicateur de lecture en cours 
était faux alors qu'il aurait dû vrai lors d'une tentative pour terminer une 
opération de lecture
 asyncChannelWrapperSecure.wrongStateWrite=L'indicateur d'écriture en cours 
était faux alors qu'il aurait dû vrai lors d'une tentat

[tomcat] 01/02: Fix redundant specification of type arguments warnings

2021-07-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit abd84d2096124a597e342897e0be25bbe8a03214
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:26:05 2021 +0100

Fix redundant specification of type arguments warnings
---
 .../servlet/jsp/el/ImplicitObjectELResolver.java | 20 ++--
 .../catalina/authenticator/DigestAuthenticator.java  |  2 +-
 .../catalina/filters/CsrfPreventionFilter.java   |  2 +-
 java/org/apache/catalina/realm/LockOutRealm.java |  2 +-
 .../apache/catalina/tribes/util/StringManager.java   |  2 +-
 .../coyote/http2/Http2AsyncUpgradeHandler.java   |  4 ++--
 .../collections/ManagedConcurrentWeakHashMap.java|  6 +++---
 java/org/apache/tomcat/util/net/Nio2Channel.java |  4 ++--
 java/org/apache/tomcat/util/net/Nio2Endpoint.java|  8 
 .../apache/tomcat/util/net/SecureNio2Channel.java|  4 ++--
 java/org/apache/tomcat/util/res/StringManager.java   |  2 +-
 test/org/apache/catalina/valves/Benchmarks.java  | 20 ++--
 .../websocket/drawboard/DrawboardEndpoint.java   |  2 +-
 13 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/java/jakarta/servlet/jsp/el/ImplicitObjectELResolver.java 
b/java/jakarta/servlet/jsp/el/ImplicitObjectELResolver.java
index 4e63e26..3d00c87 100644
--- a/java/jakarta/servlet/jsp/el/ImplicitObjectELResolver.java
+++ b/java/jakarta/servlet/jsp/el/ImplicitObjectELResolver.java
@@ -222,7 +222,7 @@ public class ImplicitObjectELResolver extends ELResolver {
 
 public Map getApplicationScope() {
 if (this.applicationScope == null) {
-this.applicationScope = new ScopeMap() {
+this.applicationScope = new ScopeMap<>() {
 @Override
 protected void setAttribute(String name, Object value) {
 page.getServletContext().setAttribute(name, value);
@@ -249,7 +249,7 @@ public class ImplicitObjectELResolver extends ELResolver {
 
 public Map getCookie() {
 if (this.cookie == null) {
-this.cookie = new ScopeMap() {
+this.cookie = new ScopeMap<>() {
 @Override
 protected Enumeration getAttributeNames() {
 Cookie[] cookies = ((HttpServletRequest) 
page.getRequest()).getCookies();
@@ -283,7 +283,7 @@ public class ImplicitObjectELResolver extends ELResolver {
 
 public Map getHeader() {
 if (this.header == null) {
-this.header = new ScopeMap() {
+this.header = new ScopeMap<>() {
 @Override
 protected Enumeration getAttributeNames() {
 return ((HttpServletRequest) page.getRequest())
@@ -302,7 +302,7 @@ public class ImplicitObjectELResolver extends ELResolver {
 
 public Map getHeaderValues() {
 if (this.headerValues == null) {
-this.headerValues = new ScopeMap() {
+this.headerValues = new ScopeMap<>() {
 @Override
 protected Enumeration getAttributeNames() {
 return ((HttpServletRequest) page.getRequest())
@@ -331,7 +331,7 @@ public class ImplicitObjectELResolver extends ELResolver {
 
 public Map getInitParam() {
 if (this.initParam == null) {
-this.initParam = new ScopeMap() {
+this.initParam = new ScopeMap<>() {
 @Override
 protected Enumeration getAttributeNames() {
 return 
page.getServletContext().getInitParameterNames();
@@ -352,7 +352,7 @@ public class ImplicitObjectELResolver extends ELResolver {
 
 public Map getPageScope() {
 if (this.pageScope == null) {
-this.pageScope = new ScopeMap() {
+this.pageScope = new ScopeMap<>() {
 @Override
 protected void setAttribute(String name, Object value) {
 page.setAttribute(name, value);
@@ -380,7 +380,7 @@ public class ImplicitObjectELResolver extends ELResolver {
 
 public Map getParam() {
 if (this.param == null) {
-this.param = new ScopeMap() {
+this.param = new ScopeMap<>() {
 @Override
 protected Enumeration getAttributeNames() {
 return page.getRequest().getParameterNames();
@@ -397,7 +397,7 @@ public class ImplicitObjectELResolver extends ELResolver {
 
 public Map getParamValues() {
 if (this.paramValues == null) {
-this.paramValues = new ScopeMap() {
+this.paramValues = new ScopeMap<>() {
 @Override
 protected String[] getAttribute(String na

[tomcat] branch main updated: Simplify

2021-07-27 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 46a8745  Simplify
46a8745 is described below

commit 46a87456eb9d187c69ee1524c6b8a61e3871807b
Author: remm 
AuthorDate: Tue Jul 27 17:29:08 2021 +0200

Simplify

Drop hacks that are no longer needed with Java 11.
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 84 +++-
 webapps/docs/changelog.xml   |  4 ++
 2 files changed, 26 insertions(+), 62 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 7865d42..e69fc74 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -676,10 +676,10 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 attachment.interestOps(ops);
 key.interestOps(ops);
 } catch (CancelledKeyException ckx) {
-cancelledKey(key, socketWrapper);
+socketWrapper.close();
 }
 } else {
-cancelledKey(key, socketWrapper);
+socketWrapper.close();
 }
 }
 }
@@ -711,35 +711,6 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 addEvent(event);
 }
 
-public void cancelledKey(SelectionKey sk, 
SocketWrapperBase socketWrapper) {
-if (JreCompat.isJre11Available() && socketWrapper != null) {
-socketWrapper.close();
-} else {
-try {
-// If is important to cancel the key first, otherwise a 
deadlock may occur between the
-// poller select and the socket channel close which would 
cancel the key
-// This workaround is not needed on Java 11+
-// TODO: verify, if not fixed in Java 11+ then 14+ is 
needed, see BZ 64007
-// TODO: the cancelledKey method can be removed with Java 
11 as minimum
-if (sk != null) {
-sk.attach(null);
-if (sk.isValid()) {
-sk.cancel();
-}
-}
-} catch (Throwable e) {
-ExceptionUtils.handleThrowable(e);
-if (log.isDebugEnabled()) {
-
log.error(sm.getString("endpoint.debug.channelCloseFail"), e);
-}
-} finally {
-if (socketWrapper != null) {
-socketWrapper.close();
-}
-}
-}
-}
-
 /**
  * The background thread that adds sockets to the Poller, checks the
  * poller for triggered events and hands the associated socket off to 
an
@@ -809,7 +780,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 protected void processKey(SelectionKey sk, NioSocketWrapper 
socketWrapper) {
 try {
 if (close) {
-cancelledKey(sk, socketWrapper);
+socketWrapper.close();
 } else if (sk.isValid()) {
 if (sk.isReadable() || sk.isWritable()) {
 if (socketWrapper.getSendfileData() != null) {
@@ -847,16 +818,16 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 }
 }
 if (closeSocket) {
-cancelledKey(sk, socketWrapper);
+socketWrapper.close();
 }
 }
 }
 } else {
 // Invalid key
-cancelledKey(sk, socketWrapper);
+socketWrapper.close();
 }
 } catch (CancelledKeyException ckx) {
-cancelledKey(sk, socketWrapper);
+socketWrapper.close();
 } catch (Throwable t) {
 ExceptionUtils.handleThrowable(t);
 log.error(sm.getString("endpoint.nio.keyProcessingError"), t);
@@ -924,7 +895,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 if (log.isDebugEnabled()) {
 log.debug("Send file connection is being 
closed");
 }
-poller.cancelledKey(sk, socketWrapper);
+socketWrapper.close();
 break

Re: [tomcat] branch main updated: The minimum Java version for the Jakarta 10 platform will be Java 11

2021-07-27 Thread Mark Thomas

On 27/07/2021 16:14, ma...@apache.org wrote:

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 5f41348  The minimum Java version for the Jakarta 10 platform will be 
Java 11
5f41348 is described below

commit 5f4134894a3744647a4671faa4140555f1013abc
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:13:54 2021 +0100

 The minimum Java version for the Jakarta 10 platform will be Java 11


I'm expecting lots of CI stuff to start breaking. I'll fix it as I see it.

Mark

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



svn commit: r1891834 - in /tomcat/site/trunk: docs/migration-10.1.html xdocs/migration-10.1.xml

2021-07-27 Thread markt
Author: markt
Date: Tue Jul 27 15:14:42 2021
New Revision: 1891834

URL: http://svn.apache.org/viewvc?rev=1891834&view=rev
Log:
Add minimum Java version info

Modified:
tomcat/site/trunk/docs/migration-10.1.html
tomcat/site/trunk/xdocs/migration-10.1.xml

Modified: tomcat/site/trunk/docs/migration-10.1.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/migration-10.1.html?rev=1891834&r1=1891833&r2=1891834&view=diff
==
--- tomcat/site/trunk/docs/migration-10.1.html (original)
+++ tomcat/site/trunk/docs/migration-10.1.html Tue Jul 27 15:14:42 2021
@@ -2,7 +2,7 @@
 Apache Tomcat® - Migration Guide - Tomcat 
10.0.xhttp://tomcat.apache.org/";>Apache 
Tomcat®https://www.apache.org/foundation/contributing.html"; target="_blank" 
class="pull-left">https://www.apache.org/images/SupportApache-small.png"; class="support-asf" 
alt="Support Apache">http://www.apache.org/"; target="_blank" class="pull-left">https://www.google.com/search"; method="get">GOhttps://www.apache.org/events/current-event.html";>https://www.apache.org/events/current-event-234x60.png"; alt="Next ASF 
event">
   Save the date!
 Apache TomcatHomeTaglibsMaven 
PluginDownloadWhich version?https://tomcat.apache.org/download-10.cgi";>Tomcat 10https://tomcat.apache.org/download-90.cgi";>Tomcat 9https://tomcat.apache.org/download-80.cgi";>Tomcat 8https://tomcat.apache.org/download-migration.cgi";>Tomcat Migration Tool 
for Jakarta EEhttps://tomcat.apache.org/download-connectors.cgi";>Tomcat 
Connectorshttps://tomcat.apache.org/download-native.cgi";>Tomcat 
Nativehttps://tomcat.apache.org/download-taglibs.cgi";>Taglibshttps://archive.apache.org/dist/tomcat/";>ArchivesDocumentationTomcat 10.1 (alpha)Tomcat 10.0Tomcat 9.0Tomcat 8.5Tomcat ConnectorsTomcat Nativehttps://cwiki.apache.org/confluence/display/TOMCAT";>WikiMigration GuidePresentationshttps://cwiki.apache.org/confluence/x/Bi8lBg";>SpecificationsProblems?Security ReportsFind helphttps://cwiki.apache.org/confluence/display/TOMCAT/FAQ";>FAQMailing ListsBug 
DatabaseIRC
 Get InvolvedOverviewSource 
codeBuildbothttps://cwiki.apache.org/confluence/x/vIPzBQ";>TranslationsToolsMediahttps://twitter.com/theapachetomcat";>Twitterhttps://www.youtube.com/c/ApacheTomcatOfficial";>YouTubehttps://blogs.apache.org/tomcat/";>BlogMiscWho We Arehttps://www.redbubble.com/people/comdev/works/30885254-apache-tomcat";>SwagHeritagehttp://www.apache.org";>Apache HomeResourcesContactLegalhttps://www.apache.org/foundation/contributing
 .html">Support Apachehttps://www.apache.org/foundation/sponsorship.html";>Sponsorshiphttp://www.apache.org/foundation/thanks.html";>Thankshttp://www.apache.org/licenses/";>LicenseContentTable of Contents
-GeneralMigrating from 10.0.x to 
10.1.xJava 8 requiredSpecification APIsServlet TBD APIServer Pages TBDExpression Language TBDWebSocket TBDAuthentication TBDInternal APIsUpgrading 10.1.xTomcat 10.1.x noteable 
changesTomcat 10.1.x 
configuration file differences
+GeneralMigrating from 10.0.x to 
10.1.xJava 11 requiredSpecification APIsServlet TBD APIServer Pages TBDExpression Language TBDWebSocket TBDAuthentication TBDInternal APIsUpgrading 10.1.xTomcat 10.1.x noteable 
changesTomcat 10.1.x 
configuration file differences
 General
 
 Please read general Migration Guide page first,
@@ -14,10 +14,10 @@ of Apache Tomcat.
   This section lists all the known changes between 10.0.x and 10.1.x
   which may cause backwards compatibility problems when upgrading.
 
-  Java 8 required
+  Java 11 required
 
-Apache Tomcat 10.1.x requires Java 8 or later. This is unchanged from
-Tomcat 10.0.x.
+Apache Tomcat 10.1.x requires Java 11 or later. This is a change from
+Apache Tomcat 10.0.x and 9.0.x which require Java 8 or later.
 
   
 

Modified: tomcat/site/trunk/xdocs/migration-10.1.xml
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/migration-10.1.xml?rev=1891834&r1=1891833&r2=1891834&view=diff
==
--- tomcat/site/trunk/xdocs/migration-10.1.xml (original)
+++ tomcat/site/trunk/xdocs/migration-10.1.xml Tue Jul 27 15:14:42 2021
@@ -25,10 +25,10 @@ of Apache Tomcat.
   This section lists all the known changes between 10.0.x and 10.1.x
   which may cause backwards compatibility problems when upgrading.
 
-  
+  
 
-Apache Tomcat 10.1.x requires Java 8 or later. This is unchanged from
-Tomcat 10.0.x.
+Apache Tomcat 10.1.x requires Java 11 or later. This is a change from
+Apache Tomcat 10.0.x and 9.0.x which require Java 8 or later.
 
   
 



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



[tomcat] branch main updated: The minimum Java version for the Jakarta 10 platform will be Java 11

2021-07-27 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 5f41348  The minimum Java version for the Jakarta 10 platform will be 
Java 11
5f41348 is described below

commit 5f4134894a3744647a4671faa4140555f1013abc
Author: Mark Thomas 
AuthorDate: Tue Jul 27 16:13:54 2021 +0100

The minimum Java version for the Jakarta 10 platform will be Java 11
---
 BUILDING.txt   |  4 ++--
 build.xml  | 10 +-
 webapps/docs/changelog.xml |  7 +++
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/BUILDING.txt b/BUILDING.txt
index 6f95801..f8500fc 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -36,8 +36,8 @@ source distribution, do the following:
 
  1. If the JDK is already installed, skip to (2).
 
- 2. Download a version 8 of Java Development Kit (JDK) release (use the
-latest update available for your chosen version) from one of:
+ 2. Download a version @MIN_JAVA_VERSION@ or later of Java Development Kit 
(JDK) release (use
+the latest update available for your chosen version) from one of:
 
 http://www.oracle.com/technetwork/java/javase/downloads/index.html
 http://openjdk.java.net/install/index.html
diff --git a/build.xml b/build.xml
index 4ca8941..2f02de7 100644
--- a/build.xml
+++ b/build.xml
@@ -98,11 +98,11 @@
   
   
 
-  
-  
-  
-  
-  
+  
+  
+  
+  
+  
 
   
   
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4e812c2..2be88c9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,13 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Update the minimum required Java version to Java 11. (markt)
+  
+
+  
   
 
   

-
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 unnecessary cache revalidation.

2021-07-27 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 9beff85  Avoid unnecessary cache revalidation.
9beff85 is described below

commit 9beff8511e69e3abbd2a6bc441753ba3c6946b24
Author: Mark Thomas 
AuthorDate: Tue Jul 27 15:17:44 2021 +0100

Avoid unnecessary cache revalidation.

Any cache that understands cache-control is not going to need to the
expires header. Keep it in the securePagesWithPragma branch since that
is for old HTTP/1.0 proxies that may not understand cache-control.
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 +-
 webapps/docs/changelog.xml| 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 79b1bc5..550113c 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -553,10 +553,10 @@ public abstract class AuthenticatorBase extends ValveBase
 // Note: These can cause problems with downloading files with 
IE
 response.setHeader("Pragma", "No-cache");
 response.setHeader("Cache-Control", "no-cache");
+response.setHeader("Expires", DATE_ONE);
 } else {
 response.setHeader("Cache-Control", "private");
 }
-response.setHeader("Expires", DATE_ONE);
 }
 
 if (constraints != null) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7bf0a16..123ddb4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
 65443: Refactor the CorsFilter to make it 
easier
 to extend. (markt)
   
+  
+To avoid unnecessary cache revalidation, do not add an HTTP
+Expires header when setting adding an HTTP header of
+CacheControl: private. (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: Avoid unnecessary cache revalidation.

2021-07-27 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 bd75e4e  Avoid unnecessary cache revalidation.
bd75e4e is described below

commit bd75e4e643ab45706a0d831c962a2326ef4e47f5
Author: Mark Thomas 
AuthorDate: Tue Jul 27 15:17:44 2021 +0100

Avoid unnecessary cache revalidation.

Any cache that understands cache-control is not going to need to the
expires header. Keep it in the securePagesWithPragma branch since that
is for old HTTP/1.0 proxies that may not understand cache-control.
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 +-
 webapps/docs/changelog.xml| 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 0e47bee..c46b0ba 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -551,10 +551,10 @@ public abstract class AuthenticatorBase extends ValveBase
 // Note: These can cause problems with downloading files with 
IE
 response.setHeader("Pragma", "No-cache");
 response.setHeader("Cache-Control", "no-cache");
+response.setHeader("Expires", DATE_ONE);
 } else {
 response.setHeader("Cache-Control", "private");
 }
-response.setHeader("Expires", DATE_ONE);
 }
 
 if (constraints != null) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e8c0b21..1f9f910 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
 65443: Refactor the CorsFilter to make it 
easier
 to extend. (markt)
   
+  
+To avoid unnecessary cache revalidation, do not add an HTTP
+Expires header when setting adding an HTTP header of
+CacheControl: private. (markt)
+  
 
   
   

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



[tomcat] branch 10.0.x updated: Avoid unnecessary cache revalidation.

2021-07-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new aa40d04  Avoid unnecessary cache revalidation.
aa40d04 is described below

commit aa40d041ea1625734dce43e3198afb1258f5369a
Author: Mark Thomas 
AuthorDate: Tue Jul 27 15:17:44 2021 +0100

Avoid unnecessary cache revalidation.

Any cache that understands cache-control is not going to need to the
expires header. Keep it in the securePagesWithPragma branch since that
is for old HTTP/1.0 proxies that may not understand cache-control.
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 +-
 webapps/docs/changelog.xml| 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index faf98cb..d751582 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -552,10 +552,10 @@ public abstract class AuthenticatorBase extends ValveBase
 // Note: These can cause problems with downloading files with 
IE
 response.setHeader("Pragma", "No-cache");
 response.setHeader("Cache-Control", "no-cache");
+response.setHeader("Expires", DATE_ONE);
 } else {
 response.setHeader("Cache-Control", "private");
 }
-response.setHeader("Expires", DATE_ONE);
 }
 
 if (constraints != null) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e323f45..8209037 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
 65443: Refactor the CorsFilter to make it 
easier
 to extend. (markt)
   
+  
+To avoid unnecessary cache revalidation, do not add an HTTP
+Expires header when setting adding an HTTP header of
+CacheControl: private. (markt)
+  
 
   
   

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



[tomcat] branch main updated: Avoid unnecessary cache revalidation.

2021-07-27 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 ba0c69d  Avoid unnecessary cache revalidation.
ba0c69d is described below

commit ba0c69d38d2e41ca4af9bb2aae12432062a88085
Author: Mark Thomas 
AuthorDate: Tue Jul 27 15:17:44 2021 +0100

Avoid unnecessary cache revalidation.

Any cache that understands cache-control is not going to need to the
expires header. Keep it in the securePagesWithPragma branch since that
is for old HTTP/1.0 proxies that may not understand cache-control.
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 +-
 webapps/docs/changelog.xml| 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index faf98cb..d751582 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -552,10 +552,10 @@ public abstract class AuthenticatorBase extends ValveBase
 // Note: These can cause problems with downloading files with 
IE
 response.setHeader("Pragma", "No-cache");
 response.setHeader("Cache-Control", "no-cache");
+response.setHeader("Expires", DATE_ONE);
 } else {
 response.setHeader("Cache-Control", "private");
 }
-response.setHeader("Expires", DATE_ONE);
 }
 
 if (constraints != null) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 491caff..4e812c2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -129,6 +129,11 @@
 65443: Refactor the CorsFilter to make it 
easier
 to extend. (markt)
   
+  
+To avoid unnecessary cache revalidation, do not add an HTTP
+Expires header when setting adding an HTTP header of
+CacheControl: private. (markt)
+  
 
   
   

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



Re: Tagging next release

2021-07-27 Thread Mark Thomas

On 27/07/2021 04:17, Christopher Schultz wrote:

Mark,

On 7/23/21 09:40, Mark Thomas wrote:

Hi all,

Partly due to the couple of regressions that have emerged this month, 
I'd like to aim to get the next set of releases out closer to the 
start of August than the middle.


With that in mind I'll be starting release prep shortly with a view to 
tagging around the middle of next week and starting the release vote 
towards the end of next week.


The 8.5.x branch looks like it's got fewer big fixes than 10.x and 9.x, 
but I'll be available to tag+vote 8.5.x as early this weekend. Any 
reason to delay to the end of next week for the vote, rather than 
starting at the beginning of the month (e.g. Monday)?


I'm planning on tagging later this week.

BZ 65460 is a regression that could cause issues for users making use of 
HTTP/2.


Mark

-
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: No longer automatically disable JMX when using GraalVM native images

2021-07-27 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 f11dc24  No longer automatically disable JMX when using GraalVM native 
images
f11dc24 is described below

commit f11dc242ac4f7f6536d10efb876483652304e910
Author: Mark Thomas 
AuthorDate: Tue Jul 27 14:06:28 2021 +0100

No longer automatically disable JMX when using GraalVM native images
---
 java/org/apache/tomcat/util/modeler/Registry.java | 7 +--
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/tomcat/util/modeler/Registry.java 
b/java/org/apache/tomcat/util/modeler/Registry.java
index e98a598..a15fb0d 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -39,7 +39,6 @@ import javax.management.ObjectName;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.compat.JreCompat;
 import org.apache.tomcat.util.modeler.modules.ModelerSource;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -136,11 +135,7 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
  */
 public static synchronized Registry getRegistry(Object key, Object guard) {
 if (registry == null) {
-if (JreCompat.isGraalAvailable()) {
-disableRegistry();
-} else {
-registry = new Registry();
-}
+registry = new Registry();
 registry.guard = guard;
 }
 if (registry.guard != null && registry.guard != guard) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 217bf47..e8c0b21 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -190,6 +190,12 @@
   
 Improvements to Korean translations. (woonsan)
   
+  
+Use of GraalVM native images no longer automatically disables JMX
+support. JMX support may still be disabled by calling
+org.apache.tomcat.util.modeler.Registry.disableRegistry().
+(markt)
+  
 
   
 

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



[tomcat] branch 10.0.x updated: No longer automatically disable JMX when using GraalVM native images

2021-07-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 70a6bce  No longer automatically disable JMX when using GraalVM native 
images
70a6bce is described below

commit 70a6bce9766510de7ad9945c4606a1285f6ebbe0
Author: Mark Thomas 
AuthorDate: Tue Jul 27 14:06:28 2021 +0100

No longer automatically disable JMX when using GraalVM native images
---
 java/org/apache/tomcat/util/modeler/Registry.java | 7 +--
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/tomcat/util/modeler/Registry.java 
b/java/org/apache/tomcat/util/modeler/Registry.java
index e98a598..a15fb0d 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -39,7 +39,6 @@ import javax.management.ObjectName;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.compat.JreCompat;
 import org.apache.tomcat.util.modeler.modules.ModelerSource;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -136,11 +135,7 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
  */
 public static synchronized Registry getRegistry(Object key, Object guard) {
 if (registry == null) {
-if (JreCompat.isGraalAvailable()) {
-disableRegistry();
-} else {
-registry = new Registry();
-}
+registry = new Registry();
 registry.guard = guard;
 }
 if (registry.guard != null && registry.guard != guard) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c8e98a0..e323f45 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -190,6 +190,12 @@
   
 Improvements to Korean translations. (woonsan)
   
+  
+Use of GraalVM native images no longer automatically disables JMX
+support. JMX support may still be disabled by calling
+org.apache.tomcat.util.modeler.Registry.disableRegistry().
+(markt)
+  
 
   
 

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



[tomcat] branch main updated: No longer automatically disable JMX when using GraalVM native images

2021-07-27 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 98540e0  No longer automatically disable JMX when using GraalVM native 
images
98540e0 is described below

commit 98540e0557f76f8654c0e63efb3c573218ca6fec
Author: Mark Thomas 
AuthorDate: Tue Jul 27 14:06:28 2021 +0100

No longer automatically disable JMX when using GraalVM native images
---
 java/org/apache/tomcat/util/modeler/Registry.java | 7 +--
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/tomcat/util/modeler/Registry.java 
b/java/org/apache/tomcat/util/modeler/Registry.java
index e98a598..a15fb0d 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -39,7 +39,6 @@ import javax.management.ObjectName;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.compat.JreCompat;
 import org.apache.tomcat.util.modeler.modules.ModelerSource;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -136,11 +135,7 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
  */
 public static synchronized Registry getRegistry(Object key, Object guard) {
 if (registry == null) {
-if (JreCompat.isGraalAvailable()) {
-disableRegistry();
-} else {
-registry = new Registry();
-}
+registry = new Registry();
 registry.guard = guard;
 }
 if (registry.guard != null && registry.guard != guard) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 975ba43..491caff 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -209,6 +209,12 @@
   
 Improvements to Korean translations. (woonsan)
   
+  
+Use of GraalVM native images no longer automatically disables JMX
+support. JMX support may still be disabled by calling
+org.apache.tomcat.util.modeler.Registry.disableRegistry().
+(markt)
+  
 
   
 

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



[Bug 65466] content-type application/json default encoding

2021-07-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65466

--- Comment #6 from Michael Osipov  ---
(In reply to qeepcologne from comment #5)
> thanks for checking, if i log it to tomcat access log via "%{Content-Type}i"
> header is unmodified, probably it happens later in spring magic.

It is very unlikely. Spring with Jackson never write a charset. You likely need
to debug this.

-- 
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 65466] content-type application/json default encoding

2021-07-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65466

--- Comment #5 from qeepcologne  ---
thanks for checking, if i log it to tomcat access log via "%{Content-Type}i"
header is unmodified, probably it happens later in spring magic.

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



[tomcat] branch 8.5.x updated: Restore use of guard which was accidently removed in a previous clean up

2021-07-27 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 d5883af  Restore use of guard which was accidently removed in a 
previous clean up
d5883af is described below

commit d5883af8189a01130b8a8073e1b9b7a312e73ca3
Author: Mark Thomas 
AuthorDate: Tue Jul 27 13:11:47 2021 +0100

Restore use of guard which was accidently removed in a previous clean up

Clean up was in 8b888234
---
 java/org/apache/tomcat/util/modeler/Registry.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/java/org/apache/tomcat/util/modeler/Registry.java 
b/java/org/apache/tomcat/util/modeler/Registry.java
index dab256b..93d3576 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -134,6 +134,7 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
 public static synchronized Registry getRegistry(Object key, Object guard) {
 if (registry == null) {
 registry = new Registry();
+registry.guard = guard;
 }
 if (registry.guard != null && registry.guard != guard) {
 return null;

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



[tomcat] branch 9.0.x updated: Restore use of guard which was accidently removed in a previous clean up

2021-07-27 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 3a9e204  Restore use of guard which was accidently removed in a 
previous clean up
3a9e204 is described below

commit 3a9e20420fbec39b959836dea24f007e14bd4bff
Author: Mark Thomas 
AuthorDate: Tue Jul 27 13:11:47 2021 +0100

Restore use of guard which was accidently removed in a previous clean up

Clean up was in 8b888234
---
 java/org/apache/tomcat/util/modeler/Registry.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/java/org/apache/tomcat/util/modeler/Registry.java 
b/java/org/apache/tomcat/util/modeler/Registry.java
index 7ef9ad7..e98a598 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -141,6 +141,7 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
 } else {
 registry = new Registry();
 }
+registry.guard = guard;
 }
 if (registry.guard != null && registry.guard != guard) {
 return null;

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



[tomcat] branch 10.0.x updated: Restore use of guard which was accidently removed in a previous clean up

2021-07-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 8f4f0f0  Restore use of guard which was accidently removed in a 
previous clean up
8f4f0f0 is described below

commit 8f4f0f00c8c29aca85c47a74cb1229a77c6ae9b9
Author: Mark Thomas 
AuthorDate: Tue Jul 27 13:11:47 2021 +0100

Restore use of guard which was accidently removed in a previous clean up

Clean up was in 8b888234
---
 java/org/apache/tomcat/util/modeler/Registry.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/java/org/apache/tomcat/util/modeler/Registry.java 
b/java/org/apache/tomcat/util/modeler/Registry.java
index 7ef9ad7..e98a598 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -141,6 +141,7 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
 } else {
 registry = new Registry();
 }
+registry.guard = guard;
 }
 if (registry.guard != null && registry.guard != guard) {
 return null;

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



[tomcat] branch main updated: Restore use of guard which was accidently removed in a previous clean up

2021-07-27 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 074285b  Restore use of guard which was accidently removed in a 
previous clean up
074285b is described below

commit 074285b0cd31e7f69fe3e7ee5a85d6877627aaac
Author: Mark Thomas 
AuthorDate: Tue Jul 27 13:11:47 2021 +0100

Restore use of guard which was accidently removed in a previous clean up

Clean up was in 8b888234
---
 java/org/apache/tomcat/util/modeler/Registry.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/java/org/apache/tomcat/util/modeler/Registry.java 
b/java/org/apache/tomcat/util/modeler/Registry.java
index 7ef9ad7..e98a598 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -141,6 +141,7 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
 } else {
 registry = new Registry();
 }
+registry.guard = guard;
 }
 if (registry.guard != null && registry.guard != guard) {
 return null;

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



[Bug 65443] Allow subclassing CorsFilter

2021-07-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65443

--- Comment #10 from ekkelenk...@gmail.com ---
Thanks for providing the change. I'll use it in my code once available in the
new releases.

-- 
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 65466] content-type application/json default encoding

2021-07-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65466

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED

--- Comment #4 from Mark Thomas  ---
Tomcat doesn't change any incoming headers. I've just confirmed this both with
a code review and with the following:

POST /examples/jsp/snp/snoop.jsp HTTP/1.1
Host: localhost:8080
Content-Type: application;json
Content-Length: 20

{
"key": value
}


The content type reported in the JSP was:
Content type: application;json

Best guess, some other component is wrapping the request.

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



svn commit: r1891825 - in /tomcat/site/trunk: docs/migration-10.1.html docs/whichversion.html xdocs/migration-10.1.xml xdocs/whichversion.xml

2021-07-27 Thread markt
Author: markt
Date: Tue Jul 27 10:33:08 2021
New Revision: 1891825

URL: http://svn.apache.org/viewvc?rev=1891825&view=rev
Log:
Update Servlet spec version for Tomcat 10.1.x to 6.0

Modified:
tomcat/site/trunk/docs/migration-10.1.html
tomcat/site/trunk/docs/whichversion.html
tomcat/site/trunk/xdocs/migration-10.1.xml
tomcat/site/trunk/xdocs/whichversion.xml

Modified: tomcat/site/trunk/docs/migration-10.1.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/migration-10.1.html?rev=1891825&r1=1891824&r2=1891825&view=diff
==
--- tomcat/site/trunk/docs/migration-10.1.html (original)
+++ tomcat/site/trunk/docs/migration-10.1.html Tue Jul 27 10:33:08 2021
@@ -23,7 +23,7 @@ of Apache Tomcat.
 
   Specification 
APIs
 
-Apache Tomcat 10.1 supports the Jakarta Servlet TBD,
+Apache Tomcat 10.1 supports the Jakarta Servlet 6.0,
 Jakarta Server Pages TBD, Jakarta Expression Language TBD,
 JakartaWebSocket TBD and Jakarta Authentication TBD
 https://cwiki.apache.org/confluence/display/TOMCAT/Specifications";>specifications.

Modified: tomcat/site/trunk/docs/whichversion.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/whichversion.html?rev=1891825&r1=1891824&r2=1891825&view=diff
==
--- tomcat/site/trunk/docs/whichversion.html (original)
+++ tomcat/site/trunk/docs/whichversion.html Tue Jul 27 10:33:08 2021
@@ -24,7 +24,7 @@ specifications and the respective Ap
 
 
 
-  5.1
+  6.0
   TBD
   TBD
   TBD
@@ -203,7 +203,7 @@ run stably for extended periods of time.
 
 Apache Tomcat 10.1.x is the current focus of development. 
It
 builds on Tomcat 10.0.x and implements the Servlet
-5.1, JSP TBD, EL TBD, 
WebSocket TBD
+6.0, JSP TBD, EL TBD, 
WebSocket TBD
  and Authentication TBD specifications (the versions 
required by
 Jakarta EE 10 platform).
 

Modified: tomcat/site/trunk/xdocs/migration-10.1.xml
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/migration-10.1.xml?rev=1891825&r1=1891824&r2=1891825&view=diff
==
--- tomcat/site/trunk/xdocs/migration-10.1.xml (original)
+++ tomcat/site/trunk/xdocs/migration-10.1.xml Tue Jul 27 10:33:08 2021
@@ -34,7 +34,7 @@ of Apache Tomcat.
 
   
 
-Apache Tomcat 10.1 supports the Jakarta Servlet TBD,
+Apache Tomcat 10.1 supports the Jakarta Servlet 6.0,
 Jakarta Server Pages TBD, Jakarta Expression Language TBD,
 JakartaWebSocket TBD and Jakarta Authentication TBD
 https://cwiki.apache.org/confluence/display/TOMCAT/Specifications";>specifications.

Modified: tomcat/site/trunk/xdocs/whichversion.xml
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/whichversion.xml?rev=1891825&r1=1891824&r2=1891825&view=diff
==
--- tomcat/site/trunk/xdocs/whichversion.xml (original)
+++ tomcat/site/trunk/xdocs/whichversion.xml Tue Jul 27 10:33:08 2021
@@ -33,7 +33,7 @@ specifications and the respective Ap
 
 
 
-  5.1
+  6.0
   TBD
   TBD
   TBD
@@ -217,7 +217,7 @@ run stably for extended periods of time.
 
 Apache Tomcat 10.1.x is the current focus of development. 
It
 builds on Tomcat 10.0.x and implements the Servlet
-5.1, JSP TBD, EL TBD, 
WebSocket TBD
+6.0, JSP TBD, EL TBD, 
WebSocket TBD
  and Authentication TBD specifications (the versions 
required by
 Jakarta EE 10 platform).
 



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



[tomcat] branch main updated: Next version of servlet spec will be 6.0 rather than 5.1

2021-07-27 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 c24a27d  Next version of servlet spec will be 6.0 rather than 5.1
c24a27d is described below

commit c24a27dfb5ea566755806bfd6ede28ac934ef4f7
Author: Mark Thomas 
AuthorDate: Tue Jul 27 11:30:12 2021 +0100

Next version of servlet spec will be 6.0 rather than 5.1

Spec versions will always be major.minor and the various modifiers (PD,
MR1 etc) will no longer be used. Use the standard Maven modifier of
"-SNAPSHOT" to align with the servlet spec project
---
 BUILDING.txt  |  2 +-
 RELEASE-NOTES |  2 +-
 build.xml |  4 ++--
 java/jakarta/el/ImportHandler.java|  4 ++--
 java/jakarta/servlet/ServletContext.java  | 12 ++--
 java/jakarta/servlet/http/Cookie.java |  6 +++---
 java/org/apache/catalina/connector/CoyoteAdapter.java |  2 +-
 res/META-INF/servlet-api.jar.manifest |  2 +-
 res/bnd/servlet-api.jar.tmp.bnd   |  2 +-
 res/bnd/tomcat-embed-core.jar.tmp.bnd |  2 +-
 webapps/docs/changelog.xml|  8 +++-
 webapps/docs/class-loader-howto.xml   |  2 +-
 webapps/docs/index.xml|  2 +-
 webapps/docs/project.xml  |  2 +-
 14 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/BUILDING.txt b/BUILDING.txt
index 956ca68..6f95801 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -20,7 +20,7 @@
 
 
 This project contains the source code for Tomcat @VERSION_MAJOR_MINOR@, a 
container that
-implements the Jakarta Servlet 5.1, JSP 3.0, EL 5.0, WebSocket 2.0 and
+implements the Jakarta Servlet 6.0, JSP 3.0, EL 5.0, WebSocket 2.0 and
 Authentication 2.0 specifications from the Jakarta EE project at Eclipse
 .
 
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 7bd6f7c..1a7b622 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -78,7 +78,7 @@ for use by web applications (by placing them in "lib"):
 * jasper.jar (Jasper 2 Compiler and Runtime)
 * jasper-el.jar (Jasper 2 EL implementation)
 * jsp-api.jar (JSP 3.0 API)
-* servlet-api.jar (Servlet 5.1 API)
+* servlet-api.jar (Servlet 6.0 API)
 * tomcat-api.jar (Interfaces shared by Catalina and Jasper)
 * tomcat-coyote.jar (Tomcat connectors and utility classes)
 * tomcat-dbcp.jar (package renamed database connection pool based on Commons 
DBCP 2)
diff --git a/build.xml b/build.xml
index 77f9083..4ca8941 100644
--- a/build.xml
+++ b/build.xml
@@ -52,8 +52,8 @@
   
 
   
-  
-  
+  
+  
   
   
   
diff --git a/java/jakarta/el/ImportHandler.java 
b/java/jakarta/el/ImportHandler.java
index 74858d2..018f53d 100644
--- a/java/jakarta/el/ImportHandler.java
+++ b/java/jakarta/el/ImportHandler.java
@@ -38,7 +38,7 @@ public class ImportHandler {
 private static final Map> standardPackages = new 
HashMap<>();
 
 static {
-// Servlet 5.1
+// Servlet 6.0
 Set servletClassNames = new HashSet<>();
 // Interfaces
 servletClassNames.add("AsyncContext");
@@ -91,7 +91,7 @@ public class ImportHandler {
 servletClassNames.add("UnavailableException");
 standardPackages.put("jakarta.servlet", servletClassNames);
 
-// Servlet 5.1
+// Servlet 6.0
 Set servletHttpClassNames = new HashSet<>();
 // Interfaces
 servletHttpClassNames.add("HttpServletMapping");
diff --git a/java/jakarta/servlet/ServletContext.java 
b/java/jakarta/servlet/ServletContext.java
index b66891a..3c8894c 100644
--- a/java/jakarta/servlet/ServletContext.java
+++ b/java/jakarta/servlet/ServletContext.java
@@ -92,19 +92,19 @@ public interface ServletContext {
 
 /**
  * Returns the major version of the Java Servlet API that this servlet
- * container supports. All implementations that comply with Version 5.1 
must
- * have this method return the integer 5.
+ * container supports. All implementations that comply with Version 6.0 
must
+ * have this method return the integer 6.
  *
- * @return 5
+ * @return 6
  */
 public int getMajorVersion();
 
 /**
  * Returns the minor version of the Servlet API that this servlet container
- * supports. All implementations that comply with Version 5.1 must have 
this
- * method return the integer 1.
+ * supports. All implementations that comply with Version 6.0 must have 
this
+ * method return the integer 0.
  *
- * @return 1
+ * @return 0
  */
 public int getMinorVersion();
 
diff --git a/java/jakarta/servlet/http/Cookie.java

[Bug 65466] content-type application/json default encoding

2021-07-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65466

--- Comment #3 from qeepcologne  ---
request headers - i test request with postman and log headers via
org.springframework.web.filter.CommonsRequestLoggingFilter in the backend and
found it modified.

-- 
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 65466] content-type application/json default encoding

2021-07-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65466

--- Comment #2 from Mark Thomas  ---
A little clarification is required. Do you mean HTTP request headers or HTTP
response headers? Assuming you mean HTTP response headers, how - exactly - is
the response created? Is this a static resource or is the response generated
dynamically?

-- 
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 65466] content-type application/json default encoding

2021-07-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65466

--- Comment #1 from Michael Osipov  ---
Absolutely valid. Same request for HttpClient
https://issues.apache.org/jira/browse/HTTPCLIENT-2159.

-- 
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 65466] New: content-type application/json default encoding

2021-07-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65466

Bug ID: 65466
   Summary: content-type application/json default encoding
   Product: Tomcat 9
   Version: 9.0.50
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: bernd.wah...@k2interactive.de
  Target Milestone: -

when making a request with Content-Type:"application/json" (without encoding
parameter!) against tomcat (i reproduced it with postman), tomcat changes the
request to:
 Content-Type:"application/json;charset=ISO-8859-1"
(in case of tomcat 9, i tried 9.0.50 and 9.0.48, tomcat 10 adding UTF-8
instead).
This is very strange to me, i think headers should not be modified at all.
And according to rfc, json default is UTF-8:
https://datatracker.ietf.org/doc/html/rfc7159

I could fix this by setting the charset of every request explicitly to UTF-8,
but if you have clients relying on the standard, it should not be necessary.

expected behavior:
- use the correct default, either the tomcat 10 way or leaving the header
unchanged. 
- if not possible (e.g. backward compatibility?) add longer explanation to
migration guide if you have clients without json payload without charset that
they will break.

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