[
https://issues.apache.org/jira/browse/IGNITE-16349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konstantin Orlov updated IGNITE-16349:
--------------------------------------
Labels: ignite-3 (was: calcite3-required ignite-3)
> Sql. Check for potential NPE after IGNITE-15462.
> ------------------------------------------------
>
> Key: IGNITE-16349
> URL: https://issues.apache.org/jira/browse/IGNITE-16349
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Reporter: Evgeny Stanilovsky
> Assignee: Vladimir Ermakov
> Priority: Major
> Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> After merging IGNITE-15462 NPE is possible caused by differences in return
> vals.
> For example code like :
> {noformat}
> final Int2ObjectOpenHashMap<List<Integer>> targets = new
> Int2ObjectOpenHashMap<>();
> ...
> final Collection<Integer> integers = targets.get(ifc.getFieldIndex());
> if (integers.isEmpty()) <- possible NPE
> {noformat}
> due to difference between:
> Multimap#get
> {noformat}
> /**
> * Returns a view collection of the values associated with {@code key} in
> this multimap, if any.
> * Note that when {@code containsKey(key)} is false, this returns an empty
> collection, not {@code
> * null}.
> *
> * <p>Changes to the returned collection will update the underlying
> multimap, and vice versa.
> */
> Collection<V> get(@Nullable K key);
> {noformat}
> and
> Int2ObjectOpenHashMap#get
> {noformat}
> Returns:
> the corresponding value, or the default return value if no value was present
> for the given key.
> V defaultReturnValue()
> Gets the default return value.
> This default implementation just return the default null value of the type
> (null for objects, 0 for scalars, false for Booleans).
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)