test/jdk/java/io/Serializable/wrongReturnTypes/Read.java
changeset 58565 baa5969ecf34
parent 47216 71c04702a3d5
equal deleted inserted replaced
58564:218a1a642c6f 58565:baa5969ecf34
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 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.
    32 class A implements Serializable {
    32 class A implements Serializable {
    33     private static final long serialVersionUID = 0L;
    33     private static final long serialVersionUID = 0L;
    34 
    34 
    35     static boolean readObjectNoDataCalled;
    35     static boolean readObjectNoDataCalled;
    36 
    36 
       
    37     @SuppressWarnings("serial") /* Incorrect use is being tested */
    37     private Object readObjectNoData() throws ObjectStreamException {
    38     private Object readObjectNoData() throws ObjectStreamException {
    38         readObjectNoDataCalled = true;
    39         readObjectNoDataCalled = true;
    39         return null;
    40         return null;
    40     }
    41     }
    41 }
    42 }
    44     private static final long serialVersionUID = 0L;
    45     private static final long serialVersionUID = 0L;
    45 
    46 
    46     static boolean readObjectCalled;
    47     static boolean readObjectCalled;
    47     static boolean readResolveCalled;
    48     static boolean readResolveCalled;
    48 
    49 
       
    50     @SuppressWarnings("serial") /* Incorrect use is being tested */
    49     private Integer readObject(ObjectInputStream in)
    51     private Integer readObject(ObjectInputStream in)
    50         throws IOException, ClassNotFoundException
    52         throws IOException, ClassNotFoundException
    51     {
    53     {
    52         readObjectCalled = true;
    54         readObjectCalled = true;
    53         in.defaultReadObject();
    55         in.defaultReadObject();
    54         return null;
    56         return null;
    55     }
    57     }
    56 
    58 
       
    59     @SuppressWarnings("serial") /* Incorrect use is being tested */
    57     private B readResolve() throws ObjectStreamException {
    60     private B readResolve() throws ObjectStreamException {
    58         readResolveCalled = true;
    61         readResolveCalled = true;
    59         return this;
    62         return this;
    60     }
    63     }
    61 }
    64 }