harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-6136) [classlib][luni] java.net.URLClassLoader never finds resources existing in the jars specified from META-INF/INDEX.LIST
Date Tue, 14 Apr 2009 01:40:15 GMT

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

Kevin Zhou closed HARMONY-6136.
-------------------------------


Patch has been successfully applied. Thanks!

> [classlib][luni] java.net.URLClassLoader never finds resources existing in the jars specified
from META-INF/INDEX.LIST
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6136
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6136
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>         Attachments: HARMONY-6136.diff
>
>
> Given a test case [1], RI and HY works differently. 
> Reproduce Steps:
> (1) Create a URLClassLoader object using a url of "hyts_1.jar" and a null classloader.
> (2) The META-INF/INDEX.LIST of "hyts_1.jar" specifies some index [2]
> (3) Invoke URLClassLoader.findResource("bpack/") to find "bpack" package.
> RI outputs:
> jar:file:/C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/hyts_resources60467/JarIndex/hyts_22.jar!/bpack/
> HY prints:
> null
> Thus, RI can successfully find resources existing in the jars specified from META-INF/INDEX.LIST
but HY can't.
> [1] Test Case:
> public class URLClassLoaderTest extends TestCase {
> public void test_findResources() throws Exception {
> File resources = Support_Resources.createTempFolder();
> String resPath = resources.toString();
> if (resPath.charAt(0) == '/' || resPath.charAt(0) == ' ') { resPath = resPath.substring(1);
}
> Support_Resources.copyFile(resources, "JarIndex", "hyts_21.jar");
> Support_Resources.copyFile(resources, "JarIndex", "hyts_22.jar");
> Support_Resources.copyFile(resources, "JarIndex", "hyts_23.jar");
> URLClassLoader urlClassloader = URLClassLoader.newInstance(new URL[] { new URL("file:/"
+ resPath + "/JarIndex/hyts_21.jar") }, null);
> System.out.println(urlClassloader.findResource("bpack/"));}}
> [2] The content of META-INF/INDEX.LIST of "hyts_1.jar"
> hyts_21.jar
> apack
> hyts_22.jar
> bpack
> bpack/test
> hyts_23.jar
> cpack
> Main2.class
> Main3.class
> bpack

-- 
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