--- old/test/java/lang/Throwable/SuppressedExceptions.java 2010-07-14 19:50:58.000000000 -0700 +++ new/test/java/lang/Throwable/SuppressedExceptions.java 2010-07-14 19:50:58.000000000 -0700 @@ -26,7 +26,7 @@ /* * @test - * @bug 6911258 6962571 + * @bug 6911258 6962571 6963622 * @summary Basic tests of suppressed exceptions * @author Joseph D. Darcy */ @@ -35,11 +35,22 @@ private static String message = "Bad suppressed exception information"; public static void main(String... args) throws Exception { + noSelfSuppression(); basicSupressionTest(); serializationTest(); selfReference(); } + private static void noSelfSuppression() { + Throwable throwable = new Throwable(); + try { + throwable.addSuppressedException(throwable); + throw new RuntimeException("IllegalArgumentException for self-suppresion not thrown."); + } catch (IllegalArgumentException iae) { + ; // Expected + } + } + private static void basicSupressionTest() { Throwable throwable = new Throwable(); RuntimeException suppressed = new RuntimeException("A suppressed exception."); @@ -156,9 +167,8 @@ throwable1.printStackTrace(); - - throwable1.addSuppressedException(throwable1); throwable1.addSuppressedException(throwable2); + throwable2.addSuppressedException(throwable1); throwable1.printStackTrace(); }