This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 7c15360234d03ee308ee6c8fe42c5442e8be5e36 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 a29abcd..e76ac35 100644 --- a/java/org/apache/tomcat/util/compat/Jre8Compat.java +++ b/java/org/apache/tomcat/util/compat/Jre8Compat.java @@ -46,6 +46,9 @@ class Jre8Compat extends JreCompat { Method m1 = null; Constructor<?> c2 = null; try { + // Order is important for the error handling below. + // Must look up m1 first. + // The class is Java6+... Class<?> clazz1 = Class.forName("javax.net.ssl.SSLParameters"); // ...but this method is Java8+ @@ -56,8 +59,13 @@ class Jre8Compat extends JreCompat { // 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) { // Should never happen log.error(sm.getString("jre8Compat.unexpected"), e); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org