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] Created: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list
Date Mon, 25 Dec 2006 16:42:21 GMT
[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


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