[RFC][icedtea-web] BasicService code does not work if used in applet constructors

Danesh Dadachanji ddadacha at redhat.com
Mon Dec 19 08:51:42 PST 2011


Hi,

When looking up BasicService, ServiceManager uses JNLPClassLoader's app 
var. This is setup when the application/applet is created. However, if 
BasicService code is used in the applet's constructor, it will produce 
an incomplete basic service var (i.e most vars are set to null).

I've move the applet initialization code after the loader's app variable 
is set. However, in order to set the app, I've modified the 
initialization of AppletInstance to take a null parameter in place of 
the applet. I went through the code but found no use of this applet var 
until after the call to createApplet (i.e. after the var has been set). 
It is possible for another thread to access the AppletInstnace's applet 
var before it is actually set but there is no code in icedtea-web doing 
that so far.

ChangeLog:
+2011-12-19  Danesh Dadachanji <ddadacha at redhat.com>
+
+ Fix for BasicService being used in applet constructors but not
+ having access to ApplicationInstance variable.
+ * netx/net/sourceforge/jnlp/Launcher.java:
+ (createApplet): Moved applet initialization below loader.setApplication,
+ appletInstance is now initialized with applet param as null.
+ * netx/net/sourceforge/jnlp/runtime/AppletInstance.java:
+ (setApplet): New method, allows setting of AppletInstance's applet
+ only once.
+

Regards,
Danesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jnlp_href-01.patch
Type: text/x-patch
Size: 2288 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20111219/ee27f3f7/jnlp_href-01.patch 


More information about the distro-pkg-dev mailing list