You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vk...@apache.org on 2015/09/04 21:41:29 UTC

[04/19] ignite git commit: IGNITE-884 - Spring autowiring

IGNITE-884 - Spring autowiring


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d41af24d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d41af24d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d41af24d

Branch: refs/heads/ignite-884
Commit: d41af24d2ff94a66325b40e6ea268871264caf61
Parents: 8c0cc4f
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Jun 15 20:04:12 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Jun 15 20:04:12 2015 -0700

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheUtils.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d41af24d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index fda05ee..d7a6c31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1686,7 +1686,9 @@ public class GridCacheUtils {
      * @param factory Factory.
      * @return Object.
      */
-    public static <T> T create(GridKernalContext ctx, Factory<T> factory) {
+    @Nullable public static <T> T create(GridKernalContext ctx, @Nullable Factory<T> factory) {
+        assert ctx != null;
+
         T obj = factory != null ? factory.create() : null;
 
         ctx.resource().autowireSpringBean(obj);
@@ -1699,7 +1701,12 @@ public class GridCacheUtils {
      * @param factories Factories.
      * @return Objects.
      */
-    public static <T> Collection<T> create(GridKernalContext ctx, Factory[] factories) {
+    @Nullable public static <T> Collection<T> create(GridKernalContext ctx, @Nullable Factory[] factories) {
+        assert ctx != null;
+
+        if (factories == null)
+            return null;
+
         Collection<T> col = new ArrayList<>(factories.length);
 
         for (Factory<T> factory : factories) {