Regression in icedtea-web - parent classsloader have been stopped to be invoked

Adam Domurad adomurad at redhat.com
Mon Dec 17 12:34:45 PST 2012


On 12/17/2012 09:46 AM, Jiri Vanek wrote:
> After this commit -
>  changeset:   514:855087771e7e
>  tag:         tip
>  user:        Adam Domurad <adomurad at redhat.com>
>  date:        Tue Aug 28 14:36:06 2012 -0400
>  summary:     Fix for PR920: Classes attempted to load twice when 
> class extends from outside jar
>
> There is regression that parent class loader is never used for 
> searching in classes. I blame also review a lot (me:-/) because 
> unittest was broken by this commit.
>
> See: 
> CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication 
> as reproducer.
>
> Sorry for late notification,
>   J.

Thanks for pointing this out (or rather forcing me to accept this wasn't 
a bad-test, quite good one in fact :), easy fix:

2012-XX-XX  Adam Domurad  <adomurad at redhat.com>

     Fix breakage in unit test 
CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication
     * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
     (CodeBaseClassLoader#findClassNonRecursive): New, call into
     URLClassLoader#findClass
     (CodeBaseClassLoader#findClass): Delegate JNLPClassLoader#findClass
     (JNLPClassLoader#findClass): Call 
CodeBaseClassLoader#findClassNonRecursive
     * 
tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java
     (init): Add applet finish message.
     * 
tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java
     (testClassInAppletFolder): Close quickly on applet finish message.


The basics of it come down to that the original code (pre-patch) was 
essentially correct except it did:
-            if (!recursivelyInvoked) {
-                try {
-                    return parentJNLPClassLoader.findClass(name);
-                } catch (ClassNotFoundException cnfe) { <<<< This 
should not have been squelched
-                    // continue
-                }
-            }

The reproducer (AppletExtendsFromOutsideJar) works with the original 
(pre -r514) version with the try and catch gone. The specifics are hard 
for me to determine but it does cause the body of 
CodeBaseLoader#findClass to potentially occur twice on a CNFE.

Thanks!
-Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixunittest-askedforparent.patch
Type: text/x-patch
Size: 3614 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121217/4348069c/fixunittest-askedforparent.patch 


More information about the distro-pkg-dev mailing list