Yuta HIGUCHI

attempt to fix buffer underflow

- IMap#get usually returns clone of original value,
  but when the type is byte[], it returns the original value.
- During the deserialization process, Kryo temporarily modifies the input buffer,
  which may cause problem when multiple threads were reading the same value.

- applying clone only to value deserialization for now,
  since it is unlikely that caller will be modifying Map key

Change-Id: I52214ba711b4060663b0e1c451f49bdd1d472ea9
......@@ -492,7 +492,10 @@ public class SMap<K, V> implements IMap<K, V> {
}
private V deserializeVal(byte[] val) {
return serializer.decode(val);
if (val == null) {
return null;
}
return serializer.decode(val.clone());
}
private Set<byte[]> serializeKeySet(Set<K> keys) {
......