src/java.base/share/classes/java/util/Vector.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 55036 265b110fc022
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
   100      *
   100      *
   101      * <p>Any array elements following the last element in the Vector are null.
   101      * <p>Any array elements following the last element in the Vector are null.
   102      *
   102      *
   103      * @serial
   103      * @serial
   104      */
   104      */
       
   105     @SuppressWarnings("serial") // Conditionally serializable
   105     protected Object[] elementData;
   106     protected Object[] elementData;
   106 
   107 
   107     /**
   108     /**
   108      * The number of valid components in this {@code Vector} object.
   109      * The number of valid components in this {@code Vector} object.
   109      * Components {@code elementData[0]} through
   110      * Components {@code elementData[0]} through
   122      * @serial
   123      * @serial
   123      */
   124      */
   124     protected int capacityIncrement;
   125     protected int capacityIncrement;
   125 
   126 
   126     /** use serialVersionUID from JDK 1.0.2 for interoperability */
   127     /** use serialVersionUID from JDK 1.0.2 for interoperability */
       
   128     @java.io.Serial
   127     private static final long serialVersionUID = -2767605614048989439L;
   129     private static final long serialVersionUID = -2767605614048989439L;
   128 
   130 
   129     /**
   131     /**
   130      * Constructs an empty vector with the specified initial capacity and
   132      * Constructs an empty vector with the specified initial capacity and
   131      * capacity increment.
   133      * capacity increment.
  1147      * @param in the stream
  1149      * @param in the stream
  1148      * @throws java.io.IOException if an I/O error occurs
  1150      * @throws java.io.IOException if an I/O error occurs
  1149      * @throws ClassNotFoundException if the stream contains data
  1151      * @throws ClassNotFoundException if the stream contains data
  1150      *         of a non-existing class
  1152      *         of a non-existing class
  1151      */
  1153      */
       
  1154     @java.io.Serial
  1152     private void readObject(ObjectInputStream in)
  1155     private void readObject(ObjectInputStream in)
  1153             throws IOException, ClassNotFoundException {
  1156             throws IOException, ClassNotFoundException {
  1154         ObjectInputStream.GetField gfields = in.readFields();
  1157         ObjectInputStream.GetField gfields = in.readFields();
  1155         int count = gfields.get("elementCount", 0);
  1158         int count = gfields.get("elementCount", 0);
  1156         Object[] data = (Object[])gfields.get("elementData", null);
  1159         Object[] data = (Object[])gfields.get("elementData", null);
  1168      * of the serialized data.
  1171      * of the serialized data.
  1169      *
  1172      *
  1170      * @param s the stream
  1173      * @param s the stream
  1171      * @throws java.io.IOException if an I/O error occurs
  1174      * @throws java.io.IOException if an I/O error occurs
  1172      */
  1175      */
       
  1176     @java.io.Serial
  1173     private void writeObject(java.io.ObjectOutputStream s)
  1177     private void writeObject(java.io.ObjectOutputStream s)
  1174             throws java.io.IOException {
  1178             throws java.io.IOException {
  1175         final java.io.ObjectOutputStream.PutField fields = s.putFields();
  1179         final java.io.ObjectOutputStream.PutField fields = s.putFields();
  1176         final Object[] data;
  1180         final Object[] data;
  1177         synchronized (this) {
  1181         synchronized (this) {