From dev-return-202097-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Tue Oct 1 14:50:10 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 8D3DF180608 for ; Tue, 1 Oct 2019 16:50:10 +0200 (CEST) Received: (qmail 78349 invoked by uid 500); 1 Oct 2019 14:49:50 -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 78044 invoked by uid 99); 1 Oct 2019 14:49:50 -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:49:50 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id EB193890AA; Tue, 1 Oct 2019 14:49:49 +0000 (UTC) Date: Tue, 01 Oct 2019 14:49:56 +0000 To: "dev@tomcat.apache.org" Subject: [tomcat] 07/08: 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: <156994138967.16162.4867648137377853002@gitbox.apache.org> References: <156994138967.16162.4867648137377853002@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: tomcat X-Git-Refname: refs/heads/7.0.x X-Git-Reftype: branch X-Git-Rev: 9f5df15ea3d3957242558f219da50495481fd342 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20191001144949.EB193890AA@gitbox.apache.org> 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 9f5df15ea3d3957242558f219da50495481fd342 Author: Mark Thomas AuthorDate: Tue Oct 1 15:39:08 2019 +0100 Try and detect bugs like BZ 63778 --- java/org/apache/tomcat/util/compat/Jre7Compat.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/java/org/apache/tomcat/util/compat/Jre7Compat.java b/java/org/apache/tomcat/util/compat/Jre7Compat.java index f47c3af..40f4a50 100644 --- a/java/org/apache/tomcat/util/compat/Jre7Compat.java +++ b/java/org/apache/tomcat/util/compat/Jre7Compat.java @@ -74,6 +74,8 @@ class Jre7Compat extends JreCompat { Method m14 = null; Constructor c = null; try { + // Order is important for the error handling below. + // Must look up m1 first. m1 = Locale.class.getMethod("forLanguageTag", String.class); c = GZIPOutputStream.class.getConstructor(OutputStream.class, boolean.class); m2 = CallableStatement.class.getMethod("getObject", int.class, Class.class); @@ -93,8 +95,13 @@ class Jre7Compat extends JreCompat { // Should never happen log.error(sm.getString("jre7Compat.unexpected"), e); } catch (NoSuchMethodException e) { - // Must be pre-Java 7 - log.debug(sm.getString("jre7Compat.javaPre7"), e); + if (m1 == null) { + // Must be pre-Java 7 + log.debug(sm.getString("jre7Compat.javaPre7"), e); + } else { + // Should never happen - signature error in lookup? + log.error(sm.getString("jre7Compat.unexpected"), e); + } } forLanguageTagMethod = m1; gzipOutputStreamConstructor = c; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org