ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject incubator-ignite git commit: ignite-959-x - tests fix + arg check
Date Mon, 06 Jul 2015 07:51:32 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-959-x fe55c65ad -> dbe6ce570


ignite-959-x - tests fix + arg check


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

Branch: refs/heads/ignite-959-x
Commit: dbe6ce5704702572c6c2bcff7675b450ed7d4024
Parents: fe55c65
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Mon Jul 6 10:50:24 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Mon Jul 6 10:50:24 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/configuration/CacheConfiguration.java  | 8 +++++++-
 .../internal/processors/cache/GridCacheAbstractSelfTest.java | 6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dbe6ce57/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 9958739..63d7800 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
@@ -1674,6 +1674,8 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K,
V> {
      * @return {@code this} for chaining.
      */
     public CacheConfiguration<K, V> setIndexedTypes(Class<?>... indexedTypes)
{
+        A.notNull(indexedTypes, "indexedTypes");
+
         int len = indexedTypes.length;
 
         A.ensure(len > 0, "Array of indexed types can not be empty.");
@@ -1685,8 +1687,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K,
V> {
 
         Class<?>[] newIndexedTypes = new Class<?>[len];
 
-        for (int i = 0; i < len; i++)
+        for (int i = 0; i < len; i++) {
+            if (indexedTypes[i] == null)
+                throw new NullPointerException("Indexed types array contains null at index:
" + i);
+
             newIndexedTypes[i] = U.box(indexedTypes[i]);
+        }
 
         if (typeMeta == null)
             typeMeta = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dbe6ce57/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index 468aec1..1b428e3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -229,7 +229,11 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest
{
         cfg.setAtomicityMode(atomicityMode());
         cfg.setWriteSynchronizationMode(writeSynchronization());
         cfg.setNearConfiguration(nearConfiguration());
-        cfg.setIndexedTypes(indexedTypes());
+
+        Class<?>[] idxTypes = indexedTypes();
+
+        if (!F.isEmpty(idxTypes))
+            cfg.setIndexedTypes(idxTypes);
 
         if (cacheMode() == PARTITIONED)
             cfg.setBackups(1);


Mime
View raw message