Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 56274 invoked from network); 5 Mar 2007 05:43:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Mar 2007 05:43:36 -0000 Received: (qmail 27555 invoked by uid 500); 5 Mar 2007 05:43:44 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 27538 invoked by uid 500); 5 Mar 2007 05:43:44 -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 27529 invoked by uid 99); 5 Mar 2007 05:43:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2007 21:43:44 -0800 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2007 21:43:35 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 6BC6A1A981A; Sun, 4 Mar 2007 21:43:15 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r514553 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java Date: Mon, 05 Mar 2007 05:43:15 -0000 To: commits@harmony.apache.org From: varlax@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070305054315.6BC6A1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: varlax Date: Sun Mar 4 21:43:13 2007 New Revision: 514553 URL: http://svn.apache.org/viewvc?view=rev&rev=514553 Log: Fixed HARMONY-1172 [kernel] compatibility: ClassLoader.defineClass(...) throws NPE on Harmony and NoClassDefFoundError on RI. Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java?view=diff&rev=514553&r1=514552&r2=514553 ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java Sun Mar 4 21:43:13 2007 @@ -386,6 +386,11 @@ ProtectionDomain domain) throws ClassFormatError { checkInitialized(); + if (name != null && name.indexOf('/') != -1) { + throw new NoClassDefFoundError( + "The name is expected in binary (canonical) form," + + " therefore '/' symbols are not allowed: " + name); + } if (offset < 0 || len < 0 || offset + len > data.length) { throw new IndexOutOfBoundsException( "Either offset or len is outside of the data array"); @@ -403,11 +408,6 @@ if (name.startsWith("java.")) { throw new SecurityException( "It is not allowed to define classes inside the java.* package: " + name); - } - if (name.indexOf('/') != -1) { - throw new NoClassDefFoundError( - "The name is expected in binary (canonical) form," - + " therefore '/' symbols are not allowed: " + name); } int lastDot = name.lastIndexOf('.'); packageName = lastDot == -1 ? "" : name.substring(0, lastDot);