Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 39489 invoked from network); 26 Oct 2006 00:22:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 00:22:07 -0000 Received: (qmail 94369 invoked by uid 500); 24 Oct 2006 08:15:30 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 94337 invoked by uid 500); 24 Oct 2006 08:15:30 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 94326 invoked by uid 99); 24 Oct 2006 08:15:30 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2006 01:15:30 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2006 01:15:15 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B86127142BF for ; Tue, 24 Oct 2006 01:14:17 -0700 (PDT) Message-ID: <18368968.1161677657752.JavaMail.root@brutus> Date: Tue, 24 Oct 2006 01:14:17 -0700 (PDT) From: "Mikhail Markov (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Updated: (HARMONY-1944) [classlib][rmi] default RMIClassLoader provider should not sort codebase URLs In-Reply-To: <24673083.1161675436567.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/HARMONY-1944?page=all ] Mikhail Markov updated HARMONY-1944: ------------------------------------ Attachment: DefaultRMIClassLoaderSpi.2.patch Here is the patch fixing the problem. It's based on proposed fix in HARMONY-1936. > [classlib][rmi] default RMIClassLoader provider should not sort codebase URLs > ----------------------------------------------------------------------------- > > Key: HARMONY-1944 > URL: http://issues.apache.org/jira/browse/HARMONY-1944 > Project: Harmony > Issue Type: Bug > Components: Classlib > Environment: IA32, WinXP > Reporter: Mikhail Markov > Attachments: DefaultRMIClassLoaderSpi.2.patch > > > Default RMIClassLoader provider (org.apache.harmony.rmi.DefaultRMIClassLoaderSpi) should retain the order of incoming codebase URLs. Currently it sorts the list, which is demonstrated by the test below (note: TestClass.class should be put to testClasses.jar file and should be accessible through http server on localhost and 8080 port ): > Output on RI: > Test passed. > Output on Harmony: > URL[0].getPath() = /fake.jar, expected: /testClasses.jar > URL[1].getPath() = /testClasses.jar, expected: /fake.jar > Test failed. > ------------Test.java------------- > import java.net.URL; > import java.net.URLClassLoader; > import java.rmi.server.RMIClassLoader; > public class Test { > public static void main(String[] args) throws Exception { > System.setProperty("java.security.policy", "policy.all"); > System.setSecurityManager(new SecurityManager()); > String[] pathes = new String[] { "/testClasses.jar", "/fake.jar" }; > Class c = RMIClassLoader.loadClass("http://localhost:8080" > + pathes[0] + " http://localhost:8080" + pathes[1], > "TestClass", null); > ClassLoader cl = c.getClassLoader(); > if (cl instanceof URLClassLoader) { > URL[] urls = ((URLClassLoader) cl).getURLs(); > if (urls.length != 2) { > System.out.println("Test failed, unexpected number of URLs: " + urls.length); > return; > } > boolean failed = false; > for (int i = 0; i < urls.length; ++i) { > if (!urls[i].getPath().equals(pathes[i])) { > System.out.println("URL[" + i + "].getPath() = " > + urls[i].getPath() +", expected: " + pathes[i]); > failed = true; > } > } > if (failed) { > System.out.println("Test failed."); > } else { > System.out.println("Test passes."); > } > } else { > System.out.println("Test failed, class is loaded by non-URLClassLoader"); > } > } > } > ------------TestClass.java--------------- > public class TestClass { > } -- 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