[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-2d-dev
Subject: Re: [OpenJDK 2D-Dev] RFR: 8154860 ImageIO.getImageReadersByFormatName() fails when jai_imageio
From: Brian Burkhalter <brian.burkhalter () oracle ! com>
Date: 2016-05-25 21:14:10
Message-ID: C67E7987-14EA-47D3-9915-AE7FD4C55BB7 () oracle ! com
[Download RAW message or body]
I think this is satisfactory.
+1
Brian
On May 20, 2016, at 2:03 PM, Phil Race <philip.race@oracle.com> wrote:
> The jai_imageio code parses the version string before
> it does anything with the result. And the only thing
> it intends to do is tweak the registruy ordering or
> remove itself if it thinks the JDK version is high enough.
> So I don't see the harm in this versus not adding it to
> the registry at all.
>
> Theoretically a different plugin that had a fatal error
> as a result of this probably should not be registered
> but there can't be existing examples of that on JDK 1.8
> and even if there were a problem on 9 they'll get
> the exception printed ..
>
> -phil.
>
> On 05/20/2016 01:55 PM, Brian Burkhalter wrote:
> > 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 <philip.race@oracle.com> 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;
> > >
> >
>
[Attachment #3 (unknown)]
<html><head><meta http-equiv="Content-Type" content="text/html \
charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space;">I think this is \
satisfactory.<div><br></div><div>+1</div><div><br></div><div>Brian</div><div><br><div \
style=""><div>On May 20, 2016, at 2:03 PM, Phil Race <<a \
href="mailto:philip.race@oracle.com">philip.race@oracle.com</a>> wrote:</div><br \
class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
<div text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">The jai_imageio code parses the version
string before<br>
it does anything with the result. And the only thing<br>
it intends to do is tweak the registruy ordering or<br>
remove itself if it thinks the JDK version is high enough.<br>
So I don't see the harm in this versus not adding it to<br>
the registry at all.<br>
<br>
Theoretically a different plugin that had a fatal error<br>
as a result of this probably should not be registered<br>
but there can't be existing examples of that on JDK 1.8<br>
and even if there were a problem on 9 they'll get<br>
the exception printed ..<br>
<br>
-phil.<br>
<br>
On 05/20/2016 01:55 PM, Brian Burkhalter wrote:<br>
</div>
<blockquote cite="mid:FA59BEB0-EC34-46FE-8CB0-8C35CCA5398D@oracle.com" \
type="cite"> <meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
These statements
<div><br>
</div>
<div>
<div style="margin: 0px; font-size: 11px; font-family: Courier;">
map.put(provider.getClass(), provider);</div>
<div style="margin: 0px; font-size: 11px; font-family: Courier;">
poset.add(provider);</div>
</div>
<div><br>
</div>
<div>occur before the “ if (provider instanceof
RegisterableService)” block. Do we really want the provider
added to that map and set if the Throwable occurs?</div>
<div><br>
</div>
<div>Brian</div>
<div><br>
</div>
<div>
<div>
<div>On May 20, 2016, at 1:07 PM, Phil Race <<a moz-do-not-send="true" \
href="mailto:philip.race@oracle.com">philip.race@oracle.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">Please review the following workaround
for :-<br>
<a moz-do-not-send="true" \
href="https://bugs.openjdk.java.net/browse/JDK-8154860">https://bugs.openjdk.java.net/browse/JDK-8154860</a><br>
<br>
-phil.<br>
<br>
---
a/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java<br>
+++
b/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java<br>
@@ -770,7 +770,12 @@<br>
poset.add(provider);<br>
if (provider instanceof \
RegisterableService) {<br>
RegisterableService \
rs = (RegisterableService)provider;<br>
+ try \
{<br>
rs.onRegistration(registry, \
category);<br>
+ } \
catch (Throwable t) {<br>
+ System.err.println("Caught \
and handled this exception :");<br>
+ t.printStackTrace();<br>
+ }<br>
}<br>
<br>
return !present;<br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</blockquote></div><br></div></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic