diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java index 579ac436c3..490ccb453b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java @@ -247,7 +247,7 @@ private static ByteString getFixedByteString(Text key) { ByteString value = fixedByteStringCache.get(key); if (value == null) { value = ByteString.copyFromUtf8(key.toString()); - fixedByteStringCache.put(key, value); + fixedByteStringCache.put(new Text(key.copyBytes()), value); } return value; }