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
--- 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