RFR 8009581: Xpathexception does not honor initcause()
Aleksej Efimov
aleksej.efimov at oracle.com
Wed Apr 24 13:53:08 UTC 2013
Hi all,
Can I have a reviews for the following change:
http://cr.openjdk.java.net/~dmeetry/8009581/webrev.0/
<http://cr.openjdk.java.net/%7Edmeetry/8009581/webrev.0/>
Summary:
There is an erroneous behavior in 'initCause' method of
javax.xml.xpath.XPathException class.
Lets look at the following situation:
XPathException is created with 'XPathException(String )' constructor and
then the cause is initialized with 'initCause' method. Such
initialization sequence of actions isn't restricted by XPathException
[1] and Throwable [2] docs.
After that a cause is retrieved by 'getCause()' method: this call
returns incorrect cause = 'null'. It should return the same cause as was
used in 'initCause'. And this is the erroneous behavior.
Suggested fix (with regression test) is applicable both for JDK 8 and 7.
Regards,
-Aleksej
[1]
http://download.java.net/jdk8/docs/api/javax/xml/xpath/XPathException.html
[2]
http://download.java.net/jdk8/docs/api/java/lang/Throwable.html#initCause(java.lang.Throwable)
<http://download.java.net/jdk8/docs/api/java/lang/Throwable.html#initCause%28java.lang.Throwable%29>
[3] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8009581
More information about the core-libs-dev
mailing list