Skip to content

Instantly share code, notes, and snippets.

@imyousuf
Created September 17, 2010 05:17
Show Gist options
  • Save imyousuf/583761 to your computer and use it in GitHub Desktop.
Save imyousuf/583761 to your computer and use it in GitHub Desktop.
ByteBuffer buffer = ByteBuffer.allocate(testData.length);
ByteBuffer tmp = buffer;
LinkedHashMap<ByteBuffer, MutableInt> map = new LinkedHashMap<ByteBuffer, MutableInt>();
map.put(tmp, new MutableInt());
tmp.put(testData); // Right after this operation hashCode changes but the buffer is equal
assertTrue(buffer.equals(tmp));
assertNull(map.get(buffer));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment