Closed techsy730 closed 3 years ago
Hopefully not too late for 8.5.2.
If it is, I don't think it is a big enough issue for a 8.5.3 alone. It can just be rolled up into whatever other fixes do deserve it.
No, we're definitely in time for 8.5.2.
Ok, I am going to leave this change as is most likely unless you spot something major.
OK, I merged in and removed my commit about varargs (it's a mess—you get confusion between the constructor with a size argument and the constructor with one element). I had to do some github black sorcery—I just hope I didn't delete any of your merges.
If both the default
containsValue
and the defaultvalues
methods are inherited by an implementating class, they will get aStackOverflowError
on trying to test for a value being present.This is because the default
values().contains
callscontainsValue
, but the defaultcontainsValue
callsvalues().contains
.Now make the default
containsValues
loop over the entry set.Add a comment that you should probably override this is your
values()
has a better implementation. Same also retroactively applied tocontainsKey
andkeySet()
.Finally, retrofits
AbstractInt2IntMapTest
to extendInt2IntMapGenericTest
, with a dummy testonly implementation that implements the bare minimum for a mutable Int2Int map. This is to test as many of theAbstractInt2IntMap
's default methods as possible. This gives it the set of tests we apply to all otherInt2IntMap
impls.