What steps will reproduce the problem?
1. intMap.put(0, "valueFor0Key-zeroIsAValidKeyToo"
intMap.toString()
What is the expected output?
[0, valueFor0Key-zeroIsAValidKeyToo]
What do you see instead?
[]
What version of the Kryo are you using?
Please provide any additional information below.
Proposed fix:
public String toString() {
if (size == 0) return "[]";
StringBuilder buffer = new StringBuilder(32);
buffer.append('[');
int[] keyTable = this.keyTable;
V[] valueTable = this.valueTable;
int i = keyTable.length;
while (i-- > 0) {
int key = keyTable[i];
if (key == EMPTY) continue;
buffer.append(key);
buffer.append('=');
buffer.append(valueTable[i]);
break;
}
while (i-- > 0) {
int key = keyTable[i];
if (key == EMPTY) continue;
buffer.append(", ");
buffer.append(key);
buffer.append('=');
buffer.append(valueTable[i]);
}
if (hasZeroValue) {
if (size > 1)
buffer.append(", ");
buffer.append(EMPTY);
buffer.append('=');
buffer.append(zeroValue);
}
buffer.append(']');
return buffer.toString();
}
Original issue reported on code.google.com by Vladisla...@gmail.com on 3 Nov 2013 at 7:45
Original issue reported on code.google.com by
Vladisla...@gmail.com
on 3 Nov 2013 at 7:45