SteNicholas commented on a change in pull request #12033:
URL: https://github.com/apache/flink/pull/12033#discussion_r422484721
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapMapState.java
##########
@@ -158,7 +159,7 @@ public boolean contains(UK userKey) {
@Override
public Iterator<Map.Entry<UK, UV>> iterator() {
Map<UK, UV> userMap = stateTable.get(currentNamespace);
- return userMap == null ? null : userMap.entrySet().iterator();
+ return userMap == null ? Collections.<UK,
UV>emptyMap().entrySet().iterator() : userMap.entrySet().iterator();
Review comment:
@Myasuka I have already modified`NullAwareMapIterator` to add
mapIterator nullable check, and replied the thread you mentioned. In this pull
request, I think #iterator should better return empty iterator, and
`NullAwareMapIterator` necessarily check the mapIterator.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]