You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Stephan Ewen (JIRA)" <ji...@apache.org> on 2018/03/22 15:26:00 UTC

[jira] [Resolved] (FLINK-9035) State Descriptors have broken hashCode() and equals()

     [ https://issues.apache.org/jira/browse/FLINK-9035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Ewen resolved FLINK-9035.
---------------------------------
       Resolution: Fixed
    Fix Version/s:     (was: 1.6.0)
                   1.5.0

Fixed in
  - 1.5.0 via 69e5d146219bbded4bb6cc472ff015996c1aceb7
  - 1.6.0 via f3a519712fb31f7b71181e876c3c3d5fff08eb71

> State Descriptors have broken hashCode() and equals()
> -----------------------------------------------------
>
>                 Key: FLINK-9035
>                 URL: https://issues.apache.org/jira/browse/FLINK-9035
>             Project: Flink
>          Issue Type: Bug
>          Components: State Backends, Checkpointing
>    Affects Versions: 1.5.0, 1.4.2
>            Reporter: Stephan Ewen
>            Assignee: Stephan Ewen
>            Priority: Major
>             Fix For: 1.5.0
>
>
> The following code fails with a {{NullPointerException}}:
> {code}
> ValueStateDescriptor<String> descr = new ValueStateDescriptor<>("name", String.class);
> descr.hashCode();
> {code}
> The {{hashCode()}} function tries to access the {{serializer}} field, which may be uninitialized at that point.
> The {{equals()}} method is equally broken (no pun intended):
> {code}
> ValueStateDescriptor<String> a = new ValueStateDescriptor<>("name", String.class);
> ValueStateDescriptor<String> b = new ValueStateDescriptor<>("name", String.class);
> a.equals(b) // exception
> b.equals(a) // exception
> a.initializeSerializerUnlessSet(new ExecutionConfig());
> a.equals(b) // false
> b.equals(a) // exception
> b.initializeSerializerUnlessSet(new ExecutionConfig());
> a.equals(b) // true
> b.equals(a) // true
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)