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:35:51 UTC
[jira] Created: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never find resources existing in the jars specified
from META-INF/INDEX.LIST
[classlib][luni] java.net.URLClassLoader never find 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.
[jira] Closed: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Commented: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698308#action_12698308 ]
Kevin Zhou commented on HARMONY-6136:
-------------------------------------
This patch fixes an endless recursion which results in a java.lang.StackOverflowError.
In addition, this patch implements local site testing of URLClassLoader and fixes several failures and errros of URLClassLoaderTest.
> [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
>
> 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.
[jira] Resolved: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Beyer resolved HARMONY-6136.
-----------------------------------
Resolution: Fixed
Patch applied at r764657. Please verify that the patch was applied correctly.
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.
[jira] Assigned: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Beyer reassigned HARMONY-6136:
-------------------------------------
Assignee: Nathan Beyer
> [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
> Assignee: Nathan Beyer
> Fix For: 5.0M9
>
> 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.
[jira] Updated: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Beyer updated HARMONY-6136:
----------------------------------
Patch Info: [Patch Available]
Affects Version/s: (was: 5.0M8)
5.0M9
Fix Version/s: (was: 5.0M9)
> [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.
[jira] Commented: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison updated HARMONY-6136:
---------------------------------
Fix Version/s: 5.0M10
> [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
> Fix For: 5.0M10
>
> 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.
[jira] Updated: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Zhou updated HARMONY-6136:
--------------------------------
Summary: [classlib][luni] java.net.URLClassLoader never finds resources existing in the jars specified from META-INF/INDEX.LIST (was: [classlib][luni] java.net.URLClassLoader never find resources existing in the jars specified from META-INF/INDEX.LIST)
> [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.
[jira] Updated: (HARMONY-6136) [classlib][luni]
java.net.URLClassLoader never finds resources existing in the jars
specified from META-INF/INDEX.LIST
Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Zhou updated HARMONY-6136:
--------------------------------
Attachment: HARMONY-6136.diff
Would you please help to try it?
> [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
>
> 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.