Reviewer needed - fix for Re: Strange behaviour during javaws -about
Pavel Tisnovsky
ptisnovs at redhat.com
Tue Mar 1 00:40:15 PST 2011
> This was what was really confusing me. The "new Runnable() {...}" bit is
> really an inner class, Main$1. Main and HTMLPanel are loaded by netx
> itself (which has permissions to access any package), but Main$1 is
> loaded by Main, which does not have access to the package
> net.sourceforge.jnlp.about. So keeping the invokeLater causes an
> AccessControlException (as Main tries to access
> net.sourceforge.jnlp.about.Main$1), while removing it makes the
> untrusted about application work.
>
> The correct fix, IMHO, would be to change the package of about, so
> about.jar can access all it's own classes without security exceptions.
> On the other hand, I think that may be an overly complex solution;
> removing invokeLater works for now (thought it may break at some point).
>
> Does anyone else have any thoughts about this?
>
Hi Omair and Jiri,
well one (ugly) solution exists: you can create new class implementing
Runnable and inside this class it's run() method can call public method
createAndShowGui() from Main by using reference to instance of Main -
it's definitely not the clearest solution but should work:
class GUIAsynchronousThread implements Runnable {
private Main main = null;
public GUIAsynchronousThread(Main main) {
this.main = main;
}
public void run() {
main.createAndShowGui();
}
}
More information about the distro-pkg-dev
mailing list