<Swing Dev> [9] Review request for 6882559: new JEditorPane("text/plain", "") fails for null context class loader
Alexey Ivanov
alexey.ivanov at oracle.com
Wed May 18 10:30:48 UTC 2016
Hi Mikhail,
Looks fine.
Shouldn't the test be put in its own directory?
Regards,
Alexey
On 17.05.2016 18:02, mikhail cherkasov wrote:
> Hello all,
>
> Could you please review a fix for:
> https://bugs.openjdk.java.net/browse/JDK-6882559
>
> webrev: http://cr.openjdk.java.net/~mcherkas/6882559/webrev.00/
>
> The problem is that JTextPane during initialization saves
> Thread.contextClassloader which is null, but class loader is a
> null and Hashtable, which is used to store class loader, doesn't
> support a
> null value as result we get an exception. However JTextPane doesn't
> need to save
> Thread.contextClassloader, it's optional:
> http://hg.openjdk.java.net/jdk9/client/jdk/file/fb38b0925915/src/java.desktop/share/classes/javax/swing/JEditorPane.java#l1192
> so it will work fine even if ClassLoader is null.
> To fix the exception I wrapped a classloader into Optional before to
> put it into Hashtable.
>
> Thanks,
> Mikhail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20160518/30a6e7a8/attachment.html>
More information about the swing-dev
mailing list