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

XMLEncoder discards exceptions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: