<Swing Dev> [9] Review request for 6882559: new JEditorPane("text/plain", "") fails for null context class loader

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue May 17 16:04:58 UTC 2016


On 17.05.16 18:02, mikhail cherkasov wrote:
> 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:

Can you please clarify on what thread we got null TCCL?

> 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.

-- 
Best regards, Sergey.



More information about the swing-dev mailing list