JDK-4973972 : XMLEncoder discards exceptions
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2004-01-05
  • Updated: 2004-01-13
  • Resolved: 2004-01-13
Related Reports
Duplicate :  
Description

Name: gm110360			Date: 01/05/2004


FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-39)
Java HotSpot(TM) Client VM (build 1.4.1_01-14, mixed mode)


A DESCRIPTION OF THE PROBLEM :
XMLEncoder.writeStatement() contains the following code:

catch (Exception e) {
    getExceptionListener().exceptionThrown(new Exception("discarding statement " + oldStm));
}

Notice that it completely discards the original Exception, and therefore all information about the cause of the problem is lost.  This makes it unnecessarily difficult to identify and debug problems in serialization.  The above code should be changed to:

catch (Exception e) {
    getExceptionListener().exceptionThrown(new Exception("discarding statement " + oldStm, e));
}

so that the original Exception will be available to ExceptionListeners.


REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 189245) 
======================================================================

Comments
EVALUATION This has been fixed for 1.4.2 under the bugid 4679556. ###@###.### 2004-01-12
12-01-2004