Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AF003188D8 for ; Mon, 6 Jul 2015 07:51:58 +0000 (UTC) Received: (qmail 18995 invoked by uid 500); 6 Jul 2015 07:51:58 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 18966 invoked by uid 500); 6 Jul 2015 07:51:58 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 18957 invoked by uid 99); 6 Jul 2015 07:51:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2015 07:51:58 +0000 X-ASF-Spam-Status: No, hits=-2000.6 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Jul 2015 07:49:46 +0000 Received: (qmail 17288 invoked by uid 99); 6 Jul 2015 07:51:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2015 07:51:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E5340DFF46; Mon, 6 Jul 2015 07:51:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergi@apache.org To: commits@ignite.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-ignite git commit: ignite-959-x - tests fix + arg check Date: Mon, 6 Jul 2015 07:51:32 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org 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 Authored: Mon Jul 6 10:50:24 2015 +0300 Committer: S.Vladykin 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 extends MutableConfiguration { * @return {@code this} for chaining. */ public CacheConfiguration 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 extends MutableConfiguration { 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);