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 2022/10/12 09:09:05 UTC

[GitHub] [flink] chucheng92 commented on a diff in pull request #19654: [FLINK-27529][connector/common] Replace HybridSourceSplitEnumerator readerSourceIndex to safely Integer check

chucheng92 commented on code in PR #19654:
URL: https://github.com/apache/flink/pull/19654#discussion_r993203156


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSourceSplitEnumerator.java:
##########
@@ -355,7 +355,8 @@ public Map<Integer, ReaderInfo> registeredReaders() {
         private Map<Integer, ReaderInfo> filterRegisteredReaders(Map<Integer, ReaderInfo> readers) {
             Map<Integer, ReaderInfo> readersForSource = new HashMap<>(readers.size());
             for (Map.Entry<Integer, ReaderInfo> e : readers.entrySet()) {
-                if (readerSourceIndex.get(e.getKey()) == (Integer) sourceIndex) {
+                // readerSourceIndex get value could be null

Review Comment:
   @mas-chen thanks for reviewing, but here  readerSourceIndex.get(e.getKey()) will be null, so must use ((Integer) sourceIndex).equals(readerSourceIndex.get(e.getKey())  to avoid npe.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org