cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Synchronizing an access to JAX-RS ProviderFactory injectedProviders list in 2.7.x
Date Fri, 14 Nov 2014 10:28:52 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 98cef3943 -> 8c34d25a2


Synchronizing an access to JAX-RS ProviderFactory injectedProviders list in 2.7.x


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8c34d25a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8c34d25a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8c34d25a

Branch: refs/heads/2.7.x-fixes
Commit: 8c34d25a25e5dbafcffa9a9062f7fa72478f6510
Parents: 98cef39
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Nov 14 10:28:15 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Nov 14 10:28:15 2014 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/provider/ProviderFactory.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8c34d25a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
index ee91720..b9ecbd4 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
@@ -910,7 +910,9 @@ public final class ProviderFactory {
     void injectContextProxiesIntoProvider(ProviderInfo<?> pi) {
         if (pi.contextsAvailable()) {
             InjectionUtils.injectContextProxies(pi, pi.getProvider());
-            injectedProviders.add(pi);
+            synchronized (injectedProviders) {
+                injectedProviders.add(pi);
+            }
         }
     }
     
@@ -1153,8 +1155,10 @@ public final class ProviderFactory {
     void clearProxies(Collection<?> ...lists) {
         for (Collection<?> list : lists) {
             Collection<ProviderInfo<?>> l2 = CastUtils.cast(list);
-            for (ProviderInfo<?> pi : l2) {
-                pi.clearThreadLocalProxies();
+            synchronized (l2) {
+                for (ProviderInfo<?> pi : l2) {
+                    pi.clearThreadLocalProxies();
+                }
             }
         }
     }


Mime
View raw message