test/jdk/java/io/Serializable/ClassCastExceptionDetail/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.
    34 class Foo implements Serializable {
    34 class Foo implements Serializable {
    35     private static final long serialVersionUID = 0L;
    35     private static final long serialVersionUID = 0L;
    36     private Float bar;
    36     private Float bar;
    37 }
    37 }
    38 
    38 
    39 class Gub extends Foo {}
    39 class Gub extends Foo {
       
    40     private static final long serialVersionUID = 1L;
       
    41 }
    40 
    42 
    41 public class Read {
    43 public class Read {
    42     public static void main(String[] args) throws Exception {
    44     public static void main(String[] args) throws Exception {
    43         FileInputStream in = new FileInputStream("tmp.ser");
    45         FileInputStream in = new FileInputStream("tmp.ser");
    44         try {
    46         try {