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.
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