test/java/lang/Throwable/SuppressedExceptions.java

Print this page

        

*** 191,200 **** --- 191,201 ---- Throwable suppressed = new ArithmeticException(); t = new NoSuppression(true); // Suppression enabled // Make sure addSuppressed(null) throws an NPE try { t.addSuppressed(null); + throw new RuntimeException("NPE not thrown!"); } catch(NullPointerException e) { ; // Expected } t.addSuppressed(suppressed); t0 = t.getSuppressed();
*** 202,210 **** throw new RuntimeException("Expected suppression did not occur."); } private static class NoSuppression extends Throwable { public NoSuppression(boolean enableSuppression) { ! super("The medium.", null, enableSuppression); } } } --- 203,211 ---- throw new RuntimeException("Expected suppression did not occur."); } private static class NoSuppression extends Throwable { public NoSuppression(boolean enableSuppression) { ! super("The medium.", null, enableSuppression, true); } } }