You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Tzu-Li (Gordon) Tai (JIRA)" <ji...@apache.org> on 2017/08/04 03:40:00 UTC

[jira] [Resolved] (FLINK-7127) Remove unnecessary null check or add null check

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

Tzu-Li (Gordon) Tai resolved FLINK-7127.
----------------------------------------
       Resolution: Fixed
         Assignee: Dmitrii Kniazev
    Fix Version/s: 1.3.3
                   1.4.0

Thanks for the contribution [~mylog00].
Gentle reminder: you should assign the ticket to yourself if you decide to work on it. That would prevent someone else picking it up also and ending up in duplicate efforts.

Fixed in master via bef7484610dd206d7c749e32f5d91a0f67ef405a.
Fixed in 1.3 via 89659c6d52ac5582cc76a50f912fa4cddccddc77.

> Remove unnecessary null check or add null check
> -----------------------------------------------
>
>                 Key: FLINK-7127
>                 URL: https://issues.apache.org/jira/browse/FLINK-7127
>             Project: Flink
>          Issue Type: Improvement
>          Components: State Backends, Checkpointing
>            Reporter: Ufuk Celebi
>            Assignee: Dmitrii Kniazev
>            Priority: Trivial
>              Labels: starter
>             Fix For: 1.4.0, 1.3.3
>
>
> In {{HeapKeyedStateBackend#snapshot}} we have:
> {code}
> for (Map.Entry<String, StateTable<K, ?, ?>> kvState : stateTables.entrySet()) {
> 	// 1) Here we don't check for null
> 	metaInfoSnapshots.add(kvState.getValue().getMetaInfo().snapshot());
> 	kVStateToId.put(kvState.getKey(), kVStateToId.size());
> 	// 2) Here we check for null
> 	StateTable<K, ?, ?> stateTable = kvState.getValue();
> 	if (null != stateTable) {
> 		cowStateStableSnapshots.put(stateTable, stateTable.createSnapshot());
> 	}
> }
> {code}
> Either this can lead to a NPE and we should check it in 1) or we remove the null check in 2). 



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