From dev-return-202090-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Tue Oct 1 14:19:06 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 51DD5180608 for ; Tue, 1 Oct 2019 16:19:06 +0200 (CEST) Received: (qmail 89561 invoked by uid 500); 1 Oct 2019 14:18:59 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 89384 invoked by uid 99); 1 Oct 2019 14:18:59 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Oct 2019 14:18:59 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 3D7D7890A5; Tue, 1 Oct 2019 14:18:59 +0000 (UTC) Date: Tue, 01 Oct 2019 14:19:01 +0000 To: "dev@tomcat.apache.org" Subject: [tomcat] 02/02: Try and detect bugs like BZ 63778 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: markt@apache.org In-Reply-To: <156993953910.23837.3088857235487417632@gitbox.apache.org> References: <156993953910.23837.3088857235487417632@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: tomcat X-Git-Refname: refs/heads/8.5.x X-Git-Reftype: branch X-Git-Rev: 7c15360234d03ee308ee6c8fe42c5442e8be5e36 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20191001141859.3D7D7890A5@gitbox.apache.org> 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 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-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org