[ https://issues.apache.org/jira/browse/IGNITE-16349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17482359#comment-17482359 ]
Evgeny Stanilovsky commented on IGNITE-16349: --------------------------------------------- [~vermakov] i left one comment, plz check it. > 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: calcite3-required, ignite-3 > Time Spent: 10m > 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)