On Thu, 25 Mar 2021 18:52:54 GMT, Stuart Marks <sma...@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:

- http://cr.openjdk.java.net/~dmeetry/8009581/webrev.5/
- http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-May/016908.html
- http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/017594.html
- 
https://mail.openjdk.java.net/pipermail/core-libs-dev/2018-February/051341.html

The only twist is that we would have to keep the public field as deprecated.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3182

Reply via email to