commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r895131 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java
Date Sat, 02 Jan 2010 06:07:11 GMT
Author: bayard
Date: Sat Jan  2 06:07:11 2010
New Revision: 895131

URL: http://svn.apache.org/viewvc?rev=895131&view=rev
Log:
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

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java?rev=895131&r1=895130&r2=895131&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang3/exception/ExceptionUtils.java
Sat Jan  2 06:07:11 2010
@@ -167,7 +167,7 @@
             }
         }
 
-        return getCauseUsingFieldName(throwable, "detail");
+        return null;
     }
 
     /**
@@ -223,35 +223,6 @@
         return null;
     }
 
-    /**
-     * <p>Finds a <code>Throwable</code> by field name.</p>
-     *
-     * @param throwable  the exception to examine
-     * @param fieldName  the name of the attribute to examine
-     * @return the wrapped exception, or <code>null</code> 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;
-    }
-
     //-----------------------------------------------------------------------
     /**
      * <p>Counts the number of <code>Throwable</code> objects in the



Mime
View raw message