harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r489862 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
Date Sat, 23 Dec 2006 07:04:04 GMT
Author: gshimansky
Date: Fri Dec 22 23:04:02 2006
New Revision: 489862

URL: http://svn.apache.org/viewvc?view=rev&rev=489862
Log:
Applied HARMONY-2851 [drlvm] ClassCircularityError cannot be thrown from class loader.

Tests passed on Ubuntu6 x86, WindowsXP and SuSE9 x86_64


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp?view=diff&rev=489862&r1=489861&r2=489862
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Fri Dec 22 23:04:02
2006
@@ -1487,12 +1487,20 @@
                                        const String* className)
 {
     assert(env == m_env);
+    assert(!exn_raised());
+
     Class* klass = StartLoadingClass(m_env, className);
 
     if(klass != NULL) {
         // class is already loaded so return it
         return klass;
     }
+    if(exn_raised()) {
+        // this is most probably ClassCircularityError
+        // detected in StartLoadingClass
+        return NULL;
+    }
+
     TRACE2("classloader.load", "Loader (" << this << ") loading class: " <<
className->bytes << "...");
 
     // Not in the class cache: load the class or, if an array class, create it
@@ -1510,12 +1518,18 @@
 {
     ASSERT_RAISE_AREA;
     assert(m_loader != NULL);
+    assert(!exn_raised());
 
     Class* klass = StartLoadingClass(env, className);
 
     if(klass != NULL) {
         return klass;
     }
+    if(exn_raised()) {
+        // this is most probably ClassCircularityError
+        // detected in StartLoadingClass
+        return NULL;
+    }
 
     TRACE2("classloader.load", "Loader U (" << this << ") loading class: " <<
className->bytes << "...");
 
@@ -1544,7 +1558,6 @@
     //  * (Ljava/lang/String;Z) is not abstract in current JDK version
     //  * Generally (Ljava/lang/String;) are overloaded
     assert(hythread_is_suspend_enabled());
-    assert(!exn_raised());
     tmn_suspend_disable();
 
     jvalue args[2];



Mime
View raw message