diff --git a/src/java/org/apache/commons/lang/exception/ExceptionUtils.java b/src/java/org/apache/commons/lang/exception/ExceptionUtils.java index 285814e66..cfa15c8a1 100644 --- a/src/java/org/apache/commons/lang/exception/ExceptionUtils.java +++ b/src/java/org/apache/commons/lang/exception/ExceptionUtils.java @@ -291,15 +291,10 @@ public static int getThrowableCount(Throwable t) { // Count the number of throwables int count = 0; - if (t != null) + while (t != null) { count++; t = ExceptionUtils.getCause(t); - while (t != null) - { - count++; - t = ExceptionUtils.getCause(t); - } } return count; }