On Thu, 17 Nov 2022 03:39:37 GMT, Stuart Marks <sma...@openjdk.org> wrote:
>> Jaikiran Pai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> review suggestion - simplify test > > test/jdk/java/util/Collections/DelegatingIteratorForEachRemaining.java line > 235: > >> 233: // verify the iterator didn't advance >> 234: Assert.assertTrue("Iterator unexpectedly doesn't have any >> entry", it.hasNext()); >> 235: } > > The checks in Collections.java look good. > > The tests can be simplified, I think. The reproducers in the original bug > report wrap an empty map in either an unmodifiable map or a checked map, so > you could just test them with entrySet().iterator().forEachRemaining(null). > Those cases do nothing in the current JDK when they indeed should throw NPE. > Probably just test for NPE thrown/not-thrown instead of trying to ascertain > the position of the iterator. Hello Stuart, I have now updated the PR to simplify the test as suggested. New test methods continue to fail without the source change and pass with this fix. ------------- PR: https://git.openjdk.org/jdk/pull/11154