flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6493) Ineffective null check in RegisteredOperatorBackendStateMetaInfo#equals()
Date Mon, 17 Jul 2017 19:04:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-6493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16090349#comment-16090349
] 

ASF GitHub Bot commented on FLINK-6493:
---------------------------------------

Github user StephanEwen commented on the issue:

    https://github.com/apache/flink/pull/4328
  
    Good fix, thanks!
    
    I would suggest to improve the `equals(...)` method all together by pulling out the repeated
casts to `Snapshot`.


> Ineffective null check in RegisteredOperatorBackendStateMetaInfo#equals()
> -------------------------------------------------------------------------
>
>                 Key: FLINK-6493
>                 URL: https://issues.apache.org/jira/browse/FLINK-6493
>             Project: Flink
>          Issue Type: Bug
>          Components: State Backends, Checkpointing
>            Reporter: Ted Yu
>            Assignee: mingleizhang
>            Priority: Minor
>
> {code}
>         && ((partitionStateSerializer == null && ((Snapshot) obj).getPartitionStateSerializer()
== null)
>           || partitionStateSerializer.equals(((Snapshot) obj).getPartitionStateSerializer()))
>         && ((partitionStateSerializerConfigSnapshot == null && ((Snapshot)
obj).getPartitionStateSerializerConfigSnapshot() == null)
>           || partitionStateSerializerConfigSnapshot.equals(((Snapshot) obj).getPartitionStateSerializerConfigSnapshot()));
> {code}
> The null check for partitionStateSerializer / partitionStateSerializerConfigSnapshot
is in combination with another clause.
> This may lead to NPE in the partitionStateSerializer.equals() call.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message