You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Kevin Zhou (JIRA)" <ji...@apache.org> on 2009/03/30 08:37:50 UTC

[jira] Commented: (HARMONY-6136) [classlib][luni] java.net.URLClassLoader never finds resources existing in the jars specified from META-INF/INDEX.LIST

    [ https://issues.apache.org/jira/browse/HARMONY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693672#action_12693672 ] 

Kevin Zhou commented on HARMONY-6136:
-------------------------------------

hyts_1.jar, hyts_2.jar and hyts_3.jar can be found in the support materials.

> [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.0M8
>            Reporter: Kevin Zhou
>             Fix For: 5.0M9
>
>
> 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.