jdk/test/java/util/EnumSet/BogusEnumSet.java
changeset 27785 29d4cb4a8f5e
parent 5506 202f599c92aa
child 35314 a7e13065a7a0
equal deleted inserted replaced
27784:a51d6d4e0528 27785:29d4cb4a8f5e
    80           // Demonstrates corruption
    80           // Demonstrates corruption
    81           System.out.println("Enum size: " + Thread.State.values().length); // 6
    81           System.out.println("Enum size: " + Thread.State.values().length); // 6
    82           System.out.println("Set size: " + es.size()); // 64
    82           System.out.println("Set size: " + es.size()); // 64
    83           System.out.println("Set: " + es); // Throws IndexOutOfBoundsException
    83           System.out.println("Set: " + es); // Throws IndexOutOfBoundsException
    84           throw new AssertionError("Expected exception InvalidObjectException not thrown");
    84           throw new AssertionError("Expected exception InvalidObjectException not thrown");
    85         } catch (java.io.InvalidObjectException _) { /* OK */ }
    85         } catch (java.io.InvalidObjectException expected) { /* OK */ }
    86     }
    86     }
    87 
    87 
    88     private static Object deserialize(byte[] sf) throws Throwable {
    88     private static Object deserialize(byte[] sf) throws Throwable {
    89       return new ObjectInputStream(
    89       return new ObjectInputStream(
    90           new ByteArrayInputStream(sf))
    90           new ByteArrayInputStream(sf))