# ignite-sprint-5 potential NPE in syncFuture listener
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/82cfb47c Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/82cfb47c Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/82cfb47c Branch: refs/heads/ignite-916 Commit: 82cfb47cd652895d517dae50d670f13f7fcb9065 Parents: 45566fe Author: sboikov <sboi...@gridgain.com> Authored: Tue Jun 2 16:03:21 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Tue Jun 2 16:03:21 2015 +0300 ---------------------------------------------------------------------- .../cache/distributed/dht/preloader/GridDhtPreloader.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/82cfb47c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java index dc81993..1aef18c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java @@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht.preloader; import org.apache.ignite.*; import org.apache.ignite.cluster.*; +import org.apache.ignite.configuration.*; import org.apache.ignite.events.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.cluster.*; @@ -227,12 +228,14 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter { final long start = U.currentTimeMillis(); - if (cctx.config().getRebalanceDelay() >= 0) { - U.log(log, "Starting rebalancing in " + cctx.config().getRebalanceMode() + " mode: " + cctx.name()); + final CacheConfiguration cfg = cctx.config(); + + if (cfg.getRebalanceDelay() >= 0) { + U.log(log, "Starting rebalancing in " + cfg.getRebalanceMode() + " mode: " + cctx.name()); demandPool.syncFuture().listen(new CI1<Object>() { @Override public void apply(Object t) { - U.log(log, "Completed rebalancing in " + cctx.config().getRebalanceMode() + " mode " + + U.log(log, "Completed rebalancing in " + cfg.getRebalanceMode() + " mode " + "[cache=" + cctx.name() + ", time=" + (U.currentTimeMillis() - start) + " ms]"); } });