JDK-6385749 : XMLStreamException doesn't handle exception nesting correctly.
  • Type: Enhancement
  • Component: xml
  • Sub-Component: javax.xml.stream
  • Affected Version: 1.0
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2006-02-14
  • Updated: 2020-08-04
  • Resolved: 2020-08-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
Description
This is probably not something we can do right now, but I thought I should just record the bug anyway.

XMLStreamException doesn't implement the getCause method, so when it's a part of nested exceptions,
JDK is unable to report the exceptions nested inside XMLStreamException correctly.

See 6385694 for a similar bug for SAXException.

Comments
No need for XMLStreamException to override getCause. printStackTrace will call Throwable::printStackTrace that in turn calls Throwable's getCause. On the other hand, there's no need for getNestedException. But that's a minor nuisance since it can be simply ignored.
04-08-2020

EVALUATION as noted in see also bug: "See 6385694 for a similar bug for SAXException." this is not 100% backwards compatible so is an RFE for JAXP.next.
21-03-2006

EVALUATION this may require a small CCC request?
14-02-2006

SUGGESTED FIX Add the following code: public Throwable getCause() { return getNestedException(); }
14-02-2006