Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 34335 invoked from network); 24 Nov 2006 14:15:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Nov 2006 14:15:25 -0000 Received: (qmail 9328 invoked by uid 500); 24 Nov 2006 14:15:35 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 9296 invoked by uid 500); 24 Nov 2006 14:15:34 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 9287 invoked by uid 99); 24 Nov 2006 14:15:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Nov 2006 06:15:34 -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, 24 Nov 2006 06:15:24 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9F9DA7142C3 for ; Fri, 24 Nov 2006 06:15:04 -0800 (PST) Message-ID: <16208702.1164377704651.JavaMail.jira@brutus> Date: Fri, 24 Nov 2006 06:15:04 -0800 (PST) From: "Nikolay Chugunov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-1756) Dynamic class loading work incorrectly 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-1756?page=comments#action_12452464 ] Nikolay Chugunov commented on HARMONY-1756: ------------------------------------------- It is better to use standalone test from my comment, which can automatically detect incorrcet environment. > 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 > Assigned To: Gregory Shimansky > > 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