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 21:17:52 GMT
Juozas, I agree that the return type is a defining attribute.  The
code in CVS does check the return type for assignability to the
Throwable interface.  I would worry about checking every method in the
public interface and coming up with a bogus match.  As proposed, we'd
still face this issue, but our exposure to possible false positives
would be limited.


"Juozas Baliuka" <baliuka@centras.lt> writes:

> I think it is better to find this method ( public fields) by return type:
> "public Throwable   get*()".
> 
> 
> 
> 
> > "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/Ex
> ceptionUtils.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>
> >
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>

-- 

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