test/jdk/java/io/Serializable/oldTests/CheckingEquality.java
changeset 58565 baa5969ecf34
parent 47216 71c04702a3d5
equal deleted inserted replaced
58564:218a1a642c6f 58565:baa5969ecf34
     1 /*
     1 /*
     2  * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    81         }
    81         }
    82     }
    82     }
    83 }
    83 }
    84 
    84 
    85 class Firstpsio implements java.io.Serializable {
    85 class Firstpsio implements java.io.Serializable {
       
    86     private static final long serialVersionUID = 1L;
       
    87 
    86     String one;
    88     String one;
    87     int two;
    89     int two;
    88     float three[];
    90     float three[];
    89 
    91 
    90     void init() { /* called only before writing */
    92     void init() { /* called only before writing */
   123         return ret;
   125         return ret;
   124     }
   126     }
   125 }
   127 }
   126 
   128 
   127 class Secondpsio extends Firstpsio  {
   129 class Secondpsio extends Firstpsio  {
       
   130     private static final long serialVersionUID = 1L;
       
   131 
   128     String quatre;
   132     String quatre;
   129     int cinq;
   133     int cinq;
   130 
   134 
   131     private void writeObject(ObjectOutputStream pw) throws IOException {
   135     private void writeObject(ObjectOutputStream pw) throws IOException {
   132         pw.writeObject(quatre);
   136         pw.writeObject(quatre);
   171         super.init();
   175         super.init();
   172     }
   176     }
   173 }
   177 }
   174 
   178 
   175 class Thirdpsio extends Secondpsio {
   179 class Thirdpsio extends Secondpsio {
       
   180     private static final long serialVersionUID = 1L;
   176 
   181 
   177     static String ign = "ignored";
   182     static String ign = "ignored";
   178     transient Object oh;
   183     transient Object oh;
   179 
   184 
   180     int six;
   185     int six;
   182     private static int seven[];
   187     private static int seven[];
   183     protected byte eight = (byte)9;
   188     protected byte eight = (byte)9;
   184     static final byte dcare = (byte) 128;
   189     static final byte dcare = (byte) 128;
   185     private short nine = 8888;
   190     private short nine = 8888;
   186     long ten;
   191     long ten;
   187     java.util.Enumeration zero;
   192     @SuppressWarnings("serial") /* Incorrect declarations are being tested */
       
   193     java.util.Enumeration<?> zero;
   188 
   194 
   189 
   195 
   190     boolean equals(Thirdpsio other) {
   196     boolean equals(Thirdpsio other) {
   191         boolean ret = super.equals(other);
   197         boolean ret = super.equals(other);
   192 
   198 
   225         int s7[] = { 7, 7, 7 };
   231         int s7[] = { 7, 7, 7 };
   226         seven = s7;
   232         seven = s7;
   227         eight = (byte)8;
   233         eight = (byte)8;
   228         nine = (short)9;
   234         nine = (short)9;
   229         ten = (long)100000;
   235         ten = (long)100000;
   230         java.util.Enumeration em = null; /* default */
   236         java.util.Enumeration<?> em = null; /* default */
   231 
   237 
   232         super.init();
   238         super.init();
   233     }
   239     }
   234 }
   240 }