[icedtea-web] RFC: fix null dtd for swing applications rendering html
Omair Majid
omajid at redhat.com
Tue Oct 26 15:17:23 PDT 2010
On 10/26/2010 04:33 PM, Deepak Bhole wrote:
> * Omair Majid<omajid at redhat.com> [2010-10-26 15:46]:
>> Hi,
>>
>> There has been a regression in netx: applications that render html
>> (using Swing components) now fail with a null pointer exception.
>> This problem can be reproduced by running the program at [1].
>>
>
> What caused this regression? I thought all the app context stuff was
> still disabled, with just the support added on the side?
>
>> The problem is caused by how HTMLEditorKit/HTMLDocument and
>> ParserDelgator interact in the presence of multiple AppContexts. The
>> instance of the ParserDelegate is shared between multiple
>> HTMLEditorKit in different AppContexts. However, ParserDelegate
>> maintains a per-AppContext dtd instance. The dtd is valid in the
>> AppContext that created the ParserDelegate but null in all other
>> AppContexts. Using this null dtd throws a NullPointerException. This
>> is really a bug in OpenJDK6 rather than Netx. Fortunately, this bug
>> has been fixed in OpenJDK7 - ParserDelegate maintains an instance of
>> the dtd per runtime instead of per AppContext.
>>
>> The attached patch works around this bug. It manually creates a
>> ParserDelegate for each AppContext to avoid this problem.
>>
>
> Assuming you have tested this, OK for head.
>
Thanks. Pushed to HEAD.
Cheers,
Omair
More information about the distro-pkg-dev
mailing list