You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Markov (JIRA)" <ji...@apache.org> on 2006/12/25 17:42:21 UTC

[jira] Created: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list

[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

        

[jira] Resolved: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2871?page=all ]

Alexey Petrenko resolved HARMONY-2871.
--------------------------------------

    Resolution: Fixed

The patch has been applied.
Please verify.

> [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
>         Assigned To: Alexey Petrenko
>            Priority: Critical
>         Attachments: URLClassLoader.patch, URLClassLoaderTest.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

        

[jira] Updated: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list

Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2871?page=all ]

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

    Patch Info: [Patch Available]

> [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, URLClassLoaderTest.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

        

[jira] Updated: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list

Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2871?page=all ]

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

    Attachment: URLClassLoaderTest.patch

Here is the patch adding additional test case for URLClassLoader unit-test.

> [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, URLClassLoaderTest.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

        

[jira] Commented: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list

Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2871?page=comments#action_12460899 ] 
            
Mikhail Markov commented on HARMONY-2871:
-----------------------------------------

Everything is fine - thanks, Alexey!

> [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
>         Assigned To: Alexey Petrenko
>            Priority: Critical
>         Attachments: URLClassLoader.patch, URLClassLoaderTest.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

        

[jira] Updated: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list

Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
     [ 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

        

[jira] Closed: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2871?page=all ]

Alexey Petrenko closed HARMONY-2871.
------------------------------------


> [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
>         Assigned To: Alexey Petrenko
>            Priority: Critical
>         Attachments: URLClassLoader.patch, URLClassLoaderTest.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

        

[jira] Assigned: (HARMONY-2871) [classlib][luni] URLClassLoader invalidates it's state if there is invalid URLs in its urls list

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2871?page=all ]

Alexey Petrenko reassigned HARMONY-2871:
----------------------------------------

    Assignee: Alexey Petrenko

> [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
>         Assigned To: Alexey Petrenko
>            Priority: Critical
>         Attachments: URLClassLoader.patch, URLClassLoaderTest.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