test/java/lang/Throwable/LegacyChainedExceptionSerialization.java

Print this page

        

*** 23,45 **** import java.io.*; /** * @test ! * @bug 4385429 * @summary Certain legacy chained exceptions throw IllegalArgumentException * upon deserialization if "causative exception" is null. * @author Josh Bloch */ public class LegacyChainedExceptionSerialization { private static Throwable[] broken = { new ClassNotFoundException(), new ExceptionInInitializerError(), new java.lang.reflect.UndeclaredThrowableException(null), new java.lang.reflect.InvocationTargetException(null), ! new java.security.PrivilegedActionException(null), ! new java.awt.print.PrinterIOException(null) }; public static void main(String[] args) throws Exception { for (int i=0; i<broken.length; i++) test(broken[i]); --- 23,44 ---- import java.io.*; /** * @test ! * @bug 4385429 8004928 * @summary Certain legacy chained exceptions throw IllegalArgumentException * upon deserialization if "causative exception" is null. * @author Josh Bloch */ public class LegacyChainedExceptionSerialization { private static Throwable[] broken = { new ClassNotFoundException(), new ExceptionInInitializerError(), new java.lang.reflect.UndeclaredThrowableException(null), new java.lang.reflect.InvocationTargetException(null), ! new java.security.PrivilegedActionException(null) }; public static void main(String[] args) throws Exception { for (int i=0; i<broken.length; i++) test(broken[i]);