Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 29876 invoked from network); 10 Nov 2006 10:16:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Nov 2006 10:16:00 -0000 Received: (qmail 17275 invoked by uid 500); 10 Nov 2006 10:16:11 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 17252 invoked by uid 500); 10 Nov 2006 10:16:11 -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 17241 invoked by uid 99); 10 Nov 2006 10:16:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Nov 2006 02:16:11 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Nov 2006 02:15:59 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 46DEE7142F5 for ; Fri, 10 Nov 2006 02:15:39 -0800 (PST) Message-ID: <22578907.1163153739287.JavaMail.jira@brutus> Date: Fri, 10 Nov 2006 02:15:39 -0800 (PST) From: "Pavel Pervov (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-1932) [drlvm] ClassLoader.defineClass() method should throw LinkageError if it's called more that once for the same class. In-Reply-To: <7830327.1161350737198.JavaMail.jira@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-1932?page=comments#action_12448696 ] Pavel Pervov commented on HARMONY-1932: --------------------------------------- Patch is applied as expected. Verified on revision 473296. Thanks. > [drlvm] ClassLoader.defineClass() method should throw LinkageError if it's called more that once for the same class. > -------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-1932 > URL: http://issues.apache.org/jira/browse/HARMONY-1932 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: IA32, WinXP > Reporter: Mikhail Markov > Assigned To: Gregory Shimansky > Attachments: H1932.patch, LinkageErrorTest.zip > > > The test below called 2 times method defineClass() of ClassLoader for the same class: > ----------------------- Test.java ------------------------- > public class Test { > public static void main(String[] args) throws Exception { > ClassLoader loader = new TestClassLoader(); > loader.loadClass("/TestClass"); > try { > loader.loadClass("/TestClass"); > System.out.println("Test failed."); > } catch (LinkageError le) { > System.out.println("Test passed: " + le); > } > } > static class TestClassLoader extends ClassLoader { > /* > * Byte array of bytecode equivalent to the following source code: > * public class TestClass { > * } > */ > private byte[] classData = new byte[] { > -54, -2, -70, -66, 0, 0, 0, 49, 0, 13, > 10, 0, 3, 0, 10, 7, 0, 11, 7, 0, > 12, 1, 0, 6, 60, 105, 110, 105, 116, 62, > 1, 0, 3, 40, 41, 86, 1, 0, 4, 67, > 111, 100, 101, 1, 0, 15, 76, 105, 110, 101, > 78, 117, 109, 98, 101, 114, 84, 97, 98, 108, > 101, 1, 0, 10, 83, 111, 117, 114, 99, 101, > 70, 105, 108, 101, 1, 0, 14, 84, 101, 115, > 116, 67, 108, 97, 115, 115, 46, 106, 97, 118, > 97, 12, 0, 4, 0, 5, 1, 0, 9, 84, > 101, 115, 116, 67, 108, 97, 115, 115, 1, 0, > 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, > 47, 79, 98, 106, 101, 99, 116, 0, 33, 0, > 2, 0, 3, 0, 0, 0, 0, 0, 1, 0, > 1, 0, 4, 0, 5, 0, 1, 0, 6, 0, > 0, 0, 29, 0, 1, 0, 1, 0, 0, 0, > 5, 42, -73, 0, 1, -79, 0, 0, 0, 1, > 0, 7, 0, 0, 0, 6, 0, 1, 0, 0, > 0, 1, 0, 1, 0, 8, 0, 0, 0, 2, > 0, 9 }; > protected Class findClass(String name) throws ClassNotFoundException { > if (name.equals("/TestClass")) { > return defineClass(null, classData, 0, classData.length); > } else { > throw new ClassNotFoundException("Class " + name + " not found."); > } > } > } > } > ------------------------------------------------ > Output on RI: > Test passed: java.lang.LinkageError: duplicate class definition: TestClass > Output on Harmony: > Test failed. -- 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