src/share/classes/java/lang/Throwable.java
Print this page
rev 3186 : 6880112: Project Coin: Port JDK core library code to use diamond operator
@@ -826,11 +826,11 @@
List<Throwable> suppressed = null;
if (suppressedExceptions.isEmpty()) {
// Use the sentinel for a zero-length list
suppressed = SUPPRESSED_SENTINEL;
} else { // Copy Throwables to new list
- suppressed = new ArrayList<Throwable>(1);
+ suppressed = new ArrayList<>(1);
for (Throwable t : suppressedExceptions) {
// Enforce constraints on suppressed exceptions in
// case of corrupt or malicious stream.
if (t == null)
throw new NullPointerException(NULL_CAUSE_MESSAGE);
@@ -909,11 +909,11 @@
if (suppressedExceptions == null) // Suppressed exceptions not recorded
return;
if (suppressedExceptions == SUPPRESSED_SENTINEL)
- suppressedExceptions = new ArrayList<Throwable>(1);
+ suppressedExceptions = new ArrayList<>(1);
assert suppressedExceptions != SUPPRESSED_SENTINEL;
suppressedExceptions.add(exception);
}