harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r599462 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang: Class.java ClassLoader.java
Date Thu, 29 Nov 2007 14:50:54 GMT
Author: gshimansky
Date: Thu Nov 29 06:50:53 2007
New Revision: 599462

URL: http://svn.apache.org/viewvc?rev=599462&view=rev
Log:
Applied patch from HARMONY-5218
[drlvm][kernel] null may be passed to registerInitiatedClass if class loader does not throw
ClassNotFoundException for missing classes


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
    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/Class.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java?rev=599462&r1=599461&r2=599462&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
Thu Nov 29 06:50:53 2007
@@ -146,14 +146,14 @@
                 clazz = classLoader.loadClass(name);
             }
         }
+        if(clazz == null) {
+            throw new ClassNotFoundException(name);
+        }
         if(classLoader != null && classLoader.findLoadedClass(name) == null) {
             // classloader overloads loadClass method though it is not
             // generally recommended
             // have to register initiating loader for clazz from here
             classLoader.registerInitiatedClass(clazz);
-        }
-        if(clazz == null) {
-            throw new ClassNotFoundException(name);
         }
         if (initialize) {
             VMClassRegistry.initializeClass(clazz);

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?rev=599462&r1=599461&r2=599462&view=diff
==============================================================================
--- 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
Thu Nov 29 06:50:53 2007
@@ -574,14 +574,17 @@
             } else {
                 try {
                     clazz = parentClassLoader.loadClass(name);
-                    try {
-                        VMStack.getCallerClass(0)
-                            .asSubclass(ClassLoader.class);
-                    } catch(ClassCastException ex) {
-                        // caller class is not a subclass of java/lang/ClassLoader
-                        // so, register as initiating loader as we are called from
-                        // outside of ClassLoader delegation chain
-                        registerInitiatedClass(clazz);
+                    if(clazz != null) {
+                        try {
+                            VMStack.getCallerClass(0)
+                                    .asSubclass(ClassLoader.class);
+                        } catch(ClassCastException ex) {
+                            // caller class is not a subclass of
+                            // java/lang/ClassLoader so register as
+                            // initiating loader as we are called from
+                            // outside of ClassLoader delegation chain
+                            registerInitiatedClass(clazz);
+                        }
                     }
                 } catch (ClassNotFoundException e) {
                 }



Mime
View raw message