<i18n dev> RFR: 8264148: Update spec for exceptions retrofitted for exception chaining
github.com+28367473+jmehrens at openjdk.java.net
Tue Mar 30 04:01:57 UTC 2021
On Thu, 25 Mar 2021 18:52:54 GMT, Stuart Marks <smarks at openjdk.org> wrote:
> One special case is the **public field** in `WriteAbortedException`. This is really bad and something ought to be done about this, including deprecation, and maybe more. This implies that the exception is mutable, right? Hrrmph. Isn't there a general rule that once the cause has been set (either via a constructor or via initCause) the exception is immutable? Maybe the field should be deprecated, and `getCause()` should return the cause from the superclass. That's a behavior change of course, and I don't know how to assess the compatibility impact. But the current situation just seems wrong.
Agreed. WriteAbortedException should get similar treatment as the others like it:
The only twist is that we would have to keep the public field as deprecated.
More information about the i18n-dev