harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
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 GMT
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);



Mime
View raw message