Hi,
could you please report this at https://bugreport.java.com/bugreport/
(please also first search at 
https://bugs.openjdk.org/issues?jql=project%3DJDK%20AND%20issuetype%3DBug
whether it has already been reported).

This also seems to affect the `CheckedEntrySet`; would be good if you could 
mention that
in your report as well.

I think the easiest reproducers for this can be created with an empty map:
```
Collections.unmodifiableMap(Map.of()).entrySet().iterator().forEachRemaining(null)
Collections.checkedMap(Map.of(), String.class, 
String.class).entrySet().iterator().forEachRemaining(null)
```
Per specification both calls should throw a NullPointerException, but they 
don't throw it.

Might also be worth recommending to the JDK authors to perform the null check 
in the internal
`entryConsumer` method to avoid having it repeated 4 times, once for each 
caller. The `CheckedEntrySet`
would still need a separate null check though.

Kind regards

Reply via email to