harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Liang (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-2237) [classlib][luni]URLClassLoader should not throw NullPointerException in special cases.
Date Fri, 02 Feb 2007 06:05:05 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-2237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Richard Liang resolved HARMONY-2237.
------------------------------------

    Resolution: Fixed

Hello Ruth,

The patch has been committed at revision r502513. Thanks a lot for this enhancement. Please
verify this issue is fixed as you expected.

Best regards,
Richard

> [classlib][luni]URLClassLoader should not throw NullPointerException in special cases.
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2237
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2237
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Jimmy, Jing Lv
>         Assigned To: Richard Liang
>         Attachments: Harmony-2237.diff
>
>
> Hi,
>      URLClassLoader should not throw NullPointerException in a special case, testcase:
> public class TestURLClassLoader extends TestCase {
>     public void test_getResource() throws Exception {
>         String classPath = System.getProperty("java.class.path");
>         URL url = new URL("file:"
>                 + new StringTokenizer(classPath, File.pathSeparator)
>                         .nextToken() + Support_Resources.RESOURCE_PACKAGE
>                 + "subfolder/");
>         ClassLoader URLLoader = new URLClassLoader(new URL[]{url}, null);
>         URLLoader = getURLClassLoader();
>         URLLoader.getResource("XXX");
>     }
>     
>     static URLClassLoader getURLClassLoader() {
>         String classPath = System.getProperty("java.class.path");
>         StringTokenizer tok = new StringTokenizer(classPath, File.pathSeparator);
>         Vector urlVec = new Vector();
>         String resPackage = Support_Resources.RESOURCE_PACKAGE;
>         try {
>             while (tok.hasMoreTokens()) {
>                 String path = (String) tok.nextToken();
>                 String url;
>                 if (new File(path).isDirectory())
>                     url = "file:" + path + resPackage + "subfolder/";
>                 else
>                     url = "jar:file:" + path + "!" + resPackage + "subfolder/";
>                 urlVec.addElement(new URL(url));
>             }
>         } catch (MalformedURLException e) {
>         }
>         URL[] urls = new URL[urlVec.size()];
>         for (int i = 0; i < urlVec.size(); i++)
>             urls[i] = (URL) urlVec.elementAt(i);
>         URLClassLoader loader = new URLClassLoader(urls, null);
>         return loader;
>     }
> }
>       RI passes, and Harmony throws a NPE. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message