These statements
map.put(provider.getClass(), provider);
poset.add(provider);
occur before the “ if (provider instanceof RegisterableService)” block. Do we
really want the provider added to that map and set if the Throwable occurs?
Brian
On May 20, 2016, at 1:07 PM, Phil Race <[email protected]> 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;
>