8068887: java.lang.Throwable could use Collections.emptyList for suppressedException
authorvtewari
Tue, 27 Oct 2015 10:14:36 +0530
changeset 33313 de27000120de
parent 33312 489f8e536bc0
child 33314 777bf87e5050
8068887: java.lang.Throwable could use Collections.emptyList for suppressedException Summary: java.lang.Throwable could use Collections.emptyList for suppressedException Reviewed-by: mchung, alanb, shade, redestad
jdk/src/java.base/share/classes/java/lang/Throwable.java
--- a/jdk/src/java.base/share/classes/java/lang/Throwable.java	Tue Oct 27 09:09:37 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/Throwable.java	Tue Oct 27 10:14:36 2015 +0530
@@ -211,8 +211,7 @@
 
     // Setting this static field introduces an acceptable
     // initialization dependency on a few java.util classes.
-    private static final List<Throwable> SUPPRESSED_SENTINEL =
-        Collections.unmodifiableList(new ArrayList<Throwable>(0));
+    private static final List<Throwable> SUPPRESSED_SENTINEL = Collections.emptyList();
 
     /**
      * The list of suppressed exceptions, as returned by {@link