Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6809409
Votes 0
Synopsis jaxp Issue 56 SAXException doesn't do the exception chaining properly
Category jaxp:sax
Reported Against
Release Fixed , 6u14(b03) (Bug ID:2173653) , 5.0u19(b01) (Bug ID:2173741)
State 8-Fix Available, bug
Priority: 3-Medium
Related Bugs
Submit Date 24-FEB-2009
Description
SAXException *still* doesn't do the proper exception chaining, masking the root
cause of the problem.

Add the following method to SAXException:

public Throwable getCause() {
    return exception;
}
Posted Date : 2009-02-24 17:36:22.0
Work Around
public class SAXExceptionExt  extends SAXException {
    private Exception exception;
    public SAXExceptionExt(Exception e) {
        super(e);
        exception = e;
    }
    public Throwable getCause() {
        return exception;
    }


}
Evaluation
SAXException should implement getCause in order to do the proper exception chaining.
Posted Date : 2009-02-26 20:01:20.0
Comments
  
  Include a link with my name & email   

Submitted On 03-JUL-2009
MattGoldspink
Hi,

I think this change has broken the behaviour. We have a test case which does the following:

        Exception cause = new Exception();
        SAXException e = new SAXException("A SAX exception");
        e.initCause(cause);
        assertSame(cause, e.getCause());

Using 6u14 this now fails because initCause(Throwable t); is not overriden in SAXException. 

Taking a step back though, why do you need to store the Exception in SAXException? Why can you not simply delegate all calls to Throwable? I see no logic that SAXException adds on top of Throwable (aside from the breaks)



PLEASE NOTE: JDK6 is formerly known as Project Mustang