--- old/test/java/io/Serializable/subclass/Test.java 2017-05-24 21:59:22.316477002 -0700 +++ new/test/java/io/Serializable/subclass/Test.java 2017-05-24 21:59:22.145455266 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,20 +26,21 @@ * @bug 4100915 * @summary Verify that [write/read]ObjectOverride methods get called. * Test verifies that ALL methods to write an object can - * be overridden. Howver, the testing for reading an object + * be overridden. However, the testing for reading an object * is incomplete. Only test that readObjectOverride is called. * An entire protocol would need to be implemented and written * out before being able to test the input side of the API. * * Also, would be appropriate that this program verify - * that if SerializablePermission "enableSubclassImplamentation" + * that if SerializablePermission "enableSubclassImplementation" * is not in the security policy and security is enabled, that * a security excepiton is thrown when constructing the * ObjectOutputStream subclass. * * * @compile AbstractObjectInputStream.java AbstractObjectOutputStream.java XObjectInputStream.java XObjectOutputStream.java Test.java - * @run main Test + * @run main Test + * @run main/othervm/policy=Allow.policy Test -expectSecurityException */ import java.io.*; @@ -129,10 +130,11 @@ throw new Error("Assertion failure. " + "Expected a security exception on previous line."); } catch (SecurityException e) { - if (expectSecurityException) + if (expectSecurityException) { + System.err.println("Caught expected security exception."); return; - else - throw e; + } + throw e; } os.writeObject(new A()); os.close();