HDFS-13611. Unsafe use of Text as a ConcurrentHashMap key in PBHelperClient.

This commit is contained in:
Andrew Wang 2018-05-24 09:56:23 -07:00
parent 1388de18ad
commit c9b63deb53

View File

@ -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;
}