RFR: 8322027: One XMLStreamException constructor fails to initialize cause

Joe Wang joehw at openjdk.org
Thu Dec 14 19:24:42 UTC 2023


On Wed, 13 Dec 2023 21:25:19 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> After filing this PR, I had some second thoughts and added them to the summary but by then it was too late for the `core-libs-dev` email, so I'll repeat here in case anyone has some comments:
> 
> > It's worth considering if there is any code out there that is working around this problem already by invoking `initCause()` manually. If so, that code would start throwing an `IllegalStateException` after this change.
> > So a more conservative fix would be to just add another constructor taking the same arguments in a different order. But then again that's not much better than just saying "always use `initCause()` with the broken constructor", i.e., don't change anything.
> > Hmm.

Yeah, it may make sense to create a CSR to document the behavior change. My take is that the benefit outweighs the potential drawback. I've seen a case a few days ago where the use of this constructor caused the original cause to be lost. Attempting to work around the issue by invoking 'initCause()" won't necessarily be a good solution given other constructors can be used to avoid the issue.

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

PR Comment: https://git.openjdk.org/jdk/pull/17090#issuecomment-1856445263


More information about the core-libs-dev mailing list