mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-07 18:48:39 +00:00
Applied squashing of impl of getThrowableCount(Throwable) to
getThrowables(Throwable). git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136979 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3ad9e1fcc8
commit
d659fc0d2a
@ -309,16 +309,11 @@ public static int getThrowableCount(Throwable t)
|
|||||||
public static Throwable[] getThrowables(Throwable t)
|
public static Throwable[] getThrowables(Throwable t)
|
||||||
{
|
{
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
if (t != null)
|
|
||||||
{
|
|
||||||
list.add(t);
|
|
||||||
t = ExceptionUtils.getCause(t);
|
|
||||||
while (t != null)
|
while (t != null)
|
||||||
{
|
{
|
||||||
list.add(t);
|
list.add(t);
|
||||||
t = ExceptionUtils.getCause(t);
|
t = ExceptionUtils.getCause(t);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return (Throwable []) list.toArray(new Throwable[list.size()]);
|
return (Throwable []) list.toArray(new Throwable[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user