You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/09 01:19:31 UTC

[GitHub] [flink] SteNicholas commented on a change in pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

SteNicholas commented on a change in pull request #12033:
URL: https://github.com/apache/flink/pull/12033#discussion_r422436572



##########
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 Yeah, I would like to modify `NullAwareMapIterator` to solve the `NullException` and add unit test to cover `null` behavior case.




----------------------------------------------------------------
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:
users@infra.apache.org