From d7a5c761704b271a478b05c97e709260b5e68ea6 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Sat, 2 Jan 2010 06:07:11 +0000 Subject: [PATCH] Removed the support for exceptions with a field named 'detail'. It's been there since the beginning, but does not seem like a very important use case. LANG-491 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@895131 13f79535-47bb-0310-9956-ffa450edef68 --- .../lang3/exception/ExceptionUtils.java | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java b/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java index 58f9d227a..0da128475 100644 --- a/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java +++ b/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java @@ -167,7 +167,7 @@ public static Throwable getCause(Throwable throwable, String[] methodNames) { } } - return getCauseUsingFieldName(throwable, "detail"); + return null; } /** @@ -223,35 +223,6 @@ private static Throwable getCauseUsingMethodName(Throwable throwable, String met return null; } - /** - *

Finds a Throwable by field name.

- * - * @param throwable the exception to examine - * @param fieldName the name of the attribute to examine - * @return the wrapped exception, or null if not found - */ - private static Throwable getCauseUsingFieldName(Throwable throwable, String fieldName) { - Field field = null; - try { - field = throwable.getClass().getField(fieldName); - } catch (NoSuchFieldException ignored) { - // exception ignored - } catch (SecurityException ignored) { - // exception ignored - } - - if (field != null && Throwable.class.isAssignableFrom(field.getType())) { - try { - return (Throwable) field.get(throwable); - } catch (IllegalAccessException ignored) { - // exception ignored - } catch (IllegalArgumentException ignored) { - // exception ignored - } - } - return null; - } - //----------------------------------------------------------------------- /** *

Counts the number of Throwable objects in the