cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1055150 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java
Date Tue, 04 Jan 2011 19:33:00 GMT
Author: dkulp
Date: Tue Jan  4 19:33:00 2011
New Revision: 1055150

URL: http://svn.apache.org/viewvc?rev=1055150&view=rev
Log:
[CXF-3215] Make sure only one version of each class is attempted to be
created.

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java?rev=1055150&r1=1055149&r2=1055150&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java Tue Jan
 4 19:33:00 2011
@@ -184,7 +184,13 @@ public class ASMHelper {
     
     public Class<?> loadClass(String className, Class clz , byte[] bytes) { 
         TypeHelperClassLoader loader = getTypeHelperClassLoader(clz);
-        return loader.defineClass(className, bytes);
+        synchronized (loader) {
+            Class<?> cls = loader.lookupDefinedClass(className);
+            if (cls == null) {
+                return loader.defineClass(className, bytes);
+            }
+            return cls;
+        }
     }
     public Class<?> findClass(String className, Class clz) { 
         TypeHelperClassLoader loader = getTypeHelperClassLoader(clz);



Mime
View raw message