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

Should call default ctor of first non-Serializable superclass

XMLWordPrintable

    • beta2
    • generic
    • generic
    • Verified

      Please see the attached test case.

      Currently, the RMI-IIOP implementation uses a native call to allocateNewObject which avoids calling any constructors. This is incorrect. The default constructor of the first non-Serializable superclass must be called to initialize any state that wouldn't be preserved on the wire. Similarly, this should be done for Externalizables.

      Please see the Java Object Serialization specification section 3.1:

      http://java.sun.com/j2se/1.3/docs/guide/serialization/spec/input.doc1.html#961

      and the J2SE 1.4 code in java.io

      ObjectInputStream readOrdinaryObject
      ObjectStreamClass newInstance

      The current result is that these classes won't have their internal state properly restored, possibly violating internal invariants.

      See comments section.

      *******************************************************************************
      muthu.anbumani@eng 2001-08-03

      - Verification of the Attached Testcase against the Following build Done Successfully.

      - Build: j2sdk-1_4_0-beta_refresh-bin-b74-solsparc-01_aug_2001
      ********************************************************************************

            eandersosunw Everett Anderson (Inactive)
            eandersosunw Everett Anderson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: