Skip to content

Commit

Permalink
Fix memory leak in HashBiMap.
Browse files Browse the repository at this point in the history
Signed-off-by: Bhavana Hindupur <bhavana.hindupur@gmail.com>
  • Loading branch information
superhindupur committed Feb 10, 2016
1 parent 911ed1d commit db75569
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,12 @@ public void forcePut_inverseKeyPreservation()
Key key2 = new Key("2");

Key value1 = new Key("abc");
Key value2 = new Key("xyz");

Key duplicateOfKey1 = new Key("1");

HashBiMap<Key, Key> biMap = this.newMapWithKeysValues(key1, value1, key2, value2);
HashBiMap<Key, Key> biMap = this.newMapWithKeysValues(key1, value1, key2, new Key("xyz"));

biMap.forcePut(duplicateOfKey1, value2);
biMap.forcePut(duplicateOfKey1, new Key("xyz"));

Assert.assertSame(key1, Iterate.getFirst(biMap.entrySet()).getKey());
Assert.assertSame(key1, Iterate.getFirst(biMap.inverse().entrySet()).getValue());
Expand Down

0 comments on commit db75569

Please sign in to comment.