jeqo commented on code in PR #12859:
URL: https://github.com/apache/kafka/pull/12859#discussion_r1027090533


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/ProcessorParameters.java:
##########
@@ -114,13 +114,12 @@ KTableSource<KIn, VIn> kTableSourceSupplier() {
 
     @SuppressWarnings("unchecked")
     <KR, VR> KTableProcessorSupplier<KIn, VIn, KR, VR> 
kTableProcessorSupplier() {
-        // This cast always works because KTableProcessorSupplier hasn't been 
converted yet.

Review Comment:
   > Is that pretty much guaranteed to be a bug/result in an NPE, or are there 
valid uses for returning null
   Looking at the uses of these methods, it could be both. There are those that 
expect a value and will crash with NPE (bug) (e.g. TableSourceNode), and there 
are others that handle null values and do something else (e.g. 
TableProcessorNode).
   
   Considering the usage of these methods, we could consider removing them and 
handle the casting on the classes using it. I have created 
https://issues.apache.org/jira/browse/KAFKA-14409 to discuss this.



##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/ProcessorParameters.java:
##########
@@ -114,13 +114,12 @@ KTableSource<KIn, VIn> kTableSourceSupplier() {
 
     @SuppressWarnings("unchecked")
     <KR, VR> KTableProcessorSupplier<KIn, VIn, KR, VR> 
kTableProcessorSupplier() {
-        // This cast always works because KTableProcessorSupplier hasn't been 
converted yet.

Review Comment:
   > Is that pretty much guaranteed to be a bug/result in an NPE, or are there 
valid uses for returning null
   
   Looking at the uses of these methods, it could be both. There are those that 
expect a value and will crash with NPE (bug) (e.g. TableSourceNode), and there 
are others that handle null values and do something else (e.g. 
TableProcessorNode).
   
   Considering the usage of these methods, we could consider removing them and 
handle the casting on the classes using it. I have created 
https://issues.apache.org/jira/browse/KAFKA-14409 to discuss 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to