8154860: ImageIO.getImageReadersByFormatName() fails when jai_imageio is in the classpath
authorprr
Wed, 25 May 2016 15:20:45 -0700
changeset 38998 dfdce8bfb10f
parent 38997 737cce90a6d4
child 38999 035e9ed4af2c
8154860: ImageIO.getImageReadersByFormatName() fails when jai_imageio is in the classpath Reviewed-by: serb, bpb
jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
--- 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;