Adding a constructor to AssertionError that takes throwable

Paulo Levi i30817 at gmail.com
Sun Jan 10 08:33:35 UTC 2010


Hi.
A funtion i had to implement is one that returns a assertionerror given a
msg and a throwable (initCause with the throwable) simply because it's such
a common pattern to throw a assertionerror on "impossible" (buggy)
exceptions. Without the cause, it's sometimes hard to guess the problem
without recompiling the code more than once.

I'd like another constructor in AssertionError (that takes a msg and a
throwable).

As i said i did this on a static function, so it's not important to me, but
might simplify things for others (-3 lines of code in catch clauses).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20100110/c70a7a0e/attachment.html>


More information about the core-libs-dev mailing list