Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4973972

XMLEncoder discards exceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.1
    • client-libs



      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)
      ======================================================================

            Unassigned Unassigned
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: