On Thu, 29 Jan 2026 20:33:47 GMT, Chen Liang <[email protected]> wrote:

>> src/java.base/share/classes/java/util/TreeMap.java line 2141:
>> 
>>> 2139:             }
>>> 2140:             public void forEachRemaining(Consumer<? super K> action) {
>>> 2141:                 Objects.requireNonNull(action);
>> 
>> Is there a test for NPE action on an empty Map?
>
> The new cases for subMap in SpliteratorTraversingAndSplittingTest should be 
> sufficient.

I'd rather see it tested explicitly; its hard to identify exactly which test 
expects and catches the NPE.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29485#discussion_r2743794120

Reply via email to