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

(coll spec) Doc bug in Vector.writeObject(ObjectOutputStream)

XMLWordPrintable

      java -version :
      --------------------------------------
      java version "1.4.2-auto-mantis"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-auto-mantis-309c)
      Java HotSpot(TM) Client VM (build 1.4.2-beta-b05, mixed mode)

      --------------------------------------

      PIT Build Location :

      /net/sqindia/export/disk03/coresqe/PIT/mantis/jdk/Solaris_nov5/j2sdk1.4.2

      -------------------------------

      While verifying bug 4741471 , I found a discrepancy in the documentation.

      It goes like this.

      In the class Vector,writeObject() method is added that simply
      calls the default method(Refer code below)

      ---------------------------------------------------------------------
      /**
      Save the state of the <tt>Vector</tt> instance to a stream (that
      is, serialize it). This method is present merely for synchronization.
      It just calls the default readObject method.
      */
                                                                                       
      private synchronized void writeObject(java.io.ObjectOutputStream s)
      throws java.io.IOException
                                                                                       
      { s.defaultWriteObject(); }

      ----------------------------------------------------------------------

      Here writeObject() method is calling defaultWriteObject() method but doc says
      that "It just calls the default readObject method"


      This should be corrected to

      /**
      Save the state of the <tt>Vector</tt> instance to a stream (that
      is, serialize it). This method is present merely for synchronization.
      It just calls the default writeObject method.
      */

            martin Martin Buchholz
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: