Github user GJL commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5703#discussion_r175126066
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointStatistics.java
 ---
    @@ -273,7 +274,21 @@ public static CheckpointStatistics 
generateCheckpointStatistics(AbstractCheckpoi
                                failedCheckpointStats.getFailureTimestamp(),
                                failedCheckpointStats.getFailureMessage());
                } else {
    -                   throw new IllegalArgumentException("Given checkpoint 
stats object of type " + checkpointStats.getClass().getName() + " cannot be 
converted.");
    +                   final PendingCheckpointStats pendingCheckpointStats = 
((PendingCheckpointStats) checkpointStats);
    --- End diff --
    
    The original `else` block should be kept in case the class hierarchy is 
extended.
    ```
    else if (checkpointStats instanceOf PendingCheckpointStats) {
        ...
    } else {
        throw new IllegalArgumentException("Given checkpoint stats object of 
type " + checkpointStats.getClass().getName() + " cannot be converted.");
    }
    ```


---

Reply via email to