[
https://issues.apache.org/jira/browse/FLINK-9035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephan Ewen closed FLINK-9035.
-------------------------------
> 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)