Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E1FB5200D2A for ; Sat, 28 Oct 2017 20:54:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E0A8D160BDC; Sat, 28 Oct 2017 18:54:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 32BF7160BE1 for ; Sat, 28 Oct 2017 20:54:04 +0200 (CEST) Received: (qmail 426 invoked by uid 500); 28 Oct 2017 18:54:03 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 414 invoked by uid 99); 28 Oct 2017 18:54:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Oct 2017 18:54:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 857C7C88D4 for ; Sat, 28 Oct 2017 18:54:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id SZt5ji6mh2E7 for ; Sat, 28 Oct 2017 18:54:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4981360D08 for ; Sat, 28 Oct 2017 18:54:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8AEE5E0F07 for ; Sat, 28 Oct 2017 18:54:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3D80E212F8 for ; Sat, 28 Oct 2017 18:54:00 +0000 (UTC) Date: Sat, 28 Oct 2017 18:54:00 +0000 (UTC) From: "Pascal Schumacher (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LANG-1364) ExceptionUtils#getRootCause* inconsistency MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 28 Oct 2017 18:54:05 -0000 [ https://issues.apache.org/jira/browse/LANG-1364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pascal Schumacher updated LANG-1364: ------------------------------------ Affects Version/s: 3.6 > ExceptionUtils#getRootCause* inconsistency > ------------------------------------------ > > Key: LANG-1364 > URL: https://issues.apache.org/jira/browse/LANG-1364 > Project: Commons Lang > Issue Type: Bug > Affects Versions: 3.6 > Reporter: Pascal Schumacher > > {quote} > I have found the design of three root cause related methods inconsistent > when the input Throwable does not wrap up another Throwable. > These three methods are > 1. getRootCause(Throwable t) > 2. getRootCauseMessage(Throwable t) > 3. getRootCauseStackTrace(Throwable t) > When the input t has no lower level cause: > - the first method returns null; > - the second method returns the message of t, which means the input t is > considered as the root cause in this method; > - the third method returns the stack trace of t, which also means this > method considers t as the root cause. > Therefore, I consider the design of the first method is not consistent with > the second and the third. > I usually write a function myself to get the root cause of an exception; > and it makes much better sense to me the root cause of a Throwable is > itself if no more lower level cause exists. > A request: change the first method to return t itself when there is no more > 'causes'. > {quote} > Reported by Zheng Xie in https://mail-archives.apache.org/mod_mbox/commons-dev/201710.mbox/%3CCAL-LHk7jvQGM9J1SPxLB2qEsXazwwq%2BYKuv29XgWXEcccHUn0w%40mail.gmail.com%3E -- This message was sent by Atlassian JIRA (v6.4.14#64029)