harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list
Date Mon, 25 Dec 2006 17:22:24 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2871?page=all ]

Mikhail Markov updated HARMONY-2871:
------------------------------------

    Attachment: URLClassLoader.patch

Here is the patch for the class loader - it modifies the way URLClassLoader deals with invalid
urls: it does not set the invalid urls to null in the internal list but put them into internal
"excluded" list instead.

> [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its
urls list
> ------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2871
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2871
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: WinXP
>            Reporter: Mikhail Markov
>            Priority: Critical
>         Attachments: URLClassLoader.patch
>
>
> The test below passed on RI, but fails on Harmony.
> Output on Harmony:
> FAILED: java.lang.NullPointerException
> Output on RI:
> PASSED.
> The cause is that URLClassLoader sets URL's in it's internal list which it could not
open to null and throws NPE during the next attempt to load the class.
> -------------------- Test.java ------------------------
> import java.net.URL;
> import java.net.URLClassLoader;
> public class Test {
>     public static void main(String [] args) throws Exception {
>         URLClassLoader cl = new URLClassLoader(new URL[] { new URL("file:/c:/foo.jar")
});
>         try {
>             Class.forName("foo.Foo", false, cl);
>         } catch (Exception ex) {
>             // Don't care
>         }
>         try {
>             Class.forName("foo.Foo", false, cl);
>             System.out.println("FAILED: no exceptions");
>         } catch (ClassNotFoundException cnfe) {
>             System.out.println("PASSED.");
>         } catch (Exception ex) {
>             System.out.println("FAILED: " + ex);
>         }
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message