#437 Catching exception from static init, prints a warning and moves on.

(cherry picked from commit d8d0131)
This commit is contained in:
Harald Kuhr 2018-08-30 15:02:04 +02:00
parent 3b68d676f3
commit a06cbfd6f4

View File

@ -101,8 +101,16 @@ public final class ColorSpaces {
private static final Map<Key, ICC_ColorSpace> cache = new LRUHashMap<>(10);
static {
// Force invocation of ProfileDeferralMgr.activateProfiles() to avoid JDK-6986863
ICC_Profile.getInstance(ColorSpace.CS_sRGB).getData();
try {
// Force invocation of ProfileDeferralMgr.activateProfiles() to avoid JDK-6986863
ICC_Profile.getInstance(ColorSpace.CS_sRGB).getData();
}
catch (Throwable disasters) {
System.err.println("ICC Color Profile not properly activated due to the exception below.");
System.err.println("Expect to see JDK-6986863 in action, and consider filing a bug report to your JRE provider.");
disasters.printStackTrace();
}
}
private ColorSpaces() {}