commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Waldhoff <rwaldh...@apache.org>
Subject [functor] GeneratorException and JDK < 1.4
Date Tue, 24 Jun 2003 15:36:24 GMT
Jason (and whomever else takes an interest),

The "generator" stuff just added to commons-functor includes a form of
nested/tunneling exception called GeneratorException.  This exception, it
seems, is intended to wrap a (checked) Exception, as thrown by specific
Generator instances, in a RuntimeException.

As currently implemented, this adds a dependency on JDK 1.4, since it uses
the RuntimeException(Throwable) constructor.  Otherwise, commons-functor
is backward compatiable to JDK 1.2 (or even JDK1.1 with collections).

Two comments on this:

1) I'd like to maintain backward compatiablity with earlier JDKs, if at
all possible.  A version of GeneratorException that overloads the
Throwable.getCause method to return a locally defined reference to the
throwable, and doesn't use the super(Throwable) constructor might be one
way to achieve this in a backwards and forwards compatiable fashion
without comprimising the current functionality.

2) GeneratorException begs the question of some sort of generalized
FunctorException and/or a small collection of specific exception types
(PredicateException, ProcedureException, etc.)  Alternatively, the
NestedException type in lang could be used for this purpose.  Personally,
I'd prefer a specific TunneledException type that is used (and only used)
to adapt Exception to RuntimeException, as I've described at
<http://radio.weblogs.com/0122027/stories/2003/04/01/JavasCheckedExceptionsWereAMistake.html>
and elsewhere.

Thoughts? Comments?

- Rod <http://radio.weblogs.com/0122027/>

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


Mime
View raw message