Re: [PR] MINOR:Type Casting Correction AND Null Pointer Exception (NPE) Defense [kafka]

2024-02-07 Thread via GitHub


highluck commented on code in PR #9786:
URL: https://github.com/apache/kafka/pull/9786#discussion_r1482300227


##
streams/src/main/java/org/apache/kafka/streams/kstream/internals/InternalStreamsBuilder.java:
##
@@ -437,7 +438,10 @@ private void rewriteSingleStoreSelfJoin(
 if (currentNode instanceof StreamStreamJoinNode && 
currentNode.parentNodes().size() == 1) {
 final StreamStreamJoinNode joinNode = (StreamStreamJoinNode) 
currentNode;
 // Remove JoinOtherWindowed node
-final GraphNode parent = 
joinNode.parentNodes().stream().findFirst().get();
+final GraphNode parent = joinNode.parentNodes().stream()

Review Comment:
   As you said, it doesn't seem necessary.



-- 
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: jira-unsubscr...@kafka.apache.org

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



Re: [PR] MINOR:Type Casting Correction AND Null Pointer Exception (NPE) Defense [kafka]

2024-02-06 Thread via GitHub


mimaison commented on code in PR #9786:
URL: https://github.com/apache/kafka/pull/9786#discussion_r1480365763


##
streams/src/main/java/org/apache/kafka/streams/kstream/internals/InternalStreamsBuilder.java:
##
@@ -437,7 +438,10 @@ private void rewriteSingleStoreSelfJoin(
 if (currentNode instanceof StreamStreamJoinNode && 
currentNode.parentNodes().size() == 1) {
 final StreamStreamJoinNode joinNode = (StreamStreamJoinNode) 
currentNode;
 // Remove JoinOtherWindowed node
-final GraphNode parent = 
joinNode.parentNodes().stream().findFirst().get();
+final GraphNode parent = joinNode.parentNodes().stream()

Review Comment:
   It seems we checked there is one item in parentNodes in the `if` condition 
just above, so do we really need this?



-- 
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: jira-unsubscr...@kafka.apache.org

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



Re: [PR] MINOR:Type Casting Correction AND Null Pointer Exception (NPE) Defense [kafka]

2024-02-06 Thread via GitHub


highluck commented on PR #9786:
URL: https://github.com/apache/kafka/pull/9786#issuecomment-1930075970

   @mimaison 
   
   Can you review this? thanks!


-- 
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: jira-unsubscr...@kafka.apache.org

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