Fix bug in isNestedThrowable, shown on JDK<1.4

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137511 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2003-07-26 14:22:21 +00:00
parent 858d38ddcf
commit 9345b31d15
1 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@
* @author Stephen Colebourne * @author Stephen Colebourne
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a> * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
* @since 1.0 * @since 1.0
* @version $Id: ExceptionUtils.java,v 1.29 2003/07/26 13:05:21 scolebourne Exp $ * @version $Id: ExceptionUtils.java,v 1.30 2003/07/26 14:22:21 scolebourne Exp $
*/ */
public class ExceptionUtils { public class ExceptionUtils {
@ -354,7 +354,7 @@ public static boolean isNestedThrowable(Throwable throwable) {
for (int i = 0, isize = CAUSE_METHOD_NAMES.length; i < isize; i++) { for (int i = 0, isize = CAUSE_METHOD_NAMES.length; i < isize; i++) {
try { try {
Method method = cls.getMethod(CAUSE_METHOD_NAMES[i], null); Method method = cls.getMethod(CAUSE_METHOD_NAMES[i], null);
if (method != null) { if (method != null && Throwable.class.isAssignableFrom(method.getReturnType())) {
return true; return true;
} }
} catch (NoSuchMethodException ignored) { } catch (NoSuchMethodException ignored) {