Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 34074 invoked from network); 6 Oct 2006 13:54:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Oct 2006 13:54:40 -0000 Received: (qmail 24933 invoked by uid 500); 6 Oct 2006 13:54:38 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 24904 invoked by uid 500); 6 Oct 2006 13:54:38 -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 24864 invoked by uid 99); 6 Oct 2006 13:54:37 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Oct 2006 06:54:37 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:37281] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id A6/21-24193-B1066254 for ; Fri, 06 Oct 2006 06:54:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 21E7F7141F5 for ; Fri, 6 Oct 2006 06:54:21 -0700 (PDT) Message-ID: <11375491.1160142861136.JavaMail.root@brutus> Date: Fri, 6 Oct 2006 06:54:21 -0700 (PDT) From: "Nikolay Chugunov (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Created: (HARMONY-1756) Dynamic class loading work incorrectly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dynamic class loading work incorrectly -------------------------------------- Key: HARMONY-1756 URL: http://issues.apache.org/jira/browse/HARMONY-1756 Project: Harmony Issue Type: Bug Components: DRLVM Reporter: Nikolay Chugunov Dynamic class loading work incorrectly: Code for reproduction: import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import junit.framework.TestCase; public class Bug extends TestCase { private static String className = "EmptyClass"; public void test() throws Exception { MyClassLoader classLoader = new MyClassLoader(); System.out.println("Check point"); classLoader.loadClass(className).newInstance(); System.out.println("PASSED"); } private class MyClassLoader extends ClassLoader { private MyClassLoader() throws IOException { InputStream in = new FileInputStream( "C:\\" + className + ".class"); byte[] b = new byte[in.available()]; in.read(b); in.close(); defineClass(className, b, 0, b.length); } } } public class EmptyClass{ } To reproduce compile classes and then move EmptyClass class to C:\ directory which is not in class path and then run this test. Output on RI 1.5: Check point PASSED Output on Harmony r450941: Check point java.lang.ClassNotFoundException: Can not find class EmptyClass at java.lang.ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at Bug.test(Bug.java:15) -- 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