commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal Schumacher (JIRA)" <>
Subject [jira] [Created] (LANG-1364) ExceptionUtils#getRootCause* inconsistency
Date Sat, 28 Oct 2017 18:54:00 GMT
Pascal Schumacher created LANG-1364:

             Summary: ExceptionUtils#getRootCause* inconsistency
                 Key: LANG-1364
             Project: Commons Lang
          Issue Type: Bug
            Reporter: Pascal Schumacher

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

Reported by Zheng Xie in

This message was sent by Atlassian JIRA

View raw message