mas-chen commented on code in PR #19654:
URL: https://github.com/apache/flink/pull/19654#discussion_r931679580
##########
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:
You can simplify it as:
readerSourceIndex.get(e.getKey())).equals(sourceIndex)
There are other instances where we should use `.equals` instead of `==`.
e.g.
https://github.com/apache/flink/blob/5c87b69b5300e8678629aa8b769d60ec2fdbf3d1/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSourceSplitEnumerator.java#L167
Can you do another pass here and fix the relevant spots in the code?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]