On Tue, 21 Apr 2026 05:08:58 GMT, Stuart Marks <[email protected]> wrote:
>> jengebr has updated the pull request incrementally with one additional >> commit since the last revision: >> >> PR feedback - types in putHashMapEntries > > test/jdk/java/util/Collection/MOAT.java line 431: > >> 429: >> 430: target.putAll(new HashMap<>(testData)); >> 431: equal(target.size(), testData.size()); > > It's not necessary to check equality of sizes, since this is implicit in the > Map.equals() contract -- the sizes must be the same. So this line can be > removed. > > Similar for other equal-size checks in the cases below. I'm laughing at myself here... I was concurrently modifying applications to use .size() before .equals() as a cheap shortcut. It makes sense in the applications but not here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28243#discussion_r3117637241
