[icedtea-web] RFC: fix null dtd for swing applications rendering html
Dr Andrew John Hughes
ahughes at redhat.com
Tue Oct 26 15:58:33 PDT 2010
On 16:57 Tue 26 Oct , Omair Majid wrote:
> Hi Deepak,
>
> Thanks for taking a look at this!
>
> On 10/26/2010 04:33 PM, Deepak Bhole wrote:
> > * Omair Majid<omajid at redhat.com> [2010-10-26 15:46]:
> >> 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 regression itself was caused by having security dialogs in one
> AppContext and the actual application in another AppContext.
>
> The AppContext stuff is enabled and working (in fact, some of the
> AppContext code was part of the original import of Netx into IcedTea and
> has been active ever since - most of my recent patches are about
> enabling it in the plugin case too and using AppContext correctly to
> gain its benefits). It is what allows multiple applets to have their own
> look and feels and allows security dialogs to always use the system look
> and feel without setting the look and feel of applets (or jnlp
> applications) too. I thought I had made it pretty explicit in my patches
> and changelogs :(
>
> What is still disabled is allowing applets/applications to access their
> individual EventQueues. This is because of a security patch that has
> been recently been committed to OpenJDK7. This patch provides some
> additional API and says (and I am paraphrasing): "here is some API that
> allows the proprietary plugin to check if AWT events are generated by
> the system". I dont know how to make use of it, so I havent added code
> to allow applets to access their EventQueues. At least one application -
> a swing demo, no less [1] - fails without this.
>
Do you have a link to this patch? We should probably backport it.
> >> 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
> Omair
>
> [1] http://download.oracle.com/javase/tutorial/ui/overview/demo.html
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
More information about the distro-pkg-dev
mailing list