8154860: ImageIO.getImageReadersByFormatName() fails when jai_imageio is in the classpath
Reviewed-by: serb, bpb
--- a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java Wed May 25 13:38:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java Wed May 25 15:20:45 2016 -0700
@@ -770,7 +770,12 @@
poset.add(provider);
if (provider instanceof RegisterableService) {
RegisterableService rs = (RegisterableService)provider;
- rs.onRegistration(registry, category);
+ try {
+ rs.onRegistration(registry, category);
+ } catch (Throwable t) {
+ System.err.println("Caught and handled this exception :");
+ t.printStackTrace();
+ }
}
return !present;