duongkame commented on code in PR #986:
URL: https://github.com/apache/ratis/pull/986#discussion_r1424731972


##########
ratis-common/src/main/java/org/apache/ratis/protocol/RaftPeerId.java:
##########
@@ -40,7 +40,8 @@ public final class RaftPeerId {
   private static final Map<String, RaftPeerId> STRING_MAP = new 
ConcurrentHashMap<>();
 
   public static RaftPeerId valueOf(ByteString id) {
-    return BYTE_STRING_MAP.computeIfAbsent(id, RaftPeerId::new);
+    ByteString cloned = ByteString.copyFrom(id.asReadOnlyByteBuffer());

Review Comment:
   Good one. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to