You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/03/24 08:47:36 UTC

[incubator-servicecomb-saga] 01/02: SCB-426 change type of CompensationContext.contexts from HashMap to ConcurrentHashMap

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

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit 869effa6aae56d878cbd3e004d05f04f9adf082e
Author: Daniel Qian <ch...@gmail.com>
AuthorDate: Thu Mar 22 16:14:21 2018 +0800

    SCB-426 change type of CompensationContext.contexts from HashMap to ConcurrentHashMap
---
 .../apache/servicecomb/saga/omega/context/CompensationContext.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/CompensationContext.java b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/CompensationContext.java
index 118b033..067af92 100644
--- a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/CompensationContext.java
+++ b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/CompensationContext.java
@@ -20,15 +20,15 @@ package org.apache.servicecomb.saga.omega.context;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class CompensationContext {
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  private final Map<String, CompensationContextInternal> contexts = new HashMap<>();
+  private final Map<String, CompensationContextInternal> contexts = new ConcurrentHashMap<>();
 
   public void addCompensationContext(Method compensationMethod, Object target) {
     compensationMethod.setAccessible(true);
@@ -58,4 +58,4 @@ public class CompensationContext {
       this.compensationMethod = compensationMethod;
     }
   }
-}
\ No newline at end of file
+}

-- 
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.