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

[03/18] incubator-ignite git commit: # IGNITE-983 Fixed logic to support null value.

# IGNITE-983 Fixed logic to support null value.


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

Branch: refs/heads/ignite-883_1
Commit: 51d4737ab70a2962ec8ef3f300317e1223d52ab3
Parents: bafad99
Author: AKuznetsov <ak...@gridgain.com>
Authored: Thu Jun 4 00:17:27 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Thu Jun 4 00:17:27 2015 +0700

----------------------------------------------------------------------
 .../ignite/configuration/CacheConfiguration.java      | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51d4737a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 8b1e1a5..1aa4fd6 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -1664,14 +1664,18 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
         A.ensure(indexedTypes == null || (indexedTypes.length & 1) == 0,
             "Number of indexed types is expected to be even. Refer to method javadoc for details.");
 
-        int len = indexedTypes.length;
+        if (indexedTypes != null) {
+            int len = indexedTypes.length;
 
-        Class<?>[] newIndexedTypes = new Class<?>[len];
+            Class<?>[] newIndexedTypes = new Class<?>[len];
 
-        for (int i = 0; i < len; i++)
-            newIndexedTypes[i] = U.box(indexedTypes[i]);
+            for (int i = 0; i < len; i++)
+                newIndexedTypes[i] = U.box(indexedTypes[i]);
 
-        this.indexedTypes = newIndexedTypes;
+            this.indexedTypes = newIndexedTypes;
+        }
+        else
+            this.indexedTypes = null;
 
         return this;
     }