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,15 +309,10 @@ public class ExceptionUtils
|
||||||
public static Throwable[] getThrowables(Throwable t)
|
public static Throwable[] getThrowables(Throwable t)
|
||||||
{
|
{
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
if (t != null)
|
while (t != null)
|
||||||
{
|
{
|
||||||
list.add(t);
|
list.add(t);
|
||||||
t = ExceptionUtils.getCause(t);
|
t = ExceptionUtils.getCause(t);
|
||||||
while (t != null)
|
|
||||||
{
|
|
||||||
list.add(t);
|
|
||||||
t = ExceptionUtils.getCause(t);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return (Throwable []) list.toArray(new Throwable[list.size()]);
|
return (Throwable []) list.toArray(new Throwable[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue