harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r600961 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src: class_support/classloader.cpp kernel_classes/javasrc/java/lang/Class.java
Date Tue, 04 Dec 2007 14:18:18 GMT
Author: gshimansky
Date: Tue Dec  4 06:18:18 2007
New Revision: 600961

URL: http://svn.apache.org/viewvc?rev=600961&view=rev
Log:
Applied patch from HARMONY-5242
[drlvm][classloader] Error during concurrent deserialization of hashtable


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java

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?rev=600961&r1=600960&r2=600961&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Tue Dec  4 06:18:18
2007
@@ -1741,7 +1741,9 @@
 void ClassLoader::InsertInitiatedClass(Class* clss)
 {
     LMAutoUnlock aulock(&m_lock);
-    m_initiatedClasses->Insert(clss->get_name(), clss);
+    if(!m_initiatedClasses->Lookup(clss->get_name())) {
+        m_initiatedClasses->Insert(clss->get_name(), clss);
+    }
 }
 
 void BootstrapClassLoader::ReportAndExit(const char* exnclass, std::stringstream& exnmsg)


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=600961&r1=600960&r2=600961&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
Tue Dec  4 06:18:18 2007
@@ -149,10 +149,12 @@
         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
+        if(classLoader != null) {
+            // Although class loader may have had a chance to register
+            // itself as initiating for requested class, there may occur
+            // a classloader which overloads loadClass method (though it is
+            // not recommended by J2SE specification).
+            // Try to register initiating loader for clazz from here again
             classLoader.registerInitiatedClass(clazz);
         }
         if (initialize) {



Mime
View raw message