|
From: | Bryce McKinlay |
Subject: | Re: Patch: merge File.toURI() from Classpath |
Date: | Wed, 07 Jul 2004 14:33:16 -0400 |
User-agent: | Mozilla Thunderbird 0.5 (X11/20040626) |
Dalibor Topic wrote:
Bryce McKinlay wrote:Again, these exceptions should be documented as part of our API documentation. They are exceptions that should _never_ happen. No call from the application should cause them to be thrown, thus they are not part of the API. If they are ever thrown, then there is a bug in classpath. Nevertheless, applications should have the ability to try and continue in the face of classpath bugs if they need fault tolerance.Can't we just use assertions for things that should never happen?
In this case I think its better not to, because assertions may be disabled in production builds. In this case we're just rethrowing exceptions that occured within classpath, and although these exceptions arn't supposed to happen, we _do_ want to know about them if they do.
On the other hand, I think assertions are the best bet in cases where the check itself makes the code more expensive, and you want to add some extra sanity tests to debug builds.
Regards Bryce
[Prev in Thread] | Current Thread | [Next in Thread] |