Skip to content

Commit

Permalink
fix: MarshallerHelper.Map is not thread safety (sofastack#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
shibd authored May 26, 2020
1 parent 8fd9cf3 commit f36254e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package com.alipay.sofa.jraft.rpc.impl;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.Map;

import com.alipay.sofa.jraft.rpc.CliRequests;
Expand All @@ -30,7 +30,7 @@
*/
public class MarshallerHelper {

private static Map<String, Message> messages = new HashMap<>();
private static Map<String, Message> messages = new ConcurrentHashMap<>();

static {
messages.put(RpcRequests.AppendEntriesRequest.class.getName(),
Expand Down

0 comments on commit f36254e

Please sign in to comment.