[tomcat] branch main updated: Clean-up. No functional change.
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 7f2ae5c Clean-up. No functional change. 7f2ae5c is described below commit 7f2ae5c4a433f461e68c7fd960cc7b151e3607f8 Author: Mark Thomas AuthorDate: Wed Jul 28 11:28:10 2021 +0100 Clean-up. No functional change. --- .../tomcat/util/net/openssl/OpenSSLContext.java| 53 +++--- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java index ce3cce3..7e6d198 100644 --- a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java +++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java @@ -64,45 +64,33 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext { private static final String defaultProtocol = "TLS"; -private final SSLHostConfig sslHostConfig; -private final SSLHostConfigCertificate certificate; -private OpenSSLSessionContext sessionContext; -private X509TrustManager x509TrustManager; - -private final List negotiableProtocols; - -private String enabledProtocol; - -public String getEnabledProtocol() { -return enabledProtocol; -} +private static final String BEGIN_KEY = "-BEGIN PRIVATE KEY-\n"; +private static final Object END_KEY = "\n-END PRIVATE KEY-"; -public void setEnabledProtocol(String protocol) { -enabledProtocol = (protocol == null) ? defaultProtocol : protocol; +static final CertificateFactory X509_CERT_FACTORY; +static { +try { +X509_CERT_FACTORY = CertificateFactory.getInstance("X.509"); +} catch (CertificateException e) { +throw new IllegalStateException(sm.getString("openssl.X509FactoryError"), e); +} } +private final SSLHostConfig sslHostConfig; +private final SSLHostConfigCertificate certificate; +private final List negotiableProtocols; private final long aprPool; private final AtomicInteger aprPoolDestroyed = new AtomicInteger(0); - // OpenSSLConfCmd context protected final long cctx; // SSL context protected final long ctx; -static final CertificateFactory X509_CERT_FACTORY; - -private static final String BEGIN_KEY = "-BEGIN PRIVATE KEY-\n"; - -private static final Object END_KEY = "\n-END PRIVATE KEY-"; +private OpenSSLSessionContext sessionContext; +private X509TrustManager x509TrustManager; +private String enabledProtocol; private boolean initialized = false; -static { -try { -X509_CERT_FACTORY = CertificateFactory.getInstance("X.509"); -} catch (CertificateException e) { -throw new IllegalStateException(sm.getString("openssl.X509FactoryError"), e); -} -} public OpenSSLContext(SSLHostConfigCertificate certificate, List negotiableProtocols) throws SSLException { @@ -181,6 +169,17 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext { } } + +public String getEnabledProtocol() { +return enabledProtocol; +} + + +public void setEnabledProtocol(String protocol) { +enabledProtocol = (protocol == null) ? defaultProtocol : protocol; +} + + @Override public synchronized void destroy() { // Guard against multiple destroyPools() calls triggered by construction exception and finalize() later - 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: Clean-up. No functional change.
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 8efe870 Clean-up. No functional change. 8efe870 is described below commit 8efe870650120d85d505ab2afee54c2447770ecf Author: Mark Thomas AuthorDate: Wed Jul 28 11:28:10 2021 +0100 Clean-up. No functional change. --- .../tomcat/util/net/openssl/OpenSSLContext.java| 53 +++--- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java index ce3cce3..7e6d198 100644 --- a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java +++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java @@ -64,45 +64,33 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext { private static final String defaultProtocol = "TLS"; -private final SSLHostConfig sslHostConfig; -private final SSLHostConfigCertificate certificate; -private OpenSSLSessionContext sessionContext; -private X509TrustManager x509TrustManager; - -private final List negotiableProtocols; - -private String enabledProtocol; - -public String getEnabledProtocol() { -return enabledProtocol; -} +private static final String BEGIN_KEY = "-BEGIN PRIVATE KEY-\n"; +private static final Object END_KEY = "\n-END PRIVATE KEY-"; -public void setEnabledProtocol(String protocol) { -enabledProtocol = (protocol == null) ? defaultProtocol : protocol; +static final CertificateFactory X509_CERT_FACTORY; +static { +try { +X509_CERT_FACTORY = CertificateFactory.getInstance("X.509"); +} catch (CertificateException e) { +throw new IllegalStateException(sm.getString("openssl.X509FactoryError"), e); +} } +private final SSLHostConfig sslHostConfig; +private final SSLHostConfigCertificate certificate; +private final List negotiableProtocols; private final long aprPool; private final AtomicInteger aprPoolDestroyed = new AtomicInteger(0); - // OpenSSLConfCmd context protected final long cctx; // SSL context protected final long ctx; -static final CertificateFactory X509_CERT_FACTORY; - -private static final String BEGIN_KEY = "-BEGIN PRIVATE KEY-\n"; - -private static final Object END_KEY = "\n-END PRIVATE KEY-"; +private OpenSSLSessionContext sessionContext; +private X509TrustManager x509TrustManager; +private String enabledProtocol; private boolean initialized = false; -static { -try { -X509_CERT_FACTORY = CertificateFactory.getInstance("X.509"); -} catch (CertificateException e) { -throw new IllegalStateException(sm.getString("openssl.X509FactoryError"), e); -} -} public OpenSSLContext(SSLHostConfigCertificate certificate, List negotiableProtocols) throws SSLException { @@ -181,6 +169,17 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext { } } + +public String getEnabledProtocol() { +return enabledProtocol; +} + + +public void setEnabledProtocol(String protocol) { +enabledProtocol = (protocol == null) ? defaultProtocol : protocol; +} + + @Override public synchronized void destroy() { // Guard against multiple destroyPools() calls triggered by construction exception and finalize() later - 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: Clean-up. No functional change.
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 fa79421 Clean-up. No functional change. fa79421 is described below commit fa79421db942ddc8c4c237205834ad6efda0ba84 Author: Mark Thomas AuthorDate: Wed Jul 28 11:28:10 2021 +0100 Clean-up. No functional change. --- .../tomcat/util/net/openssl/OpenSSLContext.java| 53 +++--- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java index ce3cce3..7e6d198 100644 --- a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java +++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java @@ -64,45 +64,33 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext { private static final String defaultProtocol = "TLS"; -private final SSLHostConfig sslHostConfig; -private final SSLHostConfigCertificate certificate; -private OpenSSLSessionContext sessionContext; -private X509TrustManager x509TrustManager; - -private final List negotiableProtocols; - -private String enabledProtocol; - -public String getEnabledProtocol() { -return enabledProtocol; -} +private static final String BEGIN_KEY = "-BEGIN PRIVATE KEY-\n"; +private static final Object END_KEY = "\n-END PRIVATE KEY-"; -public void setEnabledProtocol(String protocol) { -enabledProtocol = (protocol == null) ? defaultProtocol : protocol; +static final CertificateFactory X509_CERT_FACTORY; +static { +try { +X509_CERT_FACTORY = CertificateFactory.getInstance("X.509"); +} catch (CertificateException e) { +throw new IllegalStateException(sm.getString("openssl.X509FactoryError"), e); +} } +private final SSLHostConfig sslHostConfig; +private final SSLHostConfigCertificate certificate; +private final List negotiableProtocols; private final long aprPool; private final AtomicInteger aprPoolDestroyed = new AtomicInteger(0); - // OpenSSLConfCmd context protected final long cctx; // SSL context protected final long ctx; -static final CertificateFactory X509_CERT_FACTORY; - -private static final String BEGIN_KEY = "-BEGIN PRIVATE KEY-\n"; - -private static final Object END_KEY = "\n-END PRIVATE KEY-"; +private OpenSSLSessionContext sessionContext; +private X509TrustManager x509TrustManager; +private String enabledProtocol; private boolean initialized = false; -static { -try { -X509_CERT_FACTORY = CertificateFactory.getInstance("X.509"); -} catch (CertificateException e) { -throw new IllegalStateException(sm.getString("openssl.X509FactoryError"), e); -} -} public OpenSSLContext(SSLHostConfigCertificate certificate, List negotiableProtocols) throws SSLException { @@ -181,6 +169,17 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext { } } + +public String getEnabledProtocol() { +return enabledProtocol; +} + + +public void setEnabledProtocol(String protocol) { +enabledProtocol = (protocol == null) ? defaultProtocol : protocol; +} + + @Override public synchronized void destroy() { // Guard against multiple destroyPools() calls triggered by construction exception and finalize() later - 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: Clean-up. No functional change.
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 f6f8ad3 Clean-up. No functional change. f6f8ad3 is described below commit f6f8ad3d3dce96c755671fab5268b5f1d0268a17 Author: Mark Thomas AuthorDate: Wed Jul 28 11:28:10 2021 +0100 Clean-up. No functional change. --- .../tomcat/util/net/openssl/OpenSSLContext.java| 53 +++--- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java index 8110ff1..5fc4db9 100644 --- a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java +++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java @@ -66,45 +66,33 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext { private static final String defaultProtocol = "TLS"; -private final SSLHostConfig sslHostConfig; -private final SSLHostConfigCertificate certificate; -private OpenSSLSessionContext sessionContext; -private X509TrustManager x509TrustManager; - -private final List negotiableProtocols; - -private String enabledProtocol; - -public String getEnabledProtocol() { -return enabledProtocol; -} +private static final String BEGIN_KEY = "-BEGIN PRIVATE KEY-\n"; +private static final Object END_KEY = "\n-END PRIVATE KEY-"; -public void setEnabledProtocol(String protocol) { -enabledProtocol = (protocol == null) ? defaultProtocol : protocol; +static final CertificateFactory X509_CERT_FACTORY; +static { +try { +X509_CERT_FACTORY = CertificateFactory.getInstance("X.509"); +} catch (CertificateException e) { +throw new IllegalStateException(sm.getString("openssl.X509FactoryError"), e); +} } +private final SSLHostConfig sslHostConfig; +private final SSLHostConfigCertificate certificate; +private final List negotiableProtocols; private final long aprPool; private final AtomicInteger aprPoolDestroyed = new AtomicInteger(0); - // OpenSSLConfCmd context protected final long cctx; // SSL context protected final long ctx; -static final CertificateFactory X509_CERT_FACTORY; - -private static final String BEGIN_KEY = "-BEGIN PRIVATE KEY-\n"; - -private static final Object END_KEY = "\n-END PRIVATE KEY-"; +private OpenSSLSessionContext sessionContext; +private X509TrustManager x509TrustManager; +private String enabledProtocol; private boolean initialized = false; -static { -try { -X509_CERT_FACTORY = CertificateFactory.getInstance("X.509"); -} catch (CertificateException e) { -throw new IllegalStateException(sm.getString("openssl.X509FactoryError"), e); -} -} public OpenSSLContext(SSLHostConfigCertificate certificate, List negotiableProtocols) throws SSLException { @@ -183,6 +171,17 @@ public class OpenSSLContext implements org.apache.tomcat.util.net.SSLContext { } } + +public String getEnabledProtocol() { +return enabledProtocol; +} + + +public void setEnabledProtocol(String protocol) { +enabledProtocol = (protocol == null) ? defaultProtocol : protocol; +} + + @Override public synchronized void destroy() { // Guard against multiple destroyPools() calls triggered by construction exception and finalize() later - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove JreCompat from EL API as it is no longer required.
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 335bed0 Remove JreCompat from EL API as it is no longer required. 335bed0 is described below commit 335bed06af17759de0fcb46235f257bbea301299 Author: Mark Thomas AuthorDate: Wed Jul 28 12:08:10 2021 +0100 Remove JreCompat from EL API as it is no longer required. --- java/jakarta/el/ELProcessor.java | 6 +-- java/jakarta/el/ImportHandler.java | 14 +++-- java/jakarta/el/Jre9Compat.java| 83 -- java/jakarta/el/JreCompat.java | 73 -- java/jakarta/el/StaticFieldELResolver.java | 6 +-- java/jakarta/el/Util.java | 6 +-- 6 files changed, 16 insertions(+), 172 deletions(-) diff --git a/java/jakarta/el/ELProcessor.java b/java/jakarta/el/ELProcessor.java index aea604a..61d8a2a 100644 --- a/java/jakarta/el/ELProcessor.java +++ b/java/jakarta/el/ELProcessor.java @@ -113,13 +113,12 @@ public class ELProcessor { // Only returns public methods. Java 9+ access is checked below. Method methods[] = clazz.getMethods(); -JreCompat jreCompat = JreCompat.getInstance(); for (Method method : methods) { if (!Modifier.isStatic(method.getModifiers())) { continue; } -if (!jreCompat.canAccess(null, method)) { +if (!method.canAccess(null)) { continue; } if (method.getName().equals(sig.getName())) { @@ -193,8 +192,7 @@ public class ELProcessor { int modifiers = method.getModifiers(); // Check for static, public method and module access for Java 9+ -JreCompat jreCompat = JreCompat.getInstance(); -if (!Modifier.isStatic(modifiers) || !jreCompat.canAccess(null, method)) { +if (!Modifier.isStatic(modifiers) || !method.canAccess(null)) { throw new NoSuchMethodException(Util.message(context, "elProcessor.defineFunctionInvalidMethod", method.getName(), method.getDeclaringClass().getName())); diff --git a/java/jakarta/el/ImportHandler.java b/java/jakarta/el/ImportHandler.java index 018f53d..899da78 100644 --- a/java/jakarta/el/ImportHandler.java +++ b/java/jakarta/el/ImportHandler.java @@ -479,12 +479,11 @@ public class ImportHandler { return null; } -// Class must be public, non-abstract, not an interface and (for -// Java 9+) in an exported package -JreCompat jreCompat = JreCompat.getInstance(); +// Class must be public, non-abstract, not an interface and in an +// exported package int modifiers = clazz.getModifiers(); if (!Modifier.isPublic(modifiers) || Modifier.isAbstract(modifiers) || -Modifier.isInterface(modifiers) || !jreCompat.isExported(clazz)) { +Modifier.isInterface(modifiers) || !isExported(clazz)) { if (throwException) { throw new ELException(Util.message( null, "importHandler.invalidClass", name)); @@ -497,6 +496,13 @@ public class ImportHandler { } +public static boolean isExported(Class type) { +String packageName = type.getPackage().getName(); +Module module = type.getModule(); +return module.isExported(packageName); +} + + /* * Marker class used because null values are not permitted in a * ConcurrentHashMap. diff --git a/java/jakarta/el/Jre9Compat.java b/java/jakarta/el/Jre9Compat.java deleted file mode 100644 index a4451ff..000 --- a/java/jakarta/el/Jre9Compat.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package jakarta.el; - -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.Method; - -/* - * This is a cut down version of org.apache.tomcat.util.Jre9Compat that provides - * only the methods required by the EL implementation. - * - * This class is duplicated in
[tomcat] branch main updated: Remove JreCompat from EL implementation as it is no longer required
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 0bfaf55 Remove JreCompat from EL implementation as it is no longer required 0bfaf55 is described below commit 0bfaf55bbe41242ee152c44ec992f71d58925027 Author: Mark Thomas AuthorDate: Wed Jul 28 12:12:26 2021 +0100 Remove JreCompat from EL implementation as it is no longer required --- java/org/apache/el/util/Jre9Compat.java | 58 java/org/apache/el/util/JreCompat.java | 60 - java/org/apache/el/util/ReflectionUtil.java | 3 +- 3 files changed, 1 insertion(+), 120 deletions(-) diff --git a/java/org/apache/el/util/Jre9Compat.java b/java/org/apache/el/util/Jre9Compat.java deleted file mode 100644 index 3debecc..000 --- a/java/org/apache/el/util/Jre9Compat.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.el.util; - -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.Method; - -/* - * This is a cut down version of org.apache.tomcat.util.Jre9Compat that provides - * only the methods required by the EL implementation. - * - * This class is duplicated in jakarta.el - * When making changes keep the two in sync. - */ -class Jre9Compat extends JreCompat { - -private static final Method canAccessMethod; - - -static { -Method m1 = null; -try { -m1 = AccessibleObject.class.getMethod("canAccess", new Class[] { Object.class }); -} catch (NoSuchMethodException e) { -// Expected for Java 8 -} -canAccessMethod = m1; -} - - -public static boolean isSupported() { -return canAccessMethod != null; -} - - -@Override -public boolean canAccess(Object base, AccessibleObject accessibleObject) { -try { -return ((Boolean) canAccessMethod.invoke(accessibleObject, base)).booleanValue(); -} catch (ReflectiveOperationException | IllegalArgumentException e) { -return false; -} -} -} diff --git a/java/org/apache/el/util/JreCompat.java b/java/org/apache/el/util/JreCompat.java deleted file mode 100644 index 5c1fc6a..000 --- a/java/org/apache/el/util/JreCompat.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.el.util; - -import java.lang.reflect.AccessibleObject; - -/* - * This is a cut down version of org.apache.tomcat.util.JreCompat that provides - * only the methods required by the EL implementation. - * - * This class is duplicated in jakarta.el - * When making changes keep the two in sync. - */ -public class JreCompat { - -private static final JreCompat instance; - -static { -if (Jre9Compat.isSupported()) { -instance = new Jre9Compat(); -} else { -instance = new JreCompat(); -} -} - - -public static JreCompat getInstance() { -return instance; -} - - -/** - * Is the accessibleObject accessible (as a result of appropriate module - * exports) on the provided instance? - * - * @param base The specific instance to be tested. - * @param accessibleObject The method/field/constructor to be tested. - * -
[tomcat] branch main updated: Remove Jasper dependency on removed JreCompat
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 8b54724 Remove Jasper dependency on removed JreCompat 8b54724 is described below commit 8b54724d541e66a7650d4c52b5582dc05abe4fe4 Author: Mark Thomas AuthorDate: Wed Jul 28 12:13:33 2021 +0100 Remove Jasper dependency on removed JreCompat --- java/org/apache/jasper/compiler/Generator.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java index eea8225..1186c37 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -49,7 +49,6 @@ import jakarta.servlet.jsp.tagext.TagInfo; import jakarta.servlet.jsp.tagext.TagVariableInfo; import jakarta.servlet.jsp.tagext.VariableInfo; -import org.apache.el.util.JreCompat; import org.apache.jasper.Constants; import org.apache.jasper.JasperException; import org.apache.jasper.JspCompilationContext; @@ -1350,13 +1349,12 @@ class Generator { // Check the bean is public, not an interface, not abstract // and (for Java 9+) in an exported module int modifiers = bean.getModifiers(); -JreCompat jreCompat = JreCompat.getInstance(); // No need to test for being an interface here as the // getConstructor() call above will have already failed for // any interfaces. if (!Modifier.isPublic(modifiers) || Modifier.isAbstract(modifiers) || -!jreCompat.canAccess(null, constructor) ) { +!constructor.canAccess(null) ) { throw new Exception(Localizer.getMessage("jsp.error.invalid.bean", Integer.valueOf(modifiers))); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Simplify as must be on Java 11+
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 2642421 Simplify as must be on Java 11+ 2642421 is described below commit 26424219b95ce8e2919256bc6a419bd38c04f8fe Author: Mark Thomas AuthorDate: Wed Jul 28 12:15:14 2021 +0100 Simplify as must be on Java 11+ --- java/org/apache/juli/ClassLoaderLogManager.java | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/java/org/apache/juli/ClassLoaderLogManager.java b/java/org/apache/juli/ClassLoaderLogManager.java index 42e8f11..0882c85 100644 --- a/java/org/apache/juli/ClassLoaderLogManager.java +++ b/java/org/apache/juli/ClassLoaderLogManager.java @@ -50,23 +50,11 @@ import java.util.logging.Logger; */ public class ClassLoaderLogManager extends LogManager { -private static final boolean isJava9; - private static ThreadLocal addingLocalRootLogger = ThreadLocal.withInitial(() -> Boolean.FALSE); public static final String DEBUG_PROPERTY = ClassLoaderLogManager.class.getName() + ".debug"; -static { -Class c = null; -try { -c = Class.forName("java.lang.Runtime$Version"); -} catch (ClassNotFoundException e) { -// Must be Java 8 -} -isJava9 = c != null; -} - private final class Cleaner extends Thread { @Override @@ -494,8 +482,7 @@ public class ClassLoaderLogManager extends LogManager { } // Try the default JVM configuration if (is == null) { -File defaultFile = new File(new File(System.getProperty("java.home"), - isJava9 ? "conf" : "lib"), +File defaultFile = new File(new File(System.getProperty("java.home"), "conf"), "logging.properties"); try { is = new FileInputStream(defaultFile); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove JreLeakPreventionListener options that are not required
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 424cd32 Remove JreLeakPreventionListener options that are not required 424cd32 is described below commit 424cd322dc60f9ee63e1175e4cf957353d79b88d Author: Mark Thomas AuthorDate: Wed Jul 28 12:28:50 2021 +0100 Remove JreLeakPreventionListener options that are not required Most of these were fixed in Java 9 --- .../core/JreMemoryLeakPreventionListener.java | 225 + .../apache/catalina/core/LocalStrings.properties | 3 - .../catalina/core/LocalStrings_de.properties | 2 - .../catalina/core/LocalStrings_es.properties | 3 - .../catalina/core/LocalStrings_fr.properties | 3 - .../catalina/core/LocalStrings_ja.properties | 3 - .../catalina/core/LocalStrings_ko.properties | 3 - .../catalina/core/LocalStrings_zh_CN.properties| 3 - webapps/docs/config/listeners.xml | 69 --- 9 files changed, 2 insertions(+), 312 deletions(-) diff --git a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java index b3c56a5..7bed3ad 100644 --- a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java +++ b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java @@ -17,30 +17,19 @@ package org.apache.catalina.core; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.net.URLConnection; import java.sql.DriverManager; import java.util.StringTokenizer; -import java.util.concurrent.ForkJoinPool; import javax.imageio.ImageIO; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; -import org.apache.catalina.startup.SafeForkJoinWorkerThreadFactory; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; -import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.compat.JreCompat; -import org.apache.tomcat.util.compat.JreVendor; import org.apache.tomcat.util.res.StringManager; -import org.w3c.dom.Document; -import org.w3c.dom.ls.DOMImplementationLS; /** * Provide a workaround for known places where the Java Runtime environment can @@ -61,8 +50,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { private static final Log log = LogFactory.getLog(JreMemoryLeakPreventionListener.class); private static final StringManager sm = StringManager.getManager(JreMemoryLeakPreventionListener.class); -private static final String FORK_JOIN_POOL_THREAD_FACTORY_PROPERTY = -"java.util.concurrent.ForkJoinPool.common.threadFactory"; /** * Protect against the memory leak caused when the first call to * sun.awt.AppContext.getAppContext() is triggered by a web @@ -76,48 +63,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { } /** - * Protect against the memory leak caused when the first call to - * java.awt.Toolkit.getDefaultToolkit() is triggered - * by a web application. Defaults to false because a new - * Thread is launched. - */ -private boolean awtThreadProtection = false; -public boolean isAWTThreadProtection() { return awtThreadProtection; } -public void setAWTThreadProtection(boolean awtThreadProtection) { - this.awtThreadProtection = awtThreadProtection; -} - -/** - * Protect against the memory leak caused when the first call to - * sun.misc.GC.requestLatency(long) is triggered by a web - * application. This first call will start a GC Daemon thread with the - * thread's context class loader configured to be the web application class - * loader. Defaults to true. - * - * @see "http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8157570"; - */ -private boolean gcDaemonProtection = true; -public boolean isGcDaemonProtection() { return gcDaemonProtection; } -public void setGcDaemonProtection(boolean gcDaemonProtection) { -this.gcDaemonProtection = gcDaemonProtection; -} - - /** - * Protect against the memory leak, when the initialization of the - * Java Cryptography Architecture is triggered by initializing - * a MessageDigest during web application deployment. - * This will occasionally start a Token Poller thread with the thread's - * context class loader equal to the web application class loader. - * Instead we initialize JCA early. - * Defaults to true. - */ -private boolean tokenPolle
[tomcat] branch main updated: Update comment
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 650a972 Update comment 650a972 is described below commit 650a972f671f5edb34263237393438eca89204f4 Author: Mark Thomas AuthorDate: Wed Jul 28 12:47:50 2021 +0100 Update comment --- java/org/apache/tomcat/websocket/PerMessageDeflate.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/org/apache/tomcat/websocket/PerMessageDeflate.java b/java/org/apache/tomcat/websocket/PerMessageDeflate.java index 95ff848..a96da90 100644 --- a/java/org/apache/tomcat/websocket/PerMessageDeflate.java +++ b/java/org/apache/tomcat/websocket/PerMessageDeflate.java @@ -98,7 +98,7 @@ public class PerMessageDeflate implements Transformation { SERVER_MAX_WINDOW_BITS, Integer.valueOf(serverMaxWindowBits))); } -// Java SE API (as of Java 8) does not expose the API to +// Java SE API (as of Java 11) does not expose the API to // control the Window size. It is effectively hard-coded // to 15 if (isServer && serverMaxWindowBits != 15) { @@ -119,7 +119,7 @@ public class PerMessageDeflate implements Transformation { if (clientMaxWindowBits == -1) { if (param.getValue() == null) { // Hint to server that the client supports this -// option. Java SE API (as of Java 8) does not +// option. Java SE API (as of Java 11) does not // expose the API to control the Window size. It is // effectively hard-coded to 15 clientMaxWindowBits = 15; @@ -132,7 +132,7 @@ public class PerMessageDeflate implements Transformation { Integer.valueOf(clientMaxWindowBits))); } } -// Java SE API (as of Java 8) does not expose the API to +// Java SE API (as of Java 11) does not expose the API to // control the Window size. It is effectively hard-coded // to 15 if (!isServer && clientMaxWindowBits != 15) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 838decd Remove use of JreCompat as it is not required with Java 11+ 838decd is described below commit 838decd611170bb55810dc948f2be9091c27da7c Author: Mark Thomas AuthorDate: Wed Jul 28 13:07:46 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- .../tomcat/util/compat/LocalStrings.properties | 1 - .../tomcat/util/compat/LocalStrings_es.properties | 2 -- .../tomcat/util/compat/LocalStrings_fr.properties | 1 - .../tomcat/util/compat/LocalStrings_ja.properties | 1 - .../tomcat/util/compat/LocalStrings_ko.properties | 1 - .../util/compat/LocalStrings_zh_CN.properties | 1 - .../tomcat/util/scan/LocalStrings.properties | 1 + .../tomcat/util/scan/LocalStrings_es.properties| 1 + .../tomcat/util/scan/LocalStrings_fr.properties| 1 + .../tomcat/util/scan/LocalStrings_ja.properties| 1 + .../tomcat/util/scan/LocalStrings_ko.properties| 1 + .../tomcat/util/scan/LocalStrings_zh_CN.properties | 1 + .../tomcat/util/scan/StandardJarScanner.java | 28 +++--- 13 files changed, 25 insertions(+), 16 deletions(-) diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties b/java/org/apache/tomcat/util/compat/LocalStrings.properties index 8b55643..4286723 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -jre9Compat.invalidModuleUri=The module URI provided [{0}] could not be converted to a URL for the JarScanner to process jre9Compat.javaPre9=Class not found so assuming code is running on a pre-Java 9 JVM jre9Compat.unexpected=Failed to create references to Java 9 classes and methods diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_es.properties b/java/org/apache/tomcat/util/compat/LocalStrings_es.properties index 87b3f59..73f3ca3 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings_es.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings_es.properties @@ -13,6 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -jre9Compat.invalidModuleUri=El módulo URI proveído [{0}] no pudo ser convertiod a una URL para ser procesado por JarScanner - jreCompat.noApplicationProtocol=Java Runtime no soporta SSLEngine.getApplicationProtocol(). Se necesita Java 9 para usar esta función. diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties b/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties index cfb8a96..e10efa4 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties @@ -16,7 +16,6 @@ jre16Compat.javaPre16=Le code est considéré être exécuté sur une JVM antérieure à Java 16 car la classe n'a pas été trouvée jre16Compat.unexpected=Impossible de créer les références vers les classes et méthodes de Java 16 -jre9Compat.invalidModuleUri=L''URI du module fournie [{0}] n''a pas pu être convertie en URL pour être traitée par le JarScanner jre9Compat.javaPre9=Le code est considéré être exécuté sur une JVM antérieure à Java 9 car la classe n'a pas été trouvée jre9Compat.unexpected=Impossible de créer les références vers les classes et méthodes de Java 9 diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties b/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties index e9d35ea..adda934 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties @@ -16,7 +16,6 @@ jre16Compat.javaPre16=クラスが見つからないため、コードがJava 16より前のJVMで実行されていると仮定します jre16Compat.unexpected=Java16クラスおよびメソッドへの参照の作成に失敗しました -jre9Compat.invalidModuleUri=モジュール URI [{0}] を JarScanner で処理する URL に変換できませんでした。 jre9Compat.javaPre9=クラスが見つからないため Java 9 以前の JVM 上でコードが実行されていると仮定します jre9Compat.unexpected=Java9 クラスやメソッドへの参照の生成に失敗しました diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_ko.properties b/java/org/apache/tomcat/util/compat/LocalStrings_ko.properties index b5666eb..00acd8f 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings_ko.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings_ko.properties @@ -16,7 +16,6 @@ jre16Compat.javaPre16=클래스가 발견되지 않습니다. 자바 16 이전의 JVM에서 실행 중인 것으로 보입니다. jre16Compat.unexpected=자바 16 클래스들과 메소드들을 참조할 수 없습니다. -jre9Compat.invalidModuleUri=[{0}](으)로 제공된 모듈 URI는 JarScanner가 처리할 수 있는 URL로 변환될 수 없습니다. jre9Compat.javaPre9=Java 9 클래스가 발견되지 않습니다. Java 9 이전 버전에서 동작하고 있는 것으로 보입니다. jre9Compat.unexpected=Java 9 클래스들과 메소드들을 참조할 수
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 ac62b95 Remove use of JreCompat as it is not required with Java 11+ ac62b95 is described below commit ac62b95775b9c6be628b7aaa8b38f4221bb56473 Author: Mark Thomas AuthorDate: Wed Jul 28 13:12:20 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- .../org/apache/catalina/core/JreMemoryLeakPreventionListener.java | 8 +--- java/org/apache/catalina/core/LocalStrings.properties | 1 - java/org/apache/catalina/core/LocalStrings_es.properties | 2 -- java/org/apache/catalina/core/LocalStrings_fr.properties | 1 - java/org/apache/catalina/core/LocalStrings_ja.properties | 1 - java/org/apache/catalina/core/LocalStrings_ko.properties | 1 - java/org/apache/catalina/core/LocalStrings_zh_CN.properties | 1 - 7 files changed, 1 insertion(+), 14 deletions(-) diff --git a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java index 7bed3ad..0adcaba 100644 --- a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java +++ b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java @@ -16,7 +16,6 @@ */ package org.apache.catalina.core; -import java.io.IOException; import java.net.URLConnection; import java.sql.DriverManager; import java.util.StringTokenizer; @@ -28,7 +27,6 @@ import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; -import org.apache.tomcat.util.compat.JreCompat; import org.apache.tomcat.util.res.StringManager; /** @@ -171,11 +169,7 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { // Set the default URL caching policy to not to cache if (urlCacheProtection) { -try { - JreCompat.getInstance().disableCachingForJarUrlConnections(); -} catch (IOException e) { - log.error(sm.getString("jreLeakListener.jarUrlConnCacheFail"), e); -} +URLConnection.setDefaultUseCaches("JAR", false); } if (classesToInitialize != null) { diff --git a/java/org/apache/catalina/core/LocalStrings.properties b/java/org/apache/catalina/core/LocalStrings.properties index f97d42a..f79faf3 100644 --- a/java/org/apache/catalina/core/LocalStrings.properties +++ b/java/org/apache/catalina/core/LocalStrings.properties @@ -141,7 +141,6 @@ jniLifecycleListener.load.path=Loaded native library from [{0}] jniLifecycleListener.missingPathOrName=One of libraryName or libraryPath must be set jreLeakListener.classToInitializeFail=Failed to load class [{0}] during Tomcat start to prevent possible memory leaks. -jreLeakListener.jarUrlConnCacheFail=Failed to disable Jar URL connection caching by default naming.addEnvEntry=Adding environment entry [{0}] naming.addResourceEnvRef=Adding resource env ref [{0}] diff --git a/java/org/apache/catalina/core/LocalStrings_es.properties b/java/org/apache/catalina/core/LocalStrings_es.properties index 62ca876..758bf92 100644 --- a/java/org/apache/catalina/core/LocalStrings_es.properties +++ b/java/org/apache/catalina/core/LocalStrings_es.properties @@ -79,8 +79,6 @@ defaultInstanceManager.restrictedServletsResource=No se ha hallado el fichero de filterChain.filter=La ejecución del Filtro lanzó una excepción filterChain.servlet=La ejecución del Servlet lanzó una excepción -jreLeakListener.jarUrlConnCacheFail=No pude desactivar la caché de conexión URL de Jar por defecto - naming.addEnvEntry=Adicionando entrada de ambiente [{0}]\n naming.bindFailed=No pude cambiar (bind) objeto: [{0}] naming.invalidEnvEntryType=La entrada de Entorno [{0}] tiene un tipo inválido diff --git a/java/org/apache/catalina/core/LocalStrings_fr.properties b/java/org/apache/catalina/core/LocalStrings_fr.properties index b587487..0394d08 100644 --- a/java/org/apache/catalina/core/LocalStrings_fr.properties +++ b/java/org/apache/catalina/core/LocalStrings_fr.properties @@ -141,7 +141,6 @@ jniLifecycleListener.load.path=La librairie native a été chargée à partir de jniLifecycleListener.missingPathOrName=Soit libraryName soit libraryPath doivent être définis jreLeakListener.classToInitializeFail=Echec du chargement de la classe [{0}] pendant le démarrage de Tomcat, effectué pour empêcher de possibles fuites de mémoire -jreLeakListener.jarUrlConnCacheFail=Échec de la désactivation du cache par défaut des URL de connexion de JAR naming.addEnvEntry=Ajout de l''entrée d''environnement [{0}] naming.addResourceEnvRef=Ajout de la référence d
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 3a06248 Remove use of JreCompat as it is not required with Java 11+ 3a06248 is described below commit 3a062482563222cb86742bf844f5c2fa7ed9fe2d Author: Mark Thomas AuthorDate: Wed Jul 28 13:16:59 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- java/org/apache/tomcat/util/net/SecureNio2Channel.java | 6 ++ java/org/apache/tomcat/util/net/SecureNioChannel.java | 6 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/java/org/apache/tomcat/util/net/SecureNio2Channel.java b/java/org/apache/tomcat/util/net/SecureNio2Channel.java index f460304..56a9ebf 100644 --- a/java/org/apache/tomcat/util/net/SecureNio2Channel.java +++ b/java/org/apache/tomcat/util/net/SecureNio2Channel.java @@ -41,7 +41,6 @@ import javax.net.ssl.SSLSession; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.buf.ByteBufferUtils; -import org.apache.tomcat.util.compat.JreCompat; import org.apache.tomcat.util.net.TLSClientHelloExtractor.ExtractorResult; import org.apache.tomcat.util.net.openssl.ciphers.Cipher; import org.apache.tomcat.util.res.StringManager; @@ -250,9 +249,8 @@ public class SecureNio2Channel extends Nio2Channel { if (sslEngine instanceof SSLUtil.ProtocolInfo) { socketWrapper.setNegotiatedProtocol( ((SSLUtil.ProtocolInfo) sslEngine).getNegotiatedProtocol()); -} else if (JreCompat.isAlpnSupported()) { -socketWrapper.setNegotiatedProtocol( - JreCompat.getInstance().getApplicationProtocol(sslEngine)); +} else { + socketWrapper.setNegotiatedProtocol(sslEngine.getApplicationProtocol()); } } //we are complete if we have delivered the last package diff --git a/java/org/apache/tomcat/util/net/SecureNioChannel.java b/java/org/apache/tomcat/util/net/SecureNioChannel.java index 22e339f..e3fc746 100644 --- a/java/org/apache/tomcat/util/net/SecureNioChannel.java +++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java @@ -38,7 +38,6 @@ import javax.net.ssl.SSLSession; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.buf.ByteBufferUtils; -import org.apache.tomcat.util.compat.JreCompat; import org.apache.tomcat.util.net.NioEndpoint.NioSocketWrapper; import org.apache.tomcat.util.net.TLSClientHelloExtractor.ExtractorResult; import org.apache.tomcat.util.net.openssl.ciphers.Cipher; @@ -175,9 +174,8 @@ public class SecureNioChannel extends NioChannel { if (sslEngine instanceof SSLUtil.ProtocolInfo) { socketWrapper.setNegotiatedProtocol( ((SSLUtil.ProtocolInfo) sslEngine).getNegotiatedProtocol()); -} else if (JreCompat.isAlpnSupported()) { -socketWrapper.setNegotiatedProtocol( - JreCompat.getInstance().getApplicationProtocol(sslEngine)); +} else { + socketWrapper.setNegotiatedProtocol(sslEngine.getApplicationProtocol()); } } //we are complete if we have delivered the last package - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 816479c Remove use of JreCompat as it is not required with Java 11+ 816479c is described below commit 816479c961b027890c92704f95eb519f4e6abb85 Author: Mark Thomas AuthorDate: Wed Jul 28 13:21:14 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java b/java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java index 925e91d..620c279 100644 --- a/java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java +++ b/java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java @@ -28,7 +28,6 @@ import java.util.Set; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLParameters; -import org.apache.tomcat.util.compat.JreCompat; import org.apache.tomcat.util.net.openssl.ciphers.Cipher; public abstract class AbstractJsseEndpoint extends AbstractEndpoint { @@ -123,7 +122,7 @@ public abstract class AbstractJsseEndpoint extends AbstractEndpoint { SSLParameters sslParameters = engine.getSSLParameters(); sslParameters.setUseCipherSuitesOrder(sslHostConfig.getHonorCipherOrder()); -if (JreCompat.isAlpnSupported() && clientRequestedApplicationProtocols != null +if (clientRequestedApplicationProtocols != null && clientRequestedApplicationProtocols.size() > 0 && negotiableProtocols.size() > 0) { // Only try to negotiate if both client and server have at least @@ -134,7 +133,7 @@ public abstract class AbstractJsseEndpoint extends AbstractEndpoint { commonProtocols.retainAll(clientRequestedApplicationProtocols); if (commonProtocols.size() > 0) { String[] commonProtocolsArray = commonProtocols.toArray(new String[0]); -JreCompat.getInstance().setApplicationProtocols(sslParameters, commonProtocolsArray); +sslParameters.setApplicationProtocols(commonProtocolsArray); } } switch (sslHostConfig.getCertificateVerification()) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: ALPN support will always be available with TLS on Java 11+
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 e5f3408 ALPN support will always be available with TLS on Java 11+ e5f3408 is described below commit e5f340843f746443f4b9b299822101c632473aab Author: Mark Thomas AuthorDate: Wed Jul 28 13:25:13 2021 +0100 ALPN support will always be available with TLS on Java 11+ --- .../apache/coyote/http11/AbstractHttp11Protocol.java | 3 ++- .../org/apache/tomcat/util/net/AbstractEndpoint.java | 10 -- .../apache/tomcat/util/net/AbstractJsseEndpoint.java | 20 java/org/apache/tomcat/util/net/AprEndpoint.java | 10 -- .../apache/tomcat/util/net/SSLImplementation.java| 2 -- .../tomcat/util/net/jsse/JSSEImplementation.java | 6 -- .../util/net/openssl/OpenSSLImplementation.java | 6 -- 7 files changed, 2 insertions(+), 55 deletions(-) diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java index abcec73..1051266 100644 --- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java +++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java @@ -518,7 +518,8 @@ public abstract class AbstractHttp11Protocol extends AbstractProtocol { // ALPN String alpnName = upgradeProtocol.getAlpnName(); if (alpnName != null && alpnName.length() > 0) { -if (getEndpoint().isAlpnSupported()) { +// ALPN is only available with TLS +if (getEndpoint().isSSLEnabled()) { negotiatedProtocols.put(alpnName, upgradeProtocol); getEndpoint().addNegotiatedProtocol(alpnName); getLog().info(sm.getString("abstractHttp11Protocol.alpnConfigured", diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java b/java/org/apache/tomcat/util/net/AbstractEndpoint.java index 437e1da..2938135 100644 --- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java +++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java @@ -678,16 +678,6 @@ public abstract class AbstractEndpoint { public boolean isSSLEnabled() { return SSLEnabled; } public void setSSLEnabled(boolean SSLEnabled) { this.SSLEnabled = SSLEnabled; } -/** - * Identifies if the endpoint supports ALPN. Note that a return value of - * true implies that {@link #isSSLEnabled()} will also return - * true. - * - * @return true if the endpoint supports ALPN in its current - * configuration, otherwise false. - */ -public abstract boolean isAlpnSupported(); - private int minSpareThreads = 10; public void setMinSpareThreads(int minSpareThreads) { this.minSpareThreads = minSpareThreads; diff --git a/java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java b/java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java index 620c279..b28f1e2 100644 --- a/java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java +++ b/java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java @@ -190,26 +190,6 @@ public abstract class AbstractJsseEndpoint extends AbstractEndpoint { @Override -public boolean isAlpnSupported() { -// ALPN requires TLS so if TLS is not enabled, ALPN cannot be supported -if (!isSSLEnabled()) { -return false; -} - -// Depends on the SSLImplementation. -SSLImplementation sslImplementation; -try { -sslImplementation = SSLImplementation.getInstance(getSslImplementationName()); -} catch (ClassNotFoundException e) { -// Ignore the exception. It will be logged when trying to start the -// end point. -return false; -} -return sslImplementation.isAlpnSupported(); -} - - -@Override public void unbind() throws Exception { for (SSLHostConfig sslHostConfig : sslHostConfigs.values()) { for (SSLHostConfigCertificate certificate : sslHostConfig.getCertificates()) { diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 3682e55..bf24e6b 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -493,16 +493,6 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB } - -@Override -public boolean isAlpnSupported() { -// The APR/native connector always supports ALPN if TLS is in use -// because OpenSSL supports ALPN. Therefore, this is equivalent to -// testing of SSL is enabled. -return isSSLEnabled(); -} - - /** * Start the APR endpoint, creating acceptor, poller and sendfile threads. */ diff --git a/java/org/apache/tomcat/util/net/SSLImplementation.java
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 21a6cac Remove use of JreCompat as it is not required with Java 11+ 21a6cac is described below commit 21a6cac161e8f6097d119a41611793ea022c9e09 Author: Mark Thomas AuthorDate: Wed Jul 28 13:35:27 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- .../catalina/loader/WebappClassLoaderBase.java | 49 +++--- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java b/java/org/apache/catalina/loader/WebappClassLoaderBase.java index 3b63625..b082861 100644 --- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java +++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java @@ -26,6 +26,7 @@ import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.IllegalClassFormatException; import java.lang.ref.Reference; import java.lang.reflect.Field; +import java.lang.reflect.InaccessibleObjectException; import java.lang.reflect.Method; import java.net.URI; import java.net.URISyntaxException; @@ -2054,19 +2055,14 @@ public abstract class WebappClassLoaderBase extends URLClassLoader } } } +} catch (InaccessibleObjectException e) { +// Must be running on without the necessary command line options. +log.warn(sm.getString("webappClassLoader.addExportsThreadLocal", this.getClass().getModule().getName())); } catch (Throwable t) { -JreCompat jreCompat = JreCompat.getInstance(); -if (jreCompat.isInstanceOfInaccessibleObjectException(t)) { -// Must be running on Java 9 without the necessary command line -// options. -String currentModule = JreCompat.getInstance().getModuleName(this.getClass()); - log.warn(sm.getString("webappClassLoader.addExportsThreadLocal", currentModule)); -} else { -ExceptionUtils.handleThrowable(t); -log.warn(sm.getString( -"webappClassLoader.checkThreadLocalsForLeaksFail", -getContextName()), t); -} +ExceptionUtils.handleThrowable(t); +log.warn(sm.getString( +"webappClassLoader.checkThreadLocalsForLeaksFail", +getContextName()), t); } } @@ -2317,17 +2313,9 @@ public abstract class WebappClassLoaderBase extends URLClassLoader IllegalAccessException e) { log.warn(sm.getString("webappClassLoader.clearRmiFail", getContextName()), e); -} catch (Exception e) { -JreCompat jreCompat = JreCompat.getInstance(); -if (jreCompat.isInstanceOfInaccessibleObjectException(e)) { -// Must be running on Java 9 without the necessary command line -// options. -String currentModule = JreCompat.getInstance().getModuleName(this.getClass()); -log.warn(sm.getString("webappClassLoader.addExportsRmi", currentModule)); -} else { -// Re-throw all other exceptions -throw e; -} +} catch (InaccessibleObjectException e) { +// Must be running on without the necessary command line options. +log.warn(sm.getString("webappClassLoader.addExportsRmi", this.getClass().getModule().getName())); } } @@ -2340,18 +2328,9 @@ public abstract class WebappClassLoaderBase extends URLClassLoader } catch (ReflectiveOperationException | SecurityException | ClassCastException e) { log.warn(sm.getString( "webappClassLoader.clearObjectStreamClassCachesFail", getContextName()), e); -} catch (Exception e) { -JreCompat jreCompat = JreCompat.getInstance(); -if (jreCompat.isInstanceOfInaccessibleObjectException(e)) { -// Must be running on Java 9 without the necessary command line -// options. -String currentModule = JreCompat.getInstance().getModuleName(this.getClass()); -log.warn(sm.getString("webappClassLoader.addExportsJavaIo", currentModule)); -return; -} else { -// Re-throw all other exceptions -throw e; -} +} catch (InaccessibleObjectException e) { +// Must be running on without the necessary command line options. +log.warn(sm.getString("webappClassLoader.addExportsJavaIo", this.getClass().getModule().getName())); } } - To unsubscri
[tomcat] branch main updated: This should have been private (can't change public API of spec)
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 15eedf0 This should have been private (can't change public API of spec) 15eedf0 is described below commit 15eedf022c8df1e7d4c6a989cdabfab966638eaf Author: Mark Thomas AuthorDate: Wed Jul 28 13:42:53 2021 +0100 This should have been private (can't change public API of spec) --- java/jakarta/el/ImportHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/jakarta/el/ImportHandler.java b/java/jakarta/el/ImportHandler.java index 899da78..7e21719 100644 --- a/java/jakarta/el/ImportHandler.java +++ b/java/jakarta/el/ImportHandler.java @@ -496,7 +496,7 @@ public class ImportHandler { } -public static boolean isExported(Class type) { +private static boolean isExported(Class type) { String packageName = type.getPackage().getName(); Module module = type.getModule(); return module.isExported(packageName); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 46cb8c3 Remove use of JreCompat as it is not required with Java 11+ 46cb8c3 is described below commit 46cb8c3b407a7628613a4a1f5fed5a0297122c8a Author: Mark Thomas AuthorDate: Wed Jul 28 13:43:47 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- java/org/apache/tomcat/websocket/server/WsSci.java | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/java/org/apache/tomcat/websocket/server/WsSci.java b/java/org/apache/tomcat/websocket/server/WsSci.java index 007cac6..8b07ce3 100644 --- a/java/org/apache/tomcat/websocket/server/WsSci.java +++ b/java/org/apache/tomcat/websocket/server/WsSci.java @@ -31,8 +31,6 @@ import jakarta.websocket.server.ServerApplicationConfig; import jakarta.websocket.server.ServerEndpoint; import jakarta.websocket.server.ServerEndpointConfig; -import org.apache.tomcat.util.compat.JreCompat; - /** * Registers an interest in any class that is annotated with * {@link ServerEndpoint} so that Endpoint can be published via the WebSocket @@ -62,12 +60,11 @@ public class WsSci implements ServletContainerInitializer { String wsPackage = ContainerProvider.class.getName(); wsPackage = wsPackage.substring(0, wsPackage.lastIndexOf('.') + 1); for (Class clazz : clazzes) { -JreCompat jreCompat = JreCompat.getInstance(); int modifiers = clazz.getModifiers(); if (!Modifier.isPublic(modifiers) || Modifier.isAbstract(modifiers) || Modifier.isInterface(modifiers) || -!jreCompat.isExported(clazz)) { +isExported(clazz)) { // Non-public, abstract, interface or not in an exported // package (Java 9+) - skip it. continue; @@ -131,6 +128,13 @@ public class WsSci implements ServletContainerInitializer { } +private static boolean isExported(Class type) { +String packageName = type.getPackage().getName(); +Module module = type.getModule(); +return module.isExported(packageName); +} + + static WsServerContainer init(ServletContext servletContext, boolean initBySciMechanism) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 197a0b7 Remove use of JreCompat as it is not required with Java 11+ 197a0b7 is described below commit 197a0b7bcc8c00e63d29689158b287e77a46aa49 Author: Mark Thomas AuthorDate: Wed Jul 28 13:57:19 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- .../apache/tomcat/util/buf/ByteBufferUtils.java| 42 +++--- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/java/org/apache/tomcat/util/buf/ByteBufferUtils.java b/java/org/apache/tomcat/util/buf/ByteBufferUtils.java index f69c7b3..de7d0e7 100644 --- a/java/org/apache/tomcat/util/buf/ByteBufferUtils.java +++ b/java/org/apache/tomcat/util/buf/ByteBufferUtils.java @@ -23,7 +23,6 @@ import java.nio.ByteBuffer; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; -import org.apache.tomcat.util.compat.JreCompat; import org.apache.tomcat.util.res.StringManager; public class ByteBufferUtils { @@ -42,34 +41,19 @@ public class ByteBufferUtils { Method cleanMethodLocal = null; Object unsafeLocal = null; Method invokeCleanerMethodLocal = null; -if (JreCompat.isJre9Available()) { -try { -Class clazz = Class.forName("sun.misc.Unsafe"); -Field theUnsafe = clazz.getDeclaredField("theUnsafe"); -theUnsafe.setAccessible(true); -unsafeLocal = theUnsafe.get(null); -invokeCleanerMethodLocal = clazz.getMethod("invokeCleaner", ByteBuffer.class); -invokeCleanerMethodLocal.invoke(unsafeLocal, tempBuffer); -} catch (IllegalAccessException | IllegalArgumentException -| InvocationTargetException | NoSuchMethodException | SecurityException -| ClassNotFoundException | NoSuchFieldException e) { -log.warn(sm.getString("byteBufferUtils.cleaner"), e); -unsafeLocal = null; -invokeCleanerMethodLocal = null; -} -} else { -try { -cleanerMethodLocal = tempBuffer.getClass().getMethod("cleaner"); -cleanerMethodLocal.setAccessible(true); -Object cleanerObject = cleanerMethodLocal.invoke(tempBuffer); -cleanMethodLocal = cleanerObject.getClass().getMethod("clean"); -cleanMethodLocal.invoke(cleanerObject); -} catch (NoSuchMethodException | SecurityException | IllegalAccessException | -IllegalArgumentException | InvocationTargetException e) { -log.warn(sm.getString("byteBufferUtils.cleaner"), e); -cleanerMethodLocal = null; -cleanMethodLocal = null; -} +try { +Class clazz = Class.forName("sun.misc.Unsafe"); +Field theUnsafe = clazz.getDeclaredField("theUnsafe"); +theUnsafe.setAccessible(true); +unsafeLocal = theUnsafe.get(null); +invokeCleanerMethodLocal = clazz.getMethod("invokeCleaner", ByteBuffer.class); +invokeCleanerMethodLocal.invoke(unsafeLocal, tempBuffer); +} catch (IllegalAccessException | IllegalArgumentException +| InvocationTargetException | NoSuchMethodException | SecurityException +| ClassNotFoundException | NoSuchFieldException e) { +log.warn(sm.getString("byteBufferUtils.cleaner"), e); +unsafeLocal = null; +invokeCleanerMethodLocal = null; } cleanerMethod = cleanerMethodLocal; cleanMethod = cleanMethodLocal; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 5d49fc9 Remove use of JreCompat as it is not required with Java 11+ 5d49fc9 is described below commit 5d49fc9ca4e9ce757687051e92c2a6d053744dc7 Author: Mark Thomas AuthorDate: Wed Jul 28 13:59:33 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- test/jakarta/el/TestImportHandlerStandardPackages.java | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/test/jakarta/el/TestImportHandlerStandardPackages.java b/test/jakarta/el/TestImportHandlerStandardPackages.java index a895030..24d90e8 100644 --- a/test/jakarta/el/TestImportHandlerStandardPackages.java +++ b/test/jakarta/el/TestImportHandlerStandardPackages.java @@ -30,8 +30,6 @@ import java.util.stream.Stream; import org.junit.Assert; import org.junit.Test; -import org.apache.tomcat.util.compat.JreCompat; - public class TestImportHandlerStandardPackages { @Test @@ -54,16 +52,10 @@ public class TestImportHandlerStandardPackages { private void checkPackageClassList(String packageName, Set classNames) throws Exception { if ("java.lang".equals(packageName)) { -// The code below is designed to run on Java 9 so skip this check -// if running on Java 8. The test has previously been run with Java -// 9 (and later) so it is not necessary that this is executed on -// every test run. The intention is that it will catch new classes -// when the tests are run on a newer JRE. +// The intention is that this test will catch new classes when the +// tests are run on a newer JRE. // The latest version of the JRE where this test is known to pass is -// - OpenJDK 14 EA 27 -if (!JreCompat.isJre9Available()) { -return; -} +// - OpenJDK 17 EA 28 getJavaBaseClasses().filter(c -> (c.startsWith("java/lang/"))) .filter(c -> c.lastIndexOf('/') == 9) // Exclude sub-packages .filter(c -> c.endsWith(".class"))// Exclude non-class resources - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove use of JreCompat as it is not required with Java 11+
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 eae15b4 Remove use of JreCompat as it is not required with Java 11+ eae15b4 is described below commit eae15b427288986fd5f735cf185f04ef21d6ee2a Author: Mark Thomas AuthorDate: Wed Jul 28 14:02:28 2021 +0100 Remove use of JreCompat as it is not required with Java 11+ --- .../tomcat/util/scan/TestStandardJarScanner.java | 51 -- 1 file changed, 51 deletions(-) diff --git a/test/org/apache/tomcat/util/scan/TestStandardJarScanner.java b/test/org/apache/tomcat/util/scan/TestStandardJarScanner.java index 15886bb..da9d941 100644 --- a/test/org/apache/tomcat/util/scan/TestStandardJarScanner.java +++ b/test/org/apache/tomcat/util/scan/TestStandardJarScanner.java @@ -24,62 +24,15 @@ import java.net.URLClassLoader; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Assume; import org.junit.Test; import org.apache.tomcat.Jar; import org.apache.tomcat.JarScanType; import org.apache.tomcat.JarScannerCallback; import org.apache.tomcat.unittest.TesterServletContext; -import org.apache.tomcat.util.compat.JreCompat; public class TestStandardJarScanner { -@Test -public void testWebappClassPath() { -Assume.assumeFalse("No URLClassLoader with Java 9", JreCompat.isJre9Available()); - -StandardJarScanner scanner = new StandardJarScanner(); - -scanner.setScanClassPath(true); -// When running the test on Java 9, one or more URLs to jimage files may -// be returned. By setting the scanAllFiles option, a callback will be -// generated for these files which in turn will mean the number of URLs -// and the number of call backs will agree and this test will pass. -// There is a TODO in StandardJarScanner to add 'proper' Java 9 support. -scanner.setScanAllFiles(true); - -LoggingCallback callback = new LoggingCallback(); - -scanner.scan(JarScanType.PLUGGABILITY, new TesterServletContext(), callback); - -List callbacks = callback.getCallbacks(); - -ClassLoader cl = TesterServletContext.class.getClassLoader(); -if (cl instanceof URLClassLoader) { -URL[] urls = ((URLClassLoader) cl).getURLs(); - -int size; -if (urls == null) { -size = 0; -} else { -size = urls.length; -} -// Some JREs (Gump) construct a class path that includes JARs that -// reference additional JARs via the Class-Path attribute of the -// Manifest. These JARs are not returned in ClassLoader.getURLs(). -// Therefore, this test looks for at least as many JARs as there are -// URLs but it can't check for an exact match. -Assert.assertTrue("[" + callbacks.size() + "] callbacks but expected at least [" + -size + "]", callbacks.size() >= size); - -} else { -Assert.fail("Unexpected class loader type: " + cl.getClass().getName()); -} -} - - /** * Tomcat should ignore URLs which do not have a file part and do not use the file scheme. */ @@ -124,9 +77,5 @@ public class TestStandardJarScanner { public void scanWebInfClasses() throws IOException { callbacks.add("N/A::WEB-INF/classes::N/A"); } - -public List getCallbacks() { -return callbacks; -} } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Correct error in 335bed06.
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 11079b6 Correct error in 335bed06. 11079b6 is described below commit 11079b6b97f3bd1d4ebea7359f8d9b118c1d65b5 Author: Mark Thomas AuthorDate: Wed Jul 28 15:06:38 2021 +0100 Correct error in 335bed06. --- java/jakarta/el/StaticFieldELResolver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/jakarta/el/StaticFieldELResolver.java b/java/jakarta/el/StaticFieldELResolver.java index 84cb871..4da5c8f 100644 --- a/java/jakarta/el/StaticFieldELResolver.java +++ b/java/jakarta/el/StaticFieldELResolver.java @@ -158,7 +158,7 @@ public class StaticFieldELResolver extends ELResolver { int modifiers = field.getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers) && -field.canAccess(field)) { +field.canAccess(null)) { return field.getType(); } } catch (IllegalArgumentException | NoSuchFieldException | - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Fix failing tests. JreCompat caught IAE for canAccess() so do the same
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 d26f48d Fix failing tests. JreCompat caught IAE for canAccess() so do the same d26f48d is described below commit d26f48db6c18c786158514536b044bef4d05fa0a Author: Mark Thomas AuthorDate: Wed Jul 28 15:18:27 2021 +0100 Fix failing tests. JreCompat caught IAE for canAccess() so do the same --- java/jakarta/el/ELProcessor.java | 6 +++--- java/jakarta/el/StaticFieldELResolver.java | 4 ++-- java/jakarta/el/Util.java | 14 -- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/java/jakarta/el/ELProcessor.java b/java/jakarta/el/ELProcessor.java index 61d8a2a..107bd23 100644 --- a/java/jakarta/el/ELProcessor.java +++ b/java/jakarta/el/ELProcessor.java @@ -118,7 +118,7 @@ public class ELProcessor { if (!Modifier.isStatic(method.getModifiers())) { continue; } -if (!method.canAccess(null)) { +if (!Util.canAccess(null, method)) { continue; } if (method.getName().equals(sig.getName())) { @@ -191,8 +191,8 @@ public class ELProcessor { int modifiers = method.getModifiers(); -// Check for static, public method and module access for Java 9+ -if (!Modifier.isStatic(modifiers) || !method.canAccess(null)) { +// Check for static, public method and module access +if (!Modifier.isStatic(modifiers) || !Util.canAccess(null, method)) { throw new NoSuchMethodException(Util.message(context, "elProcessor.defineFunctionInvalidMethod", method.getName(), method.getDeclaringClass().getName())); diff --git a/java/jakarta/el/StaticFieldELResolver.java b/java/jakarta/el/StaticFieldELResolver.java index 4da5c8f..6722c7a 100644 --- a/java/jakarta/el/StaticFieldELResolver.java +++ b/java/jakarta/el/StaticFieldELResolver.java @@ -45,7 +45,7 @@ public class StaticFieldELResolver extends ELResolver { int modifiers = field.getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers) && -field.canAccess(null)) { +Util.canAccess(null, field)) { return field.get(null); } } catch (IllegalArgumentException | IllegalAccessException | @@ -158,7 +158,7 @@ public class StaticFieldELResolver extends ELResolver { int modifiers = field.getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers) && -field.canAccess(null)) { +Util.canAccess(null, field)) { return field.getType(); } } catch (IllegalArgumentException | NoSuchFieldException | diff --git a/java/jakarta/el/Util.java b/java/jakarta/el/Util.java index 3bfd267..880c1db 100644 --- a/java/jakarta/el/Util.java +++ b/java/jakarta/el/Util.java @@ -17,6 +17,7 @@ package jakarta.el; import java.lang.ref.WeakReference; +import java.lang.reflect.AccessibleObject; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Method; @@ -547,7 +548,7 @@ class Util { // If base is non-null, method may be static or non-static if (m == null || (Modifier.isPublic(type.getModifiers()) && -(m.canAccess(base) || base != null && m.canAccess(null { +(canAccess(base, m) || base != null && canAccess(null, m { return m; } Class[] interfaces = type.getInterfaces(); @@ -602,7 +603,7 @@ class Util { Constructor constructor = wrapper.unWrap(); -if (!Modifier.isPublic(clazz.getModifiers()) || !constructor.canAccess(null)) { +if (!Modifier.isPublic(clazz.getModifiers()) || !canAccess(null, constructor)) { throw new MethodNotFoundException(message( null, "util.method.notfound", clazz, methodName, paramString(paramTypes))); @@ -612,6 +613,15 @@ class Util { } +static boolean canAccess(Object base, AccessibleObject accessibleObject) { +try { +return accessibleObject.canAccess(base); +} catch (IllegalArgumentException iae) { +return false; +} +} + + static Object[] buildParameters(Class[] parameterTypes, boolean isVarArgs,Object[] params) { ExpressionFactory factory = getExpressionFactory(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional comma
[tomcat] branch main updated: Remove strings from deleted classes
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 b758f5c Remove strings from deleted classes b758f5c is described below commit b758f5cb1475f9d3ed093327d4fe018498e8a6bb Author: Mark Thomas AuthorDate: Wed Jul 28 15:22:12 2021 +0100 Remove strings from deleted classes --- java/org/apache/tomcat/util/compat/LocalStrings.properties | 3 --- java/org/apache/tomcat/util/compat/LocalStrings_fr.properties| 3 --- java/org/apache/tomcat/util/compat/LocalStrings_ja.properties| 3 --- java/org/apache/tomcat/util/compat/LocalStrings_ko.properties| 3 --- java/org/apache/tomcat/util/compat/LocalStrings_zh_CN.properties | 1 - 5 files changed, 13 deletions(-) diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties b/java/org/apache/tomcat/util/compat/LocalStrings.properties index 4286723..b931c34 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties @@ -13,9 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -jre9Compat.javaPre9=Class not found so assuming code is running on a pre-Java 9 JVM -jre9Compat.unexpected=Failed to create references to Java 9 classes and methods - jre16Compat.javaPre16=Class not found so assuming code is running on a pre-Java 16 JVM jre16Compat.unexpected=Failed to create references to Java 16 classes and methods diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties b/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties index e10efa4..3dca114 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties @@ -16,9 +16,6 @@ jre16Compat.javaPre16=Le code est considéré être exécuté sur une JVM antérieure à Java 16 car la classe n'a pas été trouvée jre16Compat.unexpected=Impossible de créer les références vers les classes et méthodes de Java 16 -jre9Compat.javaPre9=Le code est considéré être exécuté sur une JVM antérieure à Java 9 car la classe n'a pas été trouvée -jre9Compat.unexpected=Impossible de créer les références vers les classes et méthodes de Java 9 - jreCompat.noApplicationProtocol=Le Java Runtime utilisé ne supporte pas SSLEngine.getApplicationProtocol(). Il faut Java 9 pour utiliser cette option. jreCompat.noApplicationProtocols=L'environnement Java ne supporte pas SSLParameters.setApplicationProtocols(), cette fonctionnalité demande Java 9 jreCompat.noUnixDomainSocket=L'environnement Java ne supporte pas les sockets de domaine de Unix, cette fonctionnalité demande Java 16 diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties b/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties index adda934..2da703c 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties @@ -16,9 +16,6 @@ jre16Compat.javaPre16=クラスが見つからないため、コードがJava 16より前のJVMで実行されていると仮定します jre16Compat.unexpected=Java16クラスおよびメソッドへの参照の作成に失敗しました -jre9Compat.javaPre9=クラスが見つからないため Java 9 以前の JVM 上でコードが実行されていると仮定します -jre9Compat.unexpected=Java9 クラスやメソッドへの参照の生成に失敗しました - jreCompat.noApplicationProtocol=Java 実行環境が SSLEngine.getApplicationProtocol() に対応していません。Java 9 以降で実行する必要があります。 jreCompat.noApplicationProtocols=Java 実行環境はSSLParameters.setApplicationProtocols()をサポートしていません。 この機能を使用するには、Java 9以降を使用する必要があります。 jreCompat.noUnixDomainSocket=JavaランタイムはUnixドメインソケットをサポートしていません。 この機能を使用するには、Java16を使用する必要があります。 diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_ko.properties b/java/org/apache/tomcat/util/compat/LocalStrings_ko.properties index 00acd8f..77a0c79 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings_ko.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings_ko.properties @@ -16,9 +16,6 @@ jre16Compat.javaPre16=클래스가 발견되지 않습니다. 자바 16 이전의 JVM에서 실행 중인 것으로 보입니다. jre16Compat.unexpected=자바 16 클래스들과 메소드들을 참조할 수 없습니다. -jre9Compat.javaPre9=Java 9 클래스가 발견되지 않습니다. Java 9 이전 버전에서 동작하고 있는 것으로 보입니다. -jre9Compat.unexpected=Java 9 클래스들과 메소드들을 참조할 수 없습니다. - jreCompat.noApplicationProtocol=자바 런타임이 SSLEngine.getApplicationProtocol()을 지원하지 않습니다. 이 기능을 사용하려면 Java 9를 사용해야 합니다. jreCompat.noApplicationProtocols=자바 런타임이 SSLParameters.setApplicationProtocols()을 지원하지 않습니다. 이 기능을 사용하려면 Java 9를 사용해야 합니다. jreCompat.noUnixDomainSocket=자바 런타임이 Unix 도메인 소켓을 지원하지 않습니다. 이 기능을 사용하려면 자바 16을 사용해야 합니다. diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_zh_CN.properties b/java/org/apache/tomcat/util/compat/LocalStrings_zh_CN.properties index c82dcbf..68d8f56 100644 --- a/java/org/apache/tomcat/util/compat/LocalStrings_zh_CN.properties +++ b/java/org/apache/tomcat/util/compat/LocalStrings_zh_CN
[tomcat] branch main updated: Remove unnecessary code
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 bccc5ae Remove unnecessary code bccc5ae is described below commit bccc5aebd7ceb0894fbe79d0ba0bcee99e8a1a31 Author: Mark Thomas AuthorDate: Wed Jul 28 15:19:10 2021 +0100 Remove unnecessary code --- java/jakarta/el/StaticFieldELResolver.java | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/java/jakarta/el/StaticFieldELResolver.java b/java/jakarta/el/StaticFieldELResolver.java index 6722c7a..e5e950b 100644 --- a/java/jakarta/el/StaticFieldELResolver.java +++ b/java/jakarta/el/StaticFieldELResolver.java @@ -115,10 +115,7 @@ public class StaticFieldELResolver extends ELResolver { // Static method so base should be null Method match = Util.findMethod(clazz, null, methodName, paramTypes, params); -// Note: On Java 9 and above, the isStatic check becomes -// unnecessary because the canAccess() call in Util.findMethod() -// effectively performs the same check -if (match == null || !Modifier.isStatic(match.getModifiers())) { +if (match == null) { throw new MethodNotFoundException(Util.message(context, "staticFieldELResolver.methodNotFound", methodName, clazz.getName())); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Update comments
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 2d49e82 Update comments 2d49e82 is described below commit 2d49e820b93d28695d760fda66c1affa396f1055 Author: Mark Thomas AuthorDate: Wed Jul 28 15:22:32 2021 +0100 Update comments --- java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java | 3 +-- java/org/apache/tomcat/util/compat/JreCompat.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java index 0adcaba..dce3cfe 100644 --- a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java +++ b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java @@ -163,8 +163,7 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { * * https://bugs.openjdk.java.net/browse/JDK-8163449 * - * Java 9 onwards disables caching for JAR URLConnections - * Java 8 and earlier disables caching for all URLConnections + * Disable caching for JAR URLConnections */ // Set the default URL caching policy to not to cache diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java b/java/org/apache/tomcat/util/compat/JreCompat.java index 6657973..e31e0a4 100644 --- a/java/org/apache/tomcat/util/compat/JreCompat.java +++ b/java/org/apache/tomcat/util/compat/JreCompat.java @@ -24,7 +24,7 @@ import org.apache.tomcat.util.res.StringManager; /** * This is the base implementation class for JRE compatibility and provides an - * implementation based on Java 8. Sub-classes may extend this class and provide + * implementation based on Java 11. Sub-classes may extend this class and provide * alternative implementations for later JRE versions */ public class JreCompat { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Documentation updates for Java 8 -> 11
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 9adb898 Documentation updates for Java 8 -> 11 9adb898 is described below commit 9adb89886cb8db3d9969173f9c3dae687b32694e Author: Mark Thomas AuthorDate: Wed Jul 28 15:31:51 2021 +0100 Documentation updates for Java 8 -> 11 --- webapps/docs/config/http.xml| 6 -- webapps/docs/logging.xml| 4 ++-- webapps/docs/monitoring.xml | 6 +++--- webapps/docs/windows-auth-howto.xml | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml index 77c18e1..6d178b2 100644 --- a/webapps/docs/config/http.xml +++ b/webapps/docs/config/http.xml @@ -1124,12 +1124,6 @@ ]]> - Because Java 8's TLS implementation does not support ALPN (which is - required for HTTP/2 over TLS), you must be using an OpenSSL based TLS - implementation to enable HTTP/2 support. See the - sslImplementationName attribute of the - Connector. - Additional configuration attributes are available. See the HTTP/2 Upgrade Protocol documentation for details. diff --git a/webapps/docs/logging.xml b/webapps/docs/logging.xml index c8423cb..8659b14 100644 --- a/webapps/docs/logging.xml +++ b/webapps/docs/logging.xml @@ -398,8 +398,8 @@ java.util.logging.ConsoleHandler.formatter = java.util.logging.OneLineFormatter] org.apache.juli package. -Oracle Java 8 Javadoc for the - https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html";>java.util.logging +Oracle Java 11 Javadoc for the + https://docs.oracle.com/en/java/javase/11/docs/api/java.logging/java/util/logging/package-summary.html";>java.util.logging package. diff --git a/webapps/docs/monitoring.xml b/webapps/docs/monitoring.xml index b8698b2..a9ab3a9 100644 --- a/webapps/docs/monitoring.xml +++ b/webapps/docs/monitoring.xml @@ -47,11 +47,11 @@ to monitor it locally, using the same user that Tomcat runs with. The Oracle website includes the list of options and how to configure -JMX Remote on Java 8: -https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html";> +JMX Remote on Java 11: +https://docs.oracle.com/en/java/javase/11/management/monitoring-and-management-using-jmx-technology.html";> http://docs.oracle.com/javase/6/docs/technotes/guides/management/agent.html. -The following is a quick configuration guide for Java 8: +The following is a quick configuration guide for Java 11: Add the following parameters to setenv.bat script of your Tomcat (see RUNNING.txt for details). Note: This syntax is for Microsoft Windows. The command has diff --git a/webapps/docs/windows-auth-howto.xml b/webapps/docs/windows-auth-howto.xml index 200eb18..1798141 100644 --- a/webapps/docs/windows-auth-howto.xml +++ b/webapps/docs/windows-auth-howto.xml @@ -122,7 +122,7 @@ policy had to be relaxed. This is not recommended for production environments. - These steps assume that Tomcat and a Java 8 JDK/JRE have already been + These steps assume that Tomcat and a Java 11 JDK/JRE have already been installed and configured and that Tomcat is running as the tc01@dev.local user. The steps to configure the Tomcat instance for Windows authentication are as follows: - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: No need for reflection with Java 11
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 b14e9ff No need for reflection with Java 11 b14e9ff is described below commit b14e9ff3c514078b6e9be29cae8084cd93b56c55 Author: Mark Thomas AuthorDate: Wed Jul 28 15:27:28 2021 +0100 No need for reflection with Java 11 --- .../el/TestImportHandlerStandardPackages.java | 27 +++--- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/test/jakarta/el/TestImportHandlerStandardPackages.java b/test/jakarta/el/TestImportHandlerStandardPackages.java index 24d90e8..5a8ca7f 100644 --- a/test/jakarta/el/TestImportHandlerStandardPackages.java +++ b/test/jakarta/el/TestImportHandlerStandardPackages.java @@ -17,15 +17,14 @@ package jakarta.el; import java.io.File; +import java.lang.module.ModuleFinder; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.net.URI; import java.net.URL; import java.util.Enumeration; import java.util.Map; -import java.util.Optional; import java.util.Set; -import java.util.stream.Stream; import org.junit.Assert; import org.junit.Test; @@ -56,7 +55,8 @@ public class TestImportHandlerStandardPackages { // tests are run on a newer JRE. // The latest version of the JRE where this test is known to pass is // - OpenJDK 17 EA 28 -getJavaBaseClasses().filter(c -> (c.startsWith("java/lang/"))) +ModuleFinder.ofSystem().find("java.base").get().open().list() +.filter(c -> (c.startsWith("java/lang/"))) .filter(c -> c.lastIndexOf('/') == 9) // Exclude sub-packages .filter(c -> c.endsWith(".class"))// Exclude non-class resources .map(c -> c.substring(10, c.length() - 6))// Extract class name @@ -129,25 +129,4 @@ public class TestImportHandlerStandardPackages { } } } - - -private static Stream getJavaBaseClasses() throws Exception { -// While this code is only used on Java 9 and later, it needs to compile -// with Java 8 so use reflection for now. -Class clazzModuleFinder = Class.forName("java.lang.module.ModuleFinder"); -Class clazzModuleReference = Class.forName("java.lang.module.ModuleReference"); -Class clazzModuleReader = Class.forName("java.lang.module.ModuleReader"); - -// Returns ModuleFinder -Object mf = clazzModuleFinder.getMethod("ofSystem").invoke(null); -// Returns ModuleReference -Object mRef = ((Optional) clazzModuleFinder.getMethod( -"find", String.class).invoke(mf, "java.base")).get(); -// Returns ModuleReader -Object mr = clazzModuleReference.getMethod("open").invoke(mRef); -// Returns the contents of the module -@SuppressWarnings("unchecked") -Stream result = (Stream) clazzModuleReader.getMethod("list").invoke(mr); -return result; -} } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Simplify tests - no need to check Java 7 behaviour
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 077a416 Simplify tests - no need to check Java 7 behaviour 077a416 is described below commit 077a41648a321e85c6e60184e4d7a9e87a61d186 Author: Mark Thomas AuthorDate: Wed Jul 28 15:44:19 2021 +0100 Simplify tests - no need to check Java 7 behaviour --- test/org/apache/tomcat/util/buf/TestUtf8.java | 395 +- 1 file changed, 69 insertions(+), 326 deletions(-) diff --git a/test/org/apache/tomcat/util/buf/TestUtf8.java b/test/org/apache/tomcat/util/buf/TestUtf8.java index ef097d7..71e8ef3 100644 --- a/test/org/apache/tomcat/util/buf/TestUtf8.java +++ b/test/org/apache/tomcat/util/buf/TestUtf8.java @@ -36,42 +36,12 @@ import org.junit.Test; */ public class TestUtf8 { -// Indicates that at invalid sequence is detected one character later than -// the earliest possible moment -private static final int ERROR_POS_PLUS1 = 1; -// Indicates that at invalid sequence is detected two characters later than -// the earliest possible moment -private static final int ERROR_POS_PLUS2 = 2; -// Indicates that at invalid sequence is detected four characters later -// than the earliest possible moment -private static final int ERROR_POS_PLUS4 = 4; -// Indicates that the trailing valid byte is included in replacement of the -// previous error -private static final int REPLACE_SWALLOWS_TRAILER = 8; -// Indicates that one replacement character is missing -private static final int REPLACE_MISSING1 = 16; -// Indicates that two replacement characters are missing -private static final int REPLACE_MISSING2 = 32; -// Indicates that three replacement characters are missing -private static final int REPLACE_MISSING4 = 64; - public static final List TEST_CASES; -private static int workAroundCount = 0; - static { // All known issues have been fixed in Java 8 // https://bugs.openjdk.java.net/browse/JDK-8039751 -// Base assumption in Java 7 -int javaVersion = 7; -try { -Class.forName("java.util.stream.Collector"); -javaVersion = 8; -} catch (Exception e) { -// Ignore -} -Utf8TestCase testCase = null; ArrayList testCases = new ArrayList<>(); testCases.add(new Utf8TestCase( @@ -99,88 +69,46 @@ public class TestUtf8 { new int[] {0xF0, 0x90, 0x90, 0x80}, -1, "\uD801\uDC00")); -// Java 7 JVM decoder does not report error until all 4 bytes are -// available -testCase = new Utf8TestCase( +testCases.add(new Utf8TestCase( "Invalid code point - out of range", new int[] {0x41, 0xF4, 0x90, 0x80, 0x80, 0x41}, 2, -"A\uFFFD\uFFFD\uFFFD\uFFFDA"); -if (javaVersion < 8) { -testCase.addForJvm(ERROR_POS_PLUS2); -} -testCases.add(testCase); - -// Java 7 JVM decoder does not report error until all 2 bytes are available -testCase = new Utf8TestCase( +"A\uFFFD\uFFFD\uFFFD\uFFFDA")); +testCases.add(new Utf8TestCase( "Valid sequence padded from one byte to two", new int[] {0x41, 0xC0, 0xC1, 0x41}, 1, -"A\uFFFD\uFFFDA"); -if (javaVersion < 8) { -testCase.addForJvm(ERROR_POS_PLUS1); -} -testCases.add(testCase); - -// Java 7 JVM decoder does not report error until all 3 bytes are available -testCase = new Utf8TestCase( +"A\uFFFD\uFFFDA")); +testCases.add(new Utf8TestCase( "Valid sequence padded from one byte to three", new int[] {0x41, 0xE0, 0x80, 0xC1, 0x41}, 2, -"A\uFFFD\uFFFD\uFFFDA"); -if (javaVersion < 8) { -testCase.addForJvm(ERROR_POS_PLUS1); -} -testCases.add(testCase); - -// Java 7 JVM decoder does not report error until all 4 bytes are -// available -testCase = new Utf8TestCase( +"A\uFFFD\uFFFD\uFFFDA")); +testCases.add(new Utf8TestCase( "Valid sequence padded from one byte to four", new int[] {0x41, 0xF0, 0x80, 0x80, 0xC1, 0x41}, 2, -"A\uFFFD\uFFFD\uFFFD\uFFFDA"); -if (javaVersion < 8) { -testCase.addForJvm(ERROR_POS_PLUS2); -} -testCases.add(testCase); - +"A\uFFFD\uFFFD\uFFFD\uFFFDA")); testCases.add(new Utf8TestCase( "Invalid one byte ", new int[] {0x41, 0xFF, 0x41}, 1,
[tomcat] branch main updated: Add Java 8 -> Java 11 changes to changelog
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 3d34fcf Add Java 8 -> Java 11 changes to changelog 3d34fcf is described below commit 3d34fcfacdd155b4abf2801404b896a8b63b5a2a Author: Mark Thomas AuthorDate: Wed Jul 28 17:16:50 2021 +0100 Add Java 8 -> Java 11 changes to changelog --- webapps/docs/changelog.xml | 24 1 file changed, 24 insertions(+) diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 5dbb03b..c561f20 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -141,6 +141,14 @@ Expires header when setting adding an HTTP header of CacheControl: private. (markt) + +Refactor JULI's custom LogManager, the +web application class loader implementation, the web resources +implementation, the JreLeakPreventionListener +implementation and the StandardJarScanner implementation to +remove Java 8 specific code now that the minimum Java version has been +increased to 11. (markt) + @@ -185,6 +193,10 @@ Remove NIO workarounds and code that is no longer needed with Java 11. (remm) + +Refactor the endpoints to remove Java 8 specific code now that the +minimum Java version has been increased to 11. (markt) + @@ -198,6 +210,18 @@ This is an implementation of a proposed extension to the Jakarta Expression Language specification. (markt) + +Refactor the EL API and implementation to remove Java 8 specific code +now that the minimum Java version has been increased to 11. (markt) + + + + + + +Refactor the WebSocket implementation to remove Java 8 specific code now +that the minimum Java version has been increased to 11. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove all references to java.endorsed.dirs
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 c9ea1d5 Remove all references to java.endorsed.dirs c9ea1d5 is described below commit c9ea1d5db0b04b0386b79e5cb0a467fb601c860a Author: Mark Thomas AuthorDate: Wed Jul 28 17:28:09 2021 +0100 Remove all references to java.endorsed.dirs --- RELEASE-NOTES| 6 ++--- RUNNING.txt | 6 - bin/catalina.bat | 28 bin/catalina.sh | 28 bin/daemon.sh| 15 - bin/service.bat | 15 + bin/setclasspath.bat | 12 +- bin/setclasspath.sh | 13 +-- bin/tool-wrapper.bat | 22 +-- bin/tool-wrapper.sh | 21 -- java/org/apache/jasper/compiler/AntCompiler.java | 16 -- webapps/docs/changelog.xml | 4 webapps/docs/class-loader-howto.xml | 25 + webapps/docs/jndi-datasource-examples-howto.xml | 14 ++-- 14 files changed, 26 insertions(+), 199 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1a7b622..70e5abf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -92,10 +92,8 @@ You can make additional APIs available to all of your web applications by putting unpacked classes into a "classes" directory (not created by default), or by placing them in JAR files in the "lib" directory. -To override the XML parser implementation or interfaces, use the appropriate -feature for your JVM. For Java <= 8 use the endorsed standards override -feature. The default configuration defines JARs located in "endorsed" as endorsed. -For Java 9+ use the upgradeable modules feature. +To override the XML parser implementation or interfaces, use the upgradeable +modules feature. diff --git a/RUNNING.txt b/RUNNING.txt index a4b2d76..f96d8b9 100644 --- a/RUNNING.txt +++ b/RUNNING.txt @@ -272,12 +272,6 @@ In CATALINA_HOME: * lib - Libraries and classes, as explained below - * endorsed - Libraries that override standard "Endorsed Standards" - libraries provided by JRE. See Classloading documentation - in the User Guide for details. - This is only supported for Java <= 8. - By default this "endorsed" directory is absent. - In the default configuration the JAR libraries and classes both in CATALINA_BASE/lib and in CATALINA_HOME/lib will be added to the common classpath, but the ones in CATALINA_BASE will be added first and thus will diff --git a/bin/catalina.bat b/bin/catalina.bat index 20b06a0..6a322a7 100755 --- a/bin/catalina.bat +++ b/bin/catalina.bat @@ -65,13 +65,6 @@ rem should be used by Tomcat and also by the stop process, rem the version command etc. rem Most options should go into CATALINA_OPTS. rem -rem JAVA_ENDORSED_DIRS (Optional) Lists of of semi-colon separated directories -rem containing some jars in order to allow replacement of APIs -rem created outside of the JCP (i.e. DOM and SAX from W3C). -rem It can also be used to update the XML parser implementation. -rem This is only supported for Java <= 8. -rem Defaults to $CATALINA_HOME/endorsed. -rem rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" rem command is executed. The default is "dt_socket". rem @@ -231,19 +224,6 @@ set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.util=ALL-UNN set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.util.concurrent=ALL-UNNAMED" set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED" -rem Java 9 no longer supports the java.endorsed.dirs -rem system property. Only try to use it if -rem JAVA_ENDORSED_DIRS was explicitly set -rem or CATALINA_HOME/endorsed exists. -set ENDORSED_PROP=ignore.endorsed.dirs -if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar -set ENDORSED_PROP=java.endorsed.dirs -goto doneEndorsed -:noEndorsedVar -if not exist "%CATALINA_HOME%\endorsed" goto doneEndorsed -set ENDORSED_PROP=java.endorsed.dirs -:doneEndorsed - rem - Execute The Requested Command --- echo Using CATALINA_BASE: "%CATALINA_BASE%" @@ -361,17 +341,17 @@ goto setArgs rem Execute Java with the applicable properties if not "%JPDA%" == "" goto doJpd
[tomcat] branch main updated: Remove more Java 9+ references
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 15220d8 Remove more Java 9+ references 15220d8 is described below commit 15220d8df73754dcf45ddbab206cadece4644dcb Author: Mark Thomas AuthorDate: Wed Jul 28 17:46:07 2021 +0100 Remove more Java 9+ references --- bin/service.bat | 6 -- conf/catalina.policy | 9 - java/jakarta/el/ELProcessor.java | 2 +- java/jakarta/el/LocalStrings.properties | 4 ++-- java/org/apache/catalina/core/StandardContext.java | 4 ++-- java/org/apache/catalina/loader/LocalStrings.properties | 6 +++--- .../apache/catalina/loader/WebappClassLoaderBase.java| 4 ++-- java/org/apache/jasper/compiler/Generator.java | 2 +- .../apache/tomcat/util/compat/LocalStrings.properties| 2 -- .../apache/tomcat/util/compat/LocalStrings_cs.properties | 16 .../apache/tomcat/util/compat/LocalStrings_de.properties | 16 .../apache/tomcat/util/compat/LocalStrings_es.properties | 16 .../apache/tomcat/util/compat/LocalStrings_fr.properties | 2 -- .../apache/tomcat/util/compat/LocalStrings_ja.properties | 2 -- .../apache/tomcat/util/compat/LocalStrings_ko.properties | 2 -- .../tomcat/util/compat/LocalStrings_pt_BR.properties | 16 .../tomcat/util/compat/LocalStrings_zh_CN.properties | 4 java/org/apache/tomcat/websocket/server/WsSci.java | 2 +- .../group/interceptors/TestEncryptInterceptor.java | 2 +- test/org/apache/jasper/compiler/TestGenerator.java | 2 +- webapps/docs/class-loader-howto.xml | 4 ++-- webapps/docs/config/context.xml | 13 ++--- webapps/docs/setup.xml | 12 +++- 23 files changed, 29 insertions(+), 119 deletions(-) diff --git a/bin/service.bat b/bin/service.bat index e54a70e..fae7920 100755 --- a/bin/service.bat +++ b/bin/service.bat @@ -113,16 +113,10 @@ if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome goto okJavaHome :gotJdkHome if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome -rem Java 9 has a different directory structure -if exist "%JAVA_HOME%\jre\bin\java.exe" goto preJava9Layout if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome if not "%JRE_HOME%" == "" goto okJavaHome set "JRE_HOME=%JAVA_HOME%" goto okJavaHome -:preJava9Layout -if not "%JRE_HOME%" == "" goto okJavaHome -set "JRE_HOME=%JAVA_HOME%\jre" -goto okJavaHome :noJavaHome echo The JAVA_HOME environment variable is not defined correctly echo This environment variable is needed to run this program diff --git a/conf/catalina.policy b/conf/catalina.policy index 91b7c83..d40cb1c 100644 --- a/conf/catalina.policy +++ b/conf/catalina.policy @@ -50,11 +50,10 @@ grant codeBase "file:${java.home}/lib/ext/-" { permission java.security.AllPermission; }; -// This permission is required when using javac to compile JSPs on Java 9 -// onwards -//grant codeBase "jrt:/jdk.compiler" { -//permission java.security.AllPermission; -//}; +// This permission is required when using javac to compile JSPs +grant codeBase "jrt:/jdk.compiler" { +permission java.security.AllPermission; +}; // == CATALINA CODE PERMISSIONS === diff --git a/java/jakarta/el/ELProcessor.java b/java/jakarta/el/ELProcessor.java index 107bd23..736ca9c 100644 --- a/java/jakarta/el/ELProcessor.java +++ b/java/jakarta/el/ELProcessor.java @@ -111,7 +111,7 @@ public class ELProcessor { function = sig.getName(); } -// Only returns public methods. Java 9+ access is checked below. +// Only returns public methods. Module access is checked below. Method methods[] = clazz.getMethods(); for (Method method : methods) { diff --git a/java/jakarta/el/LocalStrings.properties b/java/jakarta/el/LocalStrings.properties index cead8de..2d3f492 100644 --- a/java/jakarta/el/LocalStrings.properties +++ b/java/jakarta/el/LocalStrings.properties @@ -29,7 +29,7 @@ expressionFactory.readFailed=Failed to read [{0}] importHandler.ambiguousImport=The class [{0}] could not be imported as it conflicts with [{1}] which has already been imported importHandler.ambiguousStaticImport=The static import [{0}] could not be processed as it conflicts with [{1}] which has already been imported importHandler.classNotFound=The class [{0}] could not be imported as it could not be found -importHandler.invalidClass=The class [{0}] must be public, in an exported package (for Java 9+), non-abstract and not an interface +importHandler.invalidClass=The class [{0}] must be public, in an exp
[tomcat] branch main updated: Remove the ExtensionValidator and associated classes
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 f7100b4 Remove the ExtensionValidator and associated classes f7100b4 is described below commit f7100b436c0ab2ef32f44bc03b841e79897cc710 Author: Mark Thomas AuthorDate: Wed Jul 28 17:57:21 2021 +0100 Remove the ExtensionValidator and associated classes --- TOMCAT-NEXT.txt| 9 +- .../apache/catalina/core/LocalStrings.properties | 1 - .../catalina/core/LocalStrings_fr.properties | 1 - .../catalina/core/LocalStrings_ja.properties | 1 - .../catalina/core/LocalStrings_ko.properties | 1 - .../catalina/core/LocalStrings_zh_CN.properties| 1 - java/org/apache/catalina/core/StandardContext.java | 16 - java/org/apache/catalina/core/StandardServer.java | 30 -- java/org/apache/catalina/util/Extension.java | 310 -- .../apache/catalina/util/ExtensionValidator.java | 360 - .../apache/catalina/util/LocalStrings.properties | 5 - .../catalina/util/LocalStrings_cs.properties | 2 - .../catalina/util/LocalStrings_de.properties | 2 - .../catalina/util/LocalStrings_es.properties | 5 - .../catalina/util/LocalStrings_fr.properties | 5 - .../catalina/util/LocalStrings_ja.properties | 5 - .../catalina/util/LocalStrings_ko.properties | 5 - .../catalina/util/LocalStrings_ru.properties | 2 - .../catalina/util/LocalStrings_zh_CN.properties| 5 - .../org/apache/catalina/util/ManifestResource.java | 233 - java/org/apache/jasper/compiler/AntCompiler.java | 19 -- webapps/docs/changelog.xml | 5 +- 22 files changed, 6 insertions(+), 1017 deletions(-) diff --git a/TOMCAT-NEXT.txt b/TOMCAT-NEXT.txt index f5329f6..735f1ba 100644 --- a/TOMCAT-NEXT.txt +++ b/TOMCAT-NEXT.txt @@ -27,14 +27,11 @@ Items carried over from the 9.0.x list: Deferred until 10.1.x: - 1. Remove the ExtensionValidator and associated classes (assuming that the -minimum Java version is Java 9 or later). - - 2. Remove org.apache.tomcat.jni and replace with the minimum necessary to + 1. Remove org.apache.tomcat.jni and replace with the minimum necessary to interface with OpenSSL and clones. We might want to park this one until we see what is available direct from the JRE with project Panama. - 3. Remove APR connector. + 2. Remove APR connector. - 4. Review code forked from Commons projects and consider removing unused code. + 3. Review code forked from Commons projects and consider removing unused code. diff --git a/java/org/apache/catalina/core/LocalStrings.properties b/java/org/apache/catalina/core/LocalStrings.properties index f79faf3..345d197 100644 --- a/java/org/apache/catalina/core/LocalStrings.properties +++ b/java/org/apache/catalina/core/LocalStrings.properties @@ -173,7 +173,6 @@ standardContext.duplicateListener=The listener [{0}] is already configured for t standardContext.errorPage.error=Error page location [{0}] must start with a ''/'' standardContext.errorPage.required=ErrorPage cannot be null standardContext.errorPage.warning=WARNING: Error page location [{0}] must start with a ''/'' in Servlet 2.4 -standardContext.extensionValidationError=Error while attempting to validate required application extensions standardContext.filterFail=One or more Filters failed to start. Full details will be found in the appropriate container log file standardContext.filterMap.either=Filter mapping must specify either a or a standardContext.filterMap.name=Filter mapping specifies an unknown filter name [{0}] diff --git a/java/org/apache/catalina/core/LocalStrings_fr.properties b/java/org/apache/catalina/core/LocalStrings_fr.properties index 0394d08..9c61af5 100644 --- a/java/org/apache/catalina/core/LocalStrings_fr.properties +++ b/java/org/apache/catalina/core/LocalStrings_fr.properties @@ -173,7 +173,6 @@ standardContext.duplicateListener=L''écouteur [{0}] est déjà configuré pour standardContext.errorPage.error=La position de la page d''erreur (ErrorPage) [{0}] doit commencer par un ''/'' standardContext.errorPage.required=La page d'erreur (ErrorPage) ne peut être nulle standardContext.errorPage.warning=WARNING : La position de la page d''erreur (ErrorPage) [{0}] doit commencer par un ''/'' dans l''API Servlet 2.4 -standardContext.extensionValidationError=Erreur lors de la validation des extensions requises par l'application standardContext.filterFail=Un ou plusieurs filtres n'ont pas pu démarrer, les détails sont dans le fichier log du conteneur standardContext.filterMap.either=L'association de filtre (filter mapping) doit indiquer soit une soit une standardContext.filterMap.name=L''association de filtre (filter mapping) indique
[tomcat] branch main updated: Remove Java 5 references
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 b3fea5c Remove Java 5 references b3fea5c is described below commit b3fea5cd61bca53113677425a2c27788c40d5c1a Author: Mark Thomas AuthorDate: Wed Jul 28 21:20:16 2021 +0100 Remove Java 5 references --- java/org/apache/catalina/ha/tcp/ReplicationValve.java | 6 ++ java/org/apache/tomcat/util/net/AprEndpoint.java | 3 +-- java/org/apache/tomcat/util/net/NioEndpoint.java | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/java/org/apache/catalina/ha/tcp/ReplicationValve.java b/java/org/apache/catalina/ha/tcp/ReplicationValve.java index 17ebce0..9060c5b 100644 --- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java +++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java @@ -345,13 +345,11 @@ public class ReplicationValve } finally { // Array must be remove: Current master request send endAccess at recycle. // Don't register this request session again! -if(isCrossContext) { +if (isCrossContext) { if(log.isDebugEnabled()) { log.debug(sm.getString("ReplicationValve.crossContext.remove")); } -// crossContextSessions.remove() only exist at Java 5 -// register ArrayList at a pool -crossContextSessions.set(null); +crossContextSessions.remove(); } } } diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index bf24e6b..2316067 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -77,8 +77,7 @@ import org.apache.tomcat.util.net.openssl.OpenSSLUtil; * Worker threads pool * * - * When switching to Java 5, there's an opportunity to use the virtual - * machine's thread pool. + * TODO: Consider using the virtual machine's thread pool. * * @author Mladen Turk * @author Remy Maucherat diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 4181ba2..9cfcd47 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -70,8 +70,7 @@ import org.apache.tomcat.util.net.jsse.JSSESupport; * Worker threads pool * * - * When switching to Java 5, there's an opportunity to use the virtual - * machine's thread pool. + * TODO: Consider using the virtual machine's thread pool. * * @author Mladen Turk * @author Remy Maucherat - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 10.0.x updated: Remove Java 5 references
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 d9eb601 Remove Java 5 references d9eb601 is described below commit d9eb601985169ba2f260ecaac590d25ce4ef6e80 Author: Mark Thomas AuthorDate: Wed Jul 28 21:20:16 2021 +0100 Remove Java 5 references --- java/org/apache/catalina/ha/tcp/ReplicationValve.java | 6 ++ java/org/apache/tomcat/util/net/AprEndpoint.java | 3 +-- java/org/apache/tomcat/util/net/NioEndpoint.java | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/java/org/apache/catalina/ha/tcp/ReplicationValve.java b/java/org/apache/catalina/ha/tcp/ReplicationValve.java index 17ebce0..9060c5b 100644 --- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java +++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java @@ -345,13 +345,11 @@ public class ReplicationValve } finally { // Array must be remove: Current master request send endAccess at recycle. // Don't register this request session again! -if(isCrossContext) { +if (isCrossContext) { if(log.isDebugEnabled()) { log.debug(sm.getString("ReplicationValve.crossContext.remove")); } -// crossContextSessions.remove() only exist at Java 5 -// register ArrayList at a pool -crossContextSessions.set(null); +crossContextSessions.remove(); } } } diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 3682e55..b523c6c 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -77,8 +77,7 @@ import org.apache.tomcat.util.net.openssl.OpenSSLUtil; * Worker threads pool * * - * When switching to Java 5, there's an opportunity to use the virtual - * machine's thread pool. + * TODO: Consider using the virtual machine's thread pool. * * @author Mladen Turk * @author Remy Maucherat diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 64cdfc6..348c644 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -70,8 +70,7 @@ import org.apache.tomcat.util.net.jsse.JSSESupport; * Worker threads pool * * - * When switching to Java 5, there's an opportunity to use the virtual - * machine's thread pool. + * TODO: Consider using the virtual machine's thread pool. * * @author Mladen Turk * @author Remy Maucherat - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 9.0.x updated: Remove Java 5 references
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 027605b Remove Java 5 references 027605b is described below commit 027605b3c991a0ed24344329a00f597b003d412d Author: Mark Thomas AuthorDate: Wed Jul 28 21:20:16 2021 +0100 Remove Java 5 references --- java/org/apache/catalina/ha/tcp/ReplicationValve.java | 6 ++ java/org/apache/tomcat/util/net/AprEndpoint.java | 3 +-- java/org/apache/tomcat/util/net/NioEndpoint.java | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/java/org/apache/catalina/ha/tcp/ReplicationValve.java b/java/org/apache/catalina/ha/tcp/ReplicationValve.java index 1644c61..4af6bf6 100644 --- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java +++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java @@ -345,13 +345,11 @@ public class ReplicationValve } finally { // Array must be remove: Current master request send endAccess at recycle. // Don't register this request session again! -if(isCrossContext) { +if (isCrossContext) { if(log.isDebugEnabled()) { log.debug(sm.getString("ReplicationValve.crossContext.remove")); } -// crossContextSessions.remove() only exist at Java 5 -// register ArrayList at a pool -crossContextSessions.set(null); +crossContextSessions.remove(); } } } diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index d845630..3c2f68a 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -77,8 +77,7 @@ import org.apache.tomcat.util.net.openssl.OpenSSLUtil; * Worker threads pool * * - * When switching to Java 5, there's an opportunity to use the virtual - * machine's thread pool. + * TODO: Consider using the virtual machine's thread pool. * * @author Mladen Turk * @author Remy Maucherat diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 0f73308..7fedf39 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -70,8 +70,7 @@ import org.apache.tomcat.util.net.jsse.JSSESupport; * Worker threads pool * * - * When switching to Java 5, there's an opportunity to use the virtual - * machine's thread pool. + * TODO: Consider using the virtual machine's thread pool. * * @author Mladen Turk * @author Remy Maucherat - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated: Remove Java 5 references
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 6bc42c1 Remove Java 5 references 6bc42c1 is described below commit 6bc42c17b1920f428fbf71af7e7eb35da526fd37 Author: Mark Thomas AuthorDate: Wed Jul 28 21:20:16 2021 +0100 Remove Java 5 references --- java/org/apache/catalina/ha/tcp/ReplicationValve.java | 6 ++ java/org/apache/tomcat/util/net/AprEndpoint.java | 3 +-- java/org/apache/tomcat/util/net/NioEndpoint.java | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/java/org/apache/catalina/ha/tcp/ReplicationValve.java b/java/org/apache/catalina/ha/tcp/ReplicationValve.java index 95907b4..d141106 100644 --- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java +++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java @@ -345,13 +345,11 @@ public class ReplicationValve } finally { // Array must be remove: Current master request send endAccess at recycle. // Don't register this request session again! -if(isCrossContext) { +if (isCrossContext) { if(log.isDebugEnabled()) { log.debug(sm.getString("ReplicationValve.crossContext.remove")); } -// crossContextSessions.remove() only exist at Java 5 -// register ArrayList at a pool -crossContextSessions.set(null); +crossContextSessions.remove(); } } } diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 34e05ec..413a8ad 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -72,8 +72,7 @@ import org.apache.tomcat.util.net.openssl.OpenSSLUtil; * Worker threads pool * * - * When switching to Java 5, there's an opportunity to use the virtual - * machine's thread pool. + * TODO: Consider using the virtual machine's thread pool. * * @author Mladen Turk * @author Remy Maucherat diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 8500845..4fd9137 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -62,8 +62,7 @@ import org.apache.tomcat.util.net.jsse.JSSESupport; * Worker threads pool * * - * When switching to Java 5, there's an opportunity to use the virtual - * machine's thread pool. + * TODO: Consider using the virtual machine's thread pool. * * @author Mladen Turk * @author Remy Maucherat - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Update references to Java 6
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 6190e7a Update references to Java 6 6190e7a is described below commit 6190e7a8717bd75c1bcce7b956ef700334812ced Author: Mark Thomas AuthorDate: Wed Jul 28 21:27:34 2021 +0100 Update references to Java 6 --- java/org/apache/catalina/filters/RemoteIpFilter.java | 1 - webapps/docs/jasper-howto.xml| 16 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java b/java/org/apache/catalina/filters/RemoteIpFilter.java index e20faee..b674388 100644 --- a/java/org/apache/catalina/filters/RemoteIpFilter.java +++ b/java/org/apache/catalina/filters/RemoteIpFilter.java @@ -794,7 +794,6 @@ public class RemoteIpFilter extends GenericFilter { if (isInternal || (trustedProxies != null && trustedProxies.matcher(request.getRemoteAddr()).matches())) { String remoteIp = null; -// In java 6, proxiesHeaderValue should be declared as a java.util.Deque LinkedList proxiesHeaderValue = new LinkedList<>(); StringBuilder concatRemoteIpHeaderValue = new StringBuilder(); diff --git a/webapps/docs/jasper-howto.xml b/webapps/docs/jasper-howto.xml index 0806be8..782a30a 100644 --- a/webapps/docs/jasper-howto.xml +++ b/webapps/docs/jasper-howto.xml @@ -448,10 +448,18 @@ are automatically compiled as part of the build process. At the jasper task you can use the option addWebXmlMappings for automatic merge the ${webapp.path}/WEB-INF/generated_web.xml with the current web application deployment descriptor at -${webapp.path}/WEB-INF/web.xml. When you want to use Java 6 -features inside your JSP's, add the following javac compiler task attributes: -source="1.6" target="1.6". For live -applications you can also disable debug info with debug="off". +${webapp.path}/WEB-INF/web.xml. + + + +When you want to use a specific version of Java for your JSP's, add the +javac compiler task attributes source and target with +appropriate values. For example, 16 to compile JSPs for Java 16. + + + +For production you may wish to disable debug info with +debug="off". - 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: Update references to Java 6
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 8ffda1f Update references to Java 6 8ffda1f is described below commit 8ffda1f853d88a5498814e94494f76cbfe3684b0 Author: Mark Thomas AuthorDate: Wed Jul 28 21:27:34 2021 +0100 Update references to Java 6 --- java/org/apache/catalina/filters/RemoteIpFilter.java | 1 - webapps/docs/jasper-howto.xml| 16 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java b/java/org/apache/catalina/filters/RemoteIpFilter.java index e20faee..b674388 100644 --- a/java/org/apache/catalina/filters/RemoteIpFilter.java +++ b/java/org/apache/catalina/filters/RemoteIpFilter.java @@ -794,7 +794,6 @@ public class RemoteIpFilter extends GenericFilter { if (isInternal || (trustedProxies != null && trustedProxies.matcher(request.getRemoteAddr()).matches())) { String remoteIp = null; -// In java 6, proxiesHeaderValue should be declared as a java.util.Deque LinkedList proxiesHeaderValue = new LinkedList<>(); StringBuilder concatRemoteIpHeaderValue = new StringBuilder(); diff --git a/webapps/docs/jasper-howto.xml b/webapps/docs/jasper-howto.xml index 0806be8..782a30a 100644 --- a/webapps/docs/jasper-howto.xml +++ b/webapps/docs/jasper-howto.xml @@ -448,10 +448,18 @@ are automatically compiled as part of the build process. At the jasper task you can use the option addWebXmlMappings for automatic merge the ${webapp.path}/WEB-INF/generated_web.xml with the current web application deployment descriptor at -${webapp.path}/WEB-INF/web.xml. When you want to use Java 6 -features inside your JSP's, add the following javac compiler task attributes: -source="1.6" target="1.6". For live -applications you can also disable debug info with debug="off". +${webapp.path}/WEB-INF/web.xml. + + + +When you want to use a specific version of Java for your JSP's, add the +javac compiler task attributes source and target with +appropriate values. For example, 16 to compile JSPs for Java 16. + + + +For production you may wish to disable debug info with +debug="off". - 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: Update references to Java 6
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 bfdc7d9 Update references to Java 6 bfdc7d9 is described below commit bfdc7d93e0321841170ca64cabb80aebfc9bcf47 Author: Mark Thomas AuthorDate: Wed Jul 28 21:27:34 2021 +0100 Update references to Java 6 --- java/org/apache/catalina/filters/RemoteIpFilter.java | 1 - webapps/docs/jasper-howto.xml| 16 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java b/java/org/apache/catalina/filters/RemoteIpFilter.java index 72ea1e2..d73b3b0 100644 --- a/java/org/apache/catalina/filters/RemoteIpFilter.java +++ b/java/org/apache/catalina/filters/RemoteIpFilter.java @@ -794,7 +794,6 @@ public class RemoteIpFilter extends GenericFilter { if (isInternal || (trustedProxies != null && trustedProxies.matcher(request.getRemoteAddr()).matches())) { String remoteIp = null; -// In java 6, proxiesHeaderValue should be declared as a java.util.Deque LinkedList proxiesHeaderValue = new LinkedList<>(); StringBuilder concatRemoteIpHeaderValue = new StringBuilder(); diff --git a/webapps/docs/jasper-howto.xml b/webapps/docs/jasper-howto.xml index c111074..a3ec42c 100644 --- a/webapps/docs/jasper-howto.xml +++ b/webapps/docs/jasper-howto.xml @@ -369,10 +369,18 @@ are automatically compiled as part of the build process. At the jasper task you can use the option addWebXmlMappings for automatic merge the ${webapp.path}/WEB-INF/generated_web.xml with the current web application deployment descriptor at -${webapp.path}/WEB-INF/web.xml. When you want to use Java 6 -features inside your JSP's, add the following javac compiler task attributes: -source="1.6" target="1.6". For live -applications you can also disable debug info with debug="off". +${webapp.path}/WEB-INF/web.xml. + + + +When you want to use a specific version of Java for your JSP's, add the +javac compiler task attributes source and target with +appropriate values. For example, 16 to compile JSPs for Java 16. + + + +For production you may wish to disable debug info with +debug="off". - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated: Update references to Java 6
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 67f231d Update references to Java 6 67f231d is described below commit 67f231d9b7b5ab89a16f7d9e2a2eef12acb45a20 Author: Mark Thomas AuthorDate: Wed Jul 28 21:27:34 2021 +0100 Update references to Java 6 --- java/org/apache/catalina/filters/RemoteIpFilter.java | 1 - webapps/docs/jasper-howto.xml| 16 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java b/java/org/apache/catalina/filters/RemoteIpFilter.java index fffba9d..13a4011 100644 --- a/java/org/apache/catalina/filters/RemoteIpFilter.java +++ b/java/org/apache/catalina/filters/RemoteIpFilter.java @@ -796,7 +796,6 @@ public class RemoteIpFilter implements Filter { if (isInternal || (trustedProxies != null && trustedProxies.matcher(request.getRemoteAddr()).matches())) { String remoteIp = null; -// In java 6, proxiesHeaderValue should be declared as a java.util.Deque LinkedList proxiesHeaderValue = new LinkedList<>(); StringBuilder concatRemoteIpHeaderValue = new StringBuilder(); diff --git a/webapps/docs/jasper-howto.xml b/webapps/docs/jasper-howto.xml index 850d0d3..f150636 100644 --- a/webapps/docs/jasper-howto.xml +++ b/webapps/docs/jasper-howto.xml @@ -352,10 +352,18 @@ are automatically compiled as part of the build process. At the jasper task you can use the option addWebXmlMappings for automatic merge the ${webapp.path}/WEB-INF/generated_web.xml with the current web application deployment descriptor at -${webapp.path}/WEB-INF/web.xml. When you want to use Java 6 -features inside your JSP's, add the following javac compiler task attributes: -source="1.6" target="1.6". For live -applications you can also disable debug info with debug="off". +${webapp.path}/WEB-INF/web.xml. + + + +When you want to use a specific version of Java for your JSP's, add the +javac compiler task attributes source and target with +appropriate values. For example, 16 to compile JSPs for Java 16. + + + +For production you may wish to disable debug info with +debug="off". - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove Java 7 references
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 3f6db1c Remove Java 7 references 3f6db1c is described below commit 3f6db1c84c71c7adc227428239c44f579dec19b1 Author: Mark Thomas AuthorDate: Wed Jul 28 21:32:10 2021 +0100 Remove Java 7 references --- java/org/apache/tomcat/jni/Library.java | 12 ++-- java/org/apache/tomcat/util/net/SSLUtilBase.java | 3 +-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/java/org/apache/tomcat/jni/Library.java b/java/org/apache/tomcat/jni/Library.java index 4cdf330..09fe13a 100644 --- a/java/org/apache/tomcat/jni/Library.java +++ b/java/org/apache/tomcat/jni/Library.java @@ -40,11 +40,7 @@ public final class Library { try { System.load(library.getAbsolutePath()); loaded = true; -} catch (ThreadDeath t) { -throw t; -} catch (VirtualMachineError t) { -// Don't use a Java 7 multiple exception catch so we can keep -// the JNI code identical between Tomcat 6/7/8/9 +} catch (ThreadDeath | VirtualMachineError t) { throw t; } catch (Throwable t) { if (library.exists()) { @@ -67,11 +63,7 @@ public final class Library { try { System.loadLibrary(value); loaded = true; -} catch (ThreadDeath t) { -throw t; -} catch (VirtualMachineError t) { -// Don't use a Java 7 multiple exception catch so we can keep -// the JNI code identical between Tomcat 6/7/8/9 +} catch (ThreadDeath | VirtualMachineError t) { throw t; } catch (Throwable t) { String name = System.mapLibraryName(value); diff --git a/java/org/apache/tomcat/util/net/SSLUtilBase.java b/java/org/apache/tomcat/util/net/SSLUtilBase.java index 56453f3..b201201 100644 --- a/java/org/apache/tomcat/util/net/SSLUtilBase.java +++ b/java/org/apache/tomcat/util/net/SSLUtilBase.java @@ -201,8 +201,7 @@ public abstract class SSLUtilBase implements SSLUtil { // Unfortunately, some key stores behave differently with null // and "". // JKS key stores treat null and "" interchangeably. -// PKCS12 key stores (Java 7 onwards) don't return the cert if -// null is used. +// PKCS12 key stores don't return the cert if null is used. // Key stores that do not use passwords expect null // Therefore: // - generally use null if pass is null or "" - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Update link to use Java 11
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 ae4ee89 Update link to use Java 11 ae4ee89 is described below commit ae4ee893f99f226fe5fdc8e933313e2e759d0733 Author: Mark Thomas AuthorDate: Wed Jul 28 21:32:27 2021 +0100 Update link to use Java 11 --- webapps/docs/config/http.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml index 6d178b2..2475a0a 100644 --- a/webapps/docs/config/http.xml +++ b/webapps/docs/config/http.xml @@ -1410,8 +1410,8 @@ default is TLS. The permitted values may be obtained from the JVM documentation for the allowed values for algorithm when creating an SSLContext instance e.g. - http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#SSLContext";> - Oracle Java 7. Note: There is overlap between this attribute and + https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#sslcontext-algorithms";> + Oracle Java 11. Note: There is overlap between this attribute and protocols. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 10.0.x updated: Remove Java 7 references
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 3b235da Remove Java 7 references 3b235da is described below commit 3b235da8487a6ec8b8f29fcedfcaa91f8db78c27 Author: Mark Thomas AuthorDate: Wed Jul 28 21:32:10 2021 +0100 Remove Java 7 references --- java/org/apache/tomcat/jni/Library.java | 12 ++-- java/org/apache/tomcat/util/net/SSLUtilBase.java | 3 +-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/java/org/apache/tomcat/jni/Library.java b/java/org/apache/tomcat/jni/Library.java index 4cdf330..09fe13a 100644 --- a/java/org/apache/tomcat/jni/Library.java +++ b/java/org/apache/tomcat/jni/Library.java @@ -40,11 +40,7 @@ public final class Library { try { System.load(library.getAbsolutePath()); loaded = true; -} catch (ThreadDeath t) { -throw t; -} catch (VirtualMachineError t) { -// Don't use a Java 7 multiple exception catch so we can keep -// the JNI code identical between Tomcat 6/7/8/9 +} catch (ThreadDeath | VirtualMachineError t) { throw t; } catch (Throwable t) { if (library.exists()) { @@ -67,11 +63,7 @@ public final class Library { try { System.loadLibrary(value); loaded = true; -} catch (ThreadDeath t) { -throw t; -} catch (VirtualMachineError t) { -// Don't use a Java 7 multiple exception catch so we can keep -// the JNI code identical between Tomcat 6/7/8/9 +} catch (ThreadDeath | VirtualMachineError t) { throw t; } catch (Throwable t) { String name = System.mapLibraryName(value); diff --git a/java/org/apache/tomcat/util/net/SSLUtilBase.java b/java/org/apache/tomcat/util/net/SSLUtilBase.java index 56453f3..b201201 100644 --- a/java/org/apache/tomcat/util/net/SSLUtilBase.java +++ b/java/org/apache/tomcat/util/net/SSLUtilBase.java @@ -201,8 +201,7 @@ public abstract class SSLUtilBase implements SSLUtil { // Unfortunately, some key stores behave differently with null // and "". // JKS key stores treat null and "" interchangeably. -// PKCS12 key stores (Java 7 onwards) don't return the cert if -// null is used. +// PKCS12 key stores don't return the cert if null is used. // Key stores that do not use passwords expect null // Therefore: // - generally use null if pass is null or "" - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 9.0.x updated: Remove Java 7 references
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 006ee1b Remove Java 7 references 006ee1b is described below commit 006ee1b05ba231c6a76aff59e81b25b1588b3561 Author: Mark Thomas AuthorDate: Wed Jul 28 21:32:10 2021 +0100 Remove Java 7 references --- java/org/apache/tomcat/jni/Library.java | 12 ++-- java/org/apache/tomcat/util/net/SSLUtilBase.java | 3 +-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/java/org/apache/tomcat/jni/Library.java b/java/org/apache/tomcat/jni/Library.java index 4cdf330..09fe13a 100644 --- a/java/org/apache/tomcat/jni/Library.java +++ b/java/org/apache/tomcat/jni/Library.java @@ -40,11 +40,7 @@ public final class Library { try { System.load(library.getAbsolutePath()); loaded = true; -} catch (ThreadDeath t) { -throw t; -} catch (VirtualMachineError t) { -// Don't use a Java 7 multiple exception catch so we can keep -// the JNI code identical between Tomcat 6/7/8/9 +} catch (ThreadDeath | VirtualMachineError t) { throw t; } catch (Throwable t) { if (library.exists()) { @@ -67,11 +63,7 @@ public final class Library { try { System.loadLibrary(value); loaded = true; -} catch (ThreadDeath t) { -throw t; -} catch (VirtualMachineError t) { -// Don't use a Java 7 multiple exception catch so we can keep -// the JNI code identical between Tomcat 6/7/8/9 +} catch (ThreadDeath | VirtualMachineError t) { throw t; } catch (Throwable t) { String name = System.mapLibraryName(value); diff --git a/java/org/apache/tomcat/util/net/SSLUtilBase.java b/java/org/apache/tomcat/util/net/SSLUtilBase.java index 56453f3..b201201 100644 --- a/java/org/apache/tomcat/util/net/SSLUtilBase.java +++ b/java/org/apache/tomcat/util/net/SSLUtilBase.java @@ -201,8 +201,7 @@ public abstract class SSLUtilBase implements SSLUtil { // Unfortunately, some key stores behave differently with null // and "". // JKS key stores treat null and "" interchangeably. -// PKCS12 key stores (Java 7 onwards) don't return the cert if -// null is used. +// PKCS12 key stores don't return the cert if null is used. // Key stores that do not use passwords expect null // Therefore: // - generally use null if pass is null or "" - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated: Remove Java 7 references
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 b46d966 Remove Java 7 references b46d966 is described below commit b46d966352d9b54fbe4f6d73d791e73ca9331391 Author: Mark Thomas AuthorDate: Wed Jul 28 21:32:10 2021 +0100 Remove Java 7 references --- java/org/apache/tomcat/jni/Library.java | 6 +- java/org/apache/tomcat/util/net/SSLUtilBase.java | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/java/org/apache/tomcat/jni/Library.java b/java/org/apache/tomcat/jni/Library.java index ef00fb9..8e4f40c 100644 --- a/java/org/apache/tomcat/jni/Library.java +++ b/java/org/apache/tomcat/jni/Library.java @@ -40,11 +40,7 @@ public final class Library { try { System.loadLibrary(NAMES[i]); loaded = true; -} catch (ThreadDeath t) { -throw t; -} catch (VirtualMachineError t) { -// Don't use a Java 7 multiple exception catch so we can keep -// the JNI code identical between Tomcat 6/7/8/9 +} catch (ThreadDeath | VirtualMachineError t) { throw t; } catch (Throwable t) { String name = System.mapLibraryName(NAMES[i]); diff --git a/java/org/apache/tomcat/util/net/SSLUtilBase.java b/java/org/apache/tomcat/util/net/SSLUtilBase.java index 7c4896f..de9ba71 100644 --- a/java/org/apache/tomcat/util/net/SSLUtilBase.java +++ b/java/org/apache/tomcat/util/net/SSLUtilBase.java @@ -200,8 +200,7 @@ public abstract class SSLUtilBase implements SSLUtil { // Unfortunately, some key stores behave differently with null // and "". // JKS key stores treat null and "" interchangeably. -// PKCS12 key stores (Java 7 onwards) don't return the cert if -// null is used. +// PKCS12 key stores don't return the cert if null is used. // Key stores that do not use passwords expect null // Therefore: // - generally use null if pass is null or "" - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Update comment
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 8e8f634 Update comment 8e8f634 is described below commit 8e8f634a3da96ff9fca3588bbd09aa833bb91ac2 Author: Mark Thomas AuthorDate: Wed Jul 28 21:39:08 2021 +0100 Update comment --- java/org/apache/catalina/loader/WebappLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/org/apache/catalina/loader/WebappLoader.java b/java/org/apache/catalina/loader/WebappLoader.java index ed377cd..a50944c 100644 --- a/java/org/apache/catalina/loader/WebappLoader.java +++ b/java/org/apache/catalina/loader/WebappLoader.java @@ -586,7 +586,7 @@ public class WebappLoader extends LifecycleMBeanBase implements Loader{ classpath.append(repository); } } else if (loader == ClassLoader.getSystemClassLoader()){ -// Java 9 onwards. The internal class loaders no longer extend +// From Java 9 the internal class loaders no longer extend // URLCLassLoader String cp = System.getProperty("java.class.path"); if (cp != null && cp.length() > 0) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Remove a pre-Java 9 workaround
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 41cb36a Remove a pre-Java 9 workaround 41cb36a is described below commit 41cb36afc94aacff791630619209a7f6d47f5e02 Author: Mark Thomas AuthorDate: Wed Jul 28 21:38:56 2021 +0100 Remove a pre-Java 9 workaround --- java/org/apache/catalina/loader/WebappClassLoaderBase.java | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java b/java/org/apache/catalina/loader/WebappClassLoaderBase.java index 12ca9ab..0cdef0a 100644 --- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java +++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java @@ -1883,10 +1883,8 @@ public abstract class WebappClassLoaderBase extends URLClassLoader usingExecutor = true; } } -} catch (/*SecurityException |*/ NoSuchFieldException | /*IllegalArgumentException |*/ -IllegalAccessException | RuntimeException e) { -// FIXME: InaccessibleObjectException is only available in Java 9+, -// swapped for RuntimeException for now +} catch (SecurityException | NoSuchFieldException | IllegalArgumentException | +IllegalAccessException | InaccessibleObjectException e) { log.warn(sm.getString("webappClassLoader.stopThreadFail", thread.getName(), getContextName()), e); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated (8e8f634 -> 09193e0)
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 8e8f634 Update comment new b63 Reword references to Java 9 new b2b9ea8 Java 9+ settings no longer need to be optional new 09193e0 Resource files were renamed to LocalStrings... The 3 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: bin/catalina.bat | 2 +- bin/catalina.sh | 2 +- build.xml| 53 - 3 files changed, 14 insertions(+), 43 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/03: Java 9+ settings no longer need to be optional
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 b2b9ea8417db3efc6cf8dd6fef877a4639adb9bb Author: Mark Thomas AuthorDate: Wed Jul 28 21:55:05 2021 +0100 Java 9+ settings no longer need to be optional --- build.xml | 51 +++ 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/build.xml b/build.xml index 4d6775e..12a1eb2 100644 --- a/build.xml +++ b/build.xml @@ -210,33 +210,6 @@ - - - - - - - - - - - - - - - @@ -1984,13 +1957,11 @@ - - - - - - - + + + + + @@ -2259,7 +2230,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform. encoding="UTF-8" docencoding="UTF-8" charset="UTF-8" - additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}" + additionalparam="-breakiterator -notimestamp -html5" source="${compile.source}" maxmemory="512m" failonerror="true" @@ -2281,7 +2252,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform. encoding="UTF-8" docencoding="UTF-8" charset="UTF-8" - additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}" + additionalparam="-breakiterator -notimestamp -html5" source="${compile.source}" maxmemory="512m" failonerror="true" @@ -2302,7 +2273,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform. encoding="UTF-8" docencoding="UTF-8" charset="UTF-8" - additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}" + additionalparam="-breakiterator -notimestamp -html5" source="${compile.source}" maxmemory="512m" failonerror="true" @@ -2323,7 +2294,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform. encoding="UTF-8" docencoding="UTF-8" charset="UTF-8" - additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}" + additionalparam="-breakiterator -notimestamp -html5" source="${compile.source}" maxmemory="512m" failonerror="true" @@ -2344,7 +2315,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform. encoding="UTF-8" docencoding="UTF-8" charset="UTF-8" - additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}" + additionalparam="-breakiterator -notimestamp -html5" source="${compile.source}" maxmemory="512m" failonerror="true" @@ -2384,7 +2355,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform. encoding="UTF-8" docencoding="UTF-8" charset="UTF-8" - additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}" + additionalparam="-breakiterator -notimestamp -html5" source="${compile.source}" maxmemory="512m" failonerror="true" - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 03/03: Resource files were renamed to LocalStrings...
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 09193e0514ac449df454184941bba492d9b20a85 Author: Mark Thomas AuthorDate: Wed Jul 28 21:55:34 2021 +0100 Resource files were renamed to LocalStrings... --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index 12a1eb2..80f0495 100644 --- a/build.xml +++ b/build.xml @@ -968,7 +968,7 @@ - + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 01/03: Reword references to Java 9
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 b63bc4d4b41a23b211196a7be9b98449e93c Author: Mark Thomas AuthorDate: Wed Jul 28 21:54:44 2021 +0100 Reword references to Java 9 --- bin/catalina.bat | 2 +- bin/catalina.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/catalina.bat b/bin/catalina.bat index 6a322a7..8ef19fe 100755 --- a/bin/catalina.bat +++ b/bin/catalina.bat @@ -217,7 +217,7 @@ if not "%LOGGING_MANAGER%" == "" goto noJuliManager set LOGGING_MANAGER=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager :noJuliManager -rem Configure JAVA 9 specific start-up parameters +rem Configure module start-up parameters set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.lang=ALL-UNNAMED" set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.io=ALL-UNNAMED" set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.util=ALL-UNNAMED" diff --git a/bin/catalina.sh b/bin/catalina.sh index 57627bb..1bf92a9 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -290,7 +290,7 @@ if [ "$USE_NOHUP" = "true" ]; then _NOHUP="nohup" fi -# Add the JAVA 9 specific start-up parameters required by Tomcat +# Add the module start-up parameters required by Tomcat JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED" JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.io=ALL-UNNAMED" JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.util=ALL-UNNAMED" - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org