commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <...@finemaltcoding.com>
Subject Re: DBCP/LANG
Date Tue, 13 Aug 2002 19:45:14 GMT
"Jack, Paul" <pjack@sfaf.org> writes:

> > Well, seriously speaking there are few other patterns I've seen:
> >   getNextException
> >   getRootCause
> >   getException
> 
> Plus getTargetException() used by
> java.lang.reflect.InvocationTargetException,
> quite common.

Would doing something like this make sense?:

Index: ExceptionUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/exception/ExceptionUtils.java,v
retrieving revision 1.3
diff -u -u -r1.3 ExceptionUtils.java
--- ExceptionUtils.java	13 Aug 2002 18:19:06 -0000	1.3
+++ ExceptionUtils.java	13 Aug 2002 19:42:07 -0000
@@ -68,7 +68,13 @@
     /**
      * The name of the <code>getCause()</code> method.
      */
-    protected static final String CAUSE_METHOD_NAME = "getCause";
+    protected static final String[] CAUSE_METHOD_NAMES =
+    {
+        "getCause",
+        "getTargetException",
+        "getNextException",
+        "getException"
+    };
 
     /**
      * The parameters of the <code>getCause()</code> method.

More code changes would be necessary, but I prefer to get feedback
first.

I leave out getRootCause() because the method is either mis-named or
not appropriate in this context (though it could be used in
ExceptionUtils.getRootCause(), depending upon what it actually does).

Root cause means the root node in the exception chain, the exception
which started it all.
-- 

Daniel Rall <dlr@finemaltcoding.com>

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message