test/jdk/java/io/Serializable/enum/mismatchedTypecode/Test.java
changeset 58565 baa5969ecf34
parent 47216 71c04702a3d5
equal deleted inserted replaced
58564:218a1a642c6f 58565:baa5969ecf34
     1 /*
     1 /*
     2  * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 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.
    69         } catch (InvalidClassException e) {
    69         } catch (InvalidClassException e) {
    70             System.out.println("caught expected exception " + e);
    70             System.out.println("caught expected exception " + e);
    71         }
    71         }
    72 
    72 
    73         oout = new TestObjectOutputStream(bout = new ByteArrayOutputStream());
    73         oout = new TestObjectOutputStream(bout = new ByteArrayOutputStream());
    74         oout.writeObject(new Integer(5));
    74         oout.writeObject(5);
    75         oout.close();
    75         oout.close();
    76         oin = new ObjectInputStream(
    76         oin = new ObjectInputStream(
    77             new ByteArrayInputStream(bout.toByteArray()));
    77             new ByteArrayInputStream(bout.toByteArray()));
    78         try {
    78         try {
    79             Object obj = oin.readObject();
    79             Object obj = oin.readObject();