You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2020/12/22 15:47:33 UTC

[cxf] branch 3.4.x-fixes updated: CXF-8340: GraalVM native image fails to run. Fixing synchronization issue (instance vs static)

This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.4.x-fixes by this push:
     new b3d4981  CXF-8340: GraalVM native image fails to run. Fixing synchronization issue (instance vs static)
b3d4981 is described below

commit b3d4981628b605ef6750dcf26900db7bf73fc378
Author: reta <dr...@gmail.com>
AuthorDate: Tue Dec 22 10:21:05 2020 -0500

    CXF-8340: GraalVM native image fails to run. Fixing synchronization issue (instance vs static)
    
    (cherry picked from commit 2f93e6f2a246869d8c1b6fce496f2f833501053a)
---
 .../java/org/apache/cxf/common/spi/ClassGeneratorClassLoader.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/common/spi/ClassGeneratorClassLoader.java b/core/src/main/java/org/apache/cxf/common/spi/ClassGeneratorClassLoader.java
index 442deb5..8cee8ff 100644
--- a/core/src/main/java/org/apache/cxf/common/spi/ClassGeneratorClassLoader.java
+++ b/core/src/main/java/org/apache/cxf/common/spi/ClassGeneratorClassLoader.java
@@ -80,7 +80,8 @@ public class ClassGeneratorClassLoader {
     protected Class<?> findClass(String className, ClassLoader classLoader) {
         return getOrCreateLoader(classLoader).lookupDefinedClass(className);
     }
-    private synchronized TypeHelperClassLoader getOrCreateLoader(Class<?> cls) {
+    
+    private static synchronized TypeHelperClassLoader getOrCreateLoader(Class<?> cls) {
         WeakReference<TypeHelperClassLoader> ref = CLASS_MAP.get(cls);
         TypeHelperClassLoader ret;
         if (ref == null || ref.get() == null) {
@@ -91,7 +92,8 @@ public class ClassGeneratorClassLoader {
         }
         return ret;
     }
-    private synchronized TypeHelperClassLoader getOrCreateLoader(ClassLoader l) {
+    
+    private static synchronized TypeHelperClassLoader getOrCreateLoader(ClassLoader l) {
         WeakReference<TypeHelperClassLoader> ref = LOADER_MAP.get(l);
         TypeHelperClassLoader ret;
         if (ref == null || ref.get() == null) {