[jdom-interest] Push toward a 1.0 API
Alex Rosen
arosen at silverstream.com
Thu Apr 11 15:57:06 PDT 2002
> * Make sure that JDOMException is compatible with JDK 1.4 nested
exceptions.
> E.g. should getNestedException find 1.4-type nested exceptions? Do both
> 1.4-type nested exceptions and JDOMException both try to print child
> stack traces, causing them to be printed twice?
>
> Now that 1.4 is out, we need to identify if there are any issues here.
> Alex, you were working on this as I recall. Where did you leave it?
The root-cause methods in JDOMException match the ones in JDK 1.4, but we
don't use the base implementation at all, because then we'd be dependent on
1.4. That's fine. Here's how 1.4 impacts JDOMException, as I see it:
- The printStackTrace() methods should automatically pick up JDK 1.4 nested
exceptions, since the 1.4 spec says that Throwable.printStackTrace() will
print the nested stack trace too. So even though our getNestedException()
doesn't know about 1.4 nested exceptions, this should work fine.
- On the other hand, the 1.4 spec does not say that getMessage() will
recurse to nested exceptions. So our getMessage() method will stop when it
hits a 1.4 nested exception. In this case we could consider checking for 1.4
nested exceptions (via reflection), and appending their messages. On the
other hand, it is a little disturbing that our getMessage() method recurses
while the 1.4 one doesn't. IIRC, I added this because the error messages
were extremely unhelpful and frustrating, because the real error was hidden.
So I wouldn't want to change this. Not sure what the right solution is here.
Alex
More information about the jdom-interest
mailing list