javaee / jaxb-spec

Formerly jsr222.java.net
Other
9 stars 16 forks source link

Retrofitting exception link mechanism of JAXBException #41

Closed glassfishrobot closed 18 years ago

glassfishrobot commented 19 years ago

Since JAXB 2.0 is going to require J2SE 5.0, we should take this opportunity to retrofit JAXBException's exception chaining mechanism into that of JDK 1.4.

Today, JAXBException has its own mechanism to link to another (wrapped) exception, and it has its own code to print the information about this linked exception in its printStackTrace method.

Starting from JDK 1.4, java.lang.Throwable has this exact feature. We can take advantage of this by tweaking JAXBException.

The change would allow the stack trace to be printed in the same way as the rest of exceptions. The printing method in JDK is also smarter than the one in JAXBException.

When making this change, we have to be careful not to break the compatibility. Fortunately, many of the core JDK exceptions (such as java.lang.InvocationTargetException) went through this retrofitting process, so we know how to do it right.

Environment

Operating System: All Platform: All

Affected Versions

[2.0 v0.4]

glassfishrobot commented 19 years ago

Reported by kohsuke

glassfishrobot commented 19 years ago

kohsuke said: I forgot to mention that JAXBException is missing serialVersionUID, and we should put that in.

glassfishrobot commented 19 years ago

kohsuke said: Committed changes.

glassfishrobot commented 19 years ago

kohsuke said: changed to FIXED.

glassfishrobot commented 19 years ago

kohsuke said: Created an attachment (id=3) Proposed diff. I incorrectly attached this to issue #39.

glassfishrobot commented 19 years ago

File: diff Attached By: kohsuke

glassfishrobot commented 19 years ago

Was assigned to kohsuke

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JSR222-41

glassfishrobot commented 18 years ago

Marked as fixed on Monday, July 31st 2006, 10:15:55 am