Open
Description
This bug can be duplicated by adding the following code to testPutAndGet in HashTableTest.java:
for (int i = 0; i < 2048; i++) { classUnderTest.put(i+4096, i); }
for (int i = 0; i < 2048; i++) { assertEquals(classUnderTest.get(i+4096), i); }
The issue here is that the hashed key is dependant on the capacity of the table and the values for the keys aren't update after a capacity change. If the capacity changes those keys could hash to different values. Specifically this happens when keys are added which hash to a number larger than the current capacity.
Metadata
Metadata
Assignees
Labels
No labels