Even shorter impl of getThrowableCount(Throwable) which returns zero

when passed a null argument.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136978 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Rall 2002-08-22 00:03:41 +00:00
parent e0800963cc
commit 3ad9e1fcc8
1 changed files with 1 additions and 6 deletions

View File

@ -291,16 +291,11 @@ public static int getThrowableCount(Throwable t)
{
// Count the number of throwables
int count = 0;
if (t != null)
{
count++;
t = ExceptionUtils.getCause(t);
while (t != null)
{
count++;
t = ExceptionUtils.getCause(t);
}
}
return count;
}