RFR [11] (JAXP): 6857903: SAXException.initCause() does not correctly set Exception (original) (raw)

Jason Mehrens jason_mehrens at hotmail.com
Thu Dec 21 19:00:21 UTC 2017


Aleksei,

You have to override all of the constructors to always disable initCause. Actually a similar issue was covered in:

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

Pretty much everything was hashed out in those threads.

Here is the final webrev for that:

http://cr.openjdk.java.net/~dmeetry/8009581/webrev.5/jaxp/src/javax/xml/xpath/XPathException.java.udiff.html

That should be a good cookbook for changes and tests required for this issue. Note that it gets rid of the Exception field and maintains serial compatibility.
Looking back on that change, I would have changed it so the InvalidClassException added the double cause as suppressed exceptions.

Jason


From: core-libs-dev <core-libs-dev-bounces at openjdk.java.net> on behalf of Aleks Efimov <aleksej.efimov at oracle.com> Sent: Thursday, December 21, 2017 11:27 AM To: core-libs-dev Subject: RFR [11] (JAXP): 6857903: SAXException.initCause() does not correctly set Exception

Hello,

Please, help to review the fix for jaxp bug that fixes SAXException to correctly set exception cause with 'setCause' method: http://cr.openjdk.java.net/~aefimov/6857903/dev/00/ I've tried to keep the fix miminal with respect to serial form of this API class, i.e. kept private 'exception' field.

The new test case was added to IssueTracker56Test unit test. Testing showed no related JCK/JTREG failures.

With Best Regards, Aleksei



More information about the core-libs-dev mailing list