[
https://issues.apache.org/jira/browse/IGNITE-20524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pavel Tupitsyn updated IGNITE-20524:
------------------------------------
Description:
*KeyValueView.put* behavior with null value is inconsistent:
* Interface method does not have *@Nullable* annotation on *val*
* *KeyValueBinaryViewImpl* throws an exception when *val* is null
* *KeyValueViewImpl* does not throw exception right away; null is allowed for
simple mapping (e.g. *<Long, String>*), but not allowed with POJOs (<PersonKey,
PersonVal>)
This affects embedded and thin APIs equally.
It is understood that single-column mapping allows nulls to set nullable column
values; however, overall situation is confusing. We can improve it in 3 ways:
1. Keep existing behavior, improve javadoc
2. Always disallow null value
3. Always allow null value (set all mapped columns to null for POJO use case)
was:
*KeyValueView.put* behavior with null value is inconsistent:
* Interface method does not have *@Nullable* annotation on *val*
* *KeyValueBinaryViewImpl* throws an exception when *val* is null
* *KeyValueViewImpl* does not throw exception right away; null is allowed for
simple mapping (e.g. *<Long, String>*), but not allowed with POJOs (<PersonKey,
PersonVal>)
This affects embedded and thin APIs equally.
A simple fix would be to disable nulls in all cases, and add null check to
*KeyValueViewImpl*.
> Inconsistent behavior of KeyValueView.put with null value
> ---------------------------------------------------------
>
> Key: IGNITE-20524
> URL: https://issues.apache.org/jira/browse/IGNITE-20524
> Project: Ignite
> Issue Type: Improvement
> Components: thin client
> Affects Versions: 3.0.0-beta1
> Reporter: Pavel Tupitsyn
> Assignee: Pavel Tupitsyn
> Priority: Critical
> Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>
> *KeyValueView.put* behavior with null value is inconsistent:
> * Interface method does not have *@Nullable* annotation on *val*
> * *KeyValueBinaryViewImpl* throws an exception when *val* is null
> * *KeyValueViewImpl* does not throw exception right away; null is allowed for
> simple mapping (e.g. *<Long, String>*), but not allowed with POJOs
> (<PersonKey, PersonVal>)
> This affects embedded and thin APIs equally.
> It is understood that single-column mapping allows nulls to set nullable
> column values; however, overall situation is confusing. We can improve it in
> 3 ways:
> 1. Keep existing behavior, improve javadoc
> 2. Always disallow null value
> 3. Always allow null value (set all mapped columns to null for POJO use case)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)