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:
Daniel Rall 2002-08-22 00:04:42 +00:00
parent 3ad9e1fcc8
commit d659fc0d2a
1 changed files with 1 additions and 6 deletions

View File

@ -309,15 +309,10 @@ public static int getThrowableCount(Throwable t)
public static Throwable[] getThrowables(Throwable t)
{
ArrayList list = new ArrayList();
if (t != null)
while (t != null)
{
list.add(t);
t = ExceptionUtils.getCause(t);
while (t != null)
{
list.add(t);
t = ExceptionUtils.getCause(t);
}
}
return (Throwable []) list.toArray(new Throwable[list.size()]);
}