<Swing Dev> [9] Review request for 6882559: new JEditorPane("text/plain", "") fails for null context class loader
mikhail cherkasov
mikhail.cherkasov at oracle.com
Tue May 17 15:02:27 UTC 2016
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/20160517/c88ef927/attachment.html>
More information about the swing-dev
mailing list