carp84 commented on a change in pull request #13405:
URL: https://github.com/apache/flink/pull/13405#discussion_r492641148



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamOperatorStateHandler.java
##########
@@ -282,8 +283,8 @@ public void setCurrentKey(Object key) {
                if (keyedStateBackend != null) {
                        try {
                                // need to work around type restrictions
-                               @SuppressWarnings("unchecked,rawtypes")
-                               AbstractKeyedStateBackend rawBackend = 
(AbstractKeyedStateBackend) keyedStateBackend;
+                               @SuppressWarnings("rawtypes")
+                               CheckpointableKeyedStateBackend rawBackend = 
keyedStateBackend;
 
                                rawBackend.setCurrentKey(key);

Review comment:
       The suggested change looks ok in my local IntelliJ, could you double 
check? Thanks. :-)

##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamOperatorStateHandler.java
##########
@@ -282,8 +283,8 @@ public void setCurrentKey(Object key) {
                if (keyedStateBackend != null) {
                        try {
                                // need to work around type restrictions
-                               @SuppressWarnings("unchecked,rawtypes")
-                               AbstractKeyedStateBackend rawBackend = 
(AbstractKeyedStateBackend) keyedStateBackend;
+                               @SuppressWarnings("rawtypes")
+                               CheckpointableKeyedStateBackend rawBackend = 
keyedStateBackend;
 
                                rawBackend.setCurrentKey(key);

Review comment:
       True, but that's why we need to suppress the "unchecked" warning, rather 
than "rawtypes"? (In my local env it will also show the warning if I remove the 
"unchecked" suppression from the method signature)




----------------------------------------------------------------
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:
[email protected]


Reply via email to