< prev index next >

## src/java.base/share/classes/java/lang/StringBuffer.java

Print this page

    @@ -1,7 +1,7 @@
      /*
    -  * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
    +  * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
       * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       *
       * This code is free software; you can redistribute it and/or modify it
       * under the terms of the GNU General Public License version 2 only, as
       * published by the Free Software Foundation.  Oracle designates this

    @@ -23,10 +23,11 @@
       * questions.
       */

      package java.lang;

    + import java.io.IOException;
      import java.util.Arrays;
      import jdk.internal.HotSpotIntrinsicCandidate;

      /**
       * A thread-safe, mutable sequence of characters.

    @@ -731,12 +732,15 @@
              new java.io.ObjectStreamField("count", Integer.TYPE),
              new java.io.ObjectStreamField("shared", Boolean.TYPE),
          };

          /**
    -      * readObject is called to restore the state of the StringBuffer from
    +      * The {@code writeObject} method is called to write the state of the {@code StringBuffer} to
           * a stream.
    +      *
    +      * @param  s the {@code ObjectOutputStream} to which data is written
    +      * @throws IOException if an I/O error occurs
           */
          @java.io.Serial
          private synchronized void writeObject(java.io.ObjectOutputStream s)
              throws java.io.IOException {
              java.io.ObjectOutputStream.PutField fields = s.putFields();

    @@ -751,12 +755,16 @@
              fields.put("shared", false);
              s.writeFields();
          }

          /**
    -      * readObject is called to restore the state of the StringBuffer from
    +      * The {@code readObject} method is called to restore the state of the {@code StringBuffer} from
           * a stream.
    +      *
    +      * @param  s the {@code ObjectInputStream} from which data is read
    +      * @throws IOException if an I/O error occurs
    +      * @throws ClassNotFoundException if a serialized class cannot be loaded
           */
          @java.io.Serial
          private void readObject(java.io.ObjectInputStream s)
              throws java.io.IOException, ClassNotFoundException {
              java.io.ObjectInputStream.GetField fields = s.readFields();

< prev index next >