IGNITE-6107 first(list) should behave the same way as first(iterable) in case of null argument.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d779f06e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d779f06e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d779f06e Branch: refs/heads/ignite-5578 Commit: d779f06edbbf405c084b9c9a20e5907f37d1f309 Parents: 4acbe0e Author: Alexey Kuznetsov <[email protected]> Authored: Fri Aug 18 18:40:01 2017 +0700 Committer: Alexey Kuznetsov <[email protected]> Committed: Fri Aug 18 18:40:01 2017 +0700 ---------------------------------------------------------------------- .../main/java/org/apache/ignite/internal/util/lang/GridFunc.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d779f06e/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java index ed2351d..fbb47c4 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java @@ -1549,7 +1549,7 @@ public class GridFunc { * @return List' first element or {@code null} in case if list is empty. */ public static <T> T first(List<? extends T> list) { - if (list.isEmpty()) + if (list == null || list.isEmpty()) return null; return list.get(0);
