From d659fc0d2aa6dae5a047671ba65729cb121c4846 Mon Sep 17 00:00:00 2001 From: Daniel Rall Date: Thu, 22 Aug 2002 00:04:42 +0000 Subject: [PATCH] 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 --- .../org/apache/commons/lang/exception/ExceptionUtils.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/java/org/apache/commons/lang/exception/ExceptionUtils.java b/src/java/org/apache/commons/lang/exception/ExceptionUtils.java index cfa15c8a1..2e6cf62de 100644 --- a/src/java/org/apache/commons/lang/exception/ExceptionUtils.java +++ b/src/java/org/apache/commons/lang/exception/ExceptionUtils.java @@ -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()]); }