This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 3c7fe26c9e0d063a74480667714a2c5f318b8e47 Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Oct 1 15:18:44 2019 +0100 Try and detect bugs like BZ 63778 --- java/org/apache/tomcat/util/compat/Jre8Compat.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/java/org/apache/tomcat/util/compat/Jre8Compat.java b/java/org/apache/tomcat/util/compat/Jre8Compat.java index 274e2a3..8f0c5fd 100644 --- a/java/org/apache/tomcat/util/compat/Jre8Compat.java +++ b/java/org/apache/tomcat/util/compat/Jre8Compat.java @@ -44,6 +44,9 @@ class Jre8Compat extends Jre7Compat { Method m2 = null; Method m3 = null; try { + // Order is important for the error handling below. + // Must look up m1 first. + // The class is Java6+... Class<?> c2 = Class.forName("javax.net.ssl.SSLParameters"); m1 = SSLServerSocket.class.getMethod("getSSLParameters"); @@ -54,8 +57,13 @@ class Jre8Compat extends Jre7Compat { // Should never happen log.error(sm.getString("jre8Compat.unexpected"), e); } catch (NoSuchMethodException e) { - // Must be pre-Java 8 - log.debug(sm.getString("jre8Compat.javaPre8"), e); + if (m1 == null) { + // Must be pre-Java 8 + log.debug(sm.getString("jre8Compat.javaPre8"), e); + } else { + // Should never happen - signature error in lookup? + log.error(sm.getString("jre8Compat.unexpected"), e); + } } catch (ClassNotFoundException e) { // Must be pre-Java 7 log.debug(sm.getString("jre8Compat.javaPre7"), e); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org