34 try (TwrSuppression r1 = new TwrSuppression(false); |
34 try (TwrSuppression r1 = new TwrSuppression(false); |
35 TwrSuppression r2 = new TwrSuppression(true)) { |
35 TwrSuppression r2 = new TwrSuppression(true)) { |
36 throw new RuntimeException(); |
36 throw new RuntimeException(); |
37 } |
37 } |
38 } catch(RuntimeException e) { |
38 } catch(RuntimeException e) { |
39 Throwable[] suppressedExceptions = e.getSuppressedExceptions(); |
39 Throwable[] suppressedExceptions = e.getSuppressed(); |
40 int length = suppressedExceptions.length; |
40 int length = suppressedExceptions.length; |
41 if (length != 2) |
41 if (length != 2) |
42 throw new RuntimeException("Unexpected length " + length); |
42 throw new RuntimeException("Unexpected length " + length); |
43 |
43 |
44 if (suppressedExceptions[0].getClass() != Error.class || |
44 if (suppressedExceptions[0].getClass() != Error.class || |