[OpenJDK 2D-Dev] RFR: 8154860 ImageIO.getImageReadersByFormatName() fails when jai_imageio is in the classpath

Phil Race philip.race at oracle.com
Fri May 20 21:42:38 UTC 2016


That is too broad and I recall that Mark R. was pretty keen that SCE 
should always be propagated.
So catching it only in the applet case was probably a compromise (I 
don't remember exactly)

-phil.

On 5/20/2016 2:09 PM, Sergey Bylokhov wrote:
> Hi, Phil
> Probably it will be simpler to change the code in 
> IIORegistry.registerApplicationClasspathSpis?
>
>         } catch (ServiceConfigurationError err) {
>             if (System.getSecurityManager() != null) {
>                 // In the applet case, we will catch the  error so
>                 // registration of other plugins can  proceed
>                 err.printStackTrace();
>             } else {
>                 // In the application case, we will  throw the
>                 // error to indicate app/system  misconfiguration
>                 throw err;
>             }
>         }
>
> We can change ServiceConfigurationError to Throwable + stacktrace.
>
> On 20.05.16 23:07, Phil Race wrote:
>> Please review the following workaround for :-
>> https://bugs.openjdk.java.net/browse/JDK-8154860
>>
>> -phil.
>>
>> --- 
>> a/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
>> +++ 
>> b/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
>> @@ -770,7 +770,12 @@
>>          poset.add(provider);
>>          if (provider instanceof RegisterableService) {
>>              RegisterableService rs = (RegisterableService)provider;
>> +            try {
>>              rs.onRegistration(registry, category);
>> +            } catch (Throwable t) {
>> +                System.err.println("Caught and handled this 
>> exception :");
>> +                t.printStackTrace();
>> +            }
>>          }
>>
>>          return !present;
>>
>
>




More information about the 2d-dev mailing list