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/08/11 09:27:54 UTC

[45/50] incubator-ignite git commit: # Fixed potential NPE in GridCachePartitionExchangeManager.dumpPendingObjects

# Fixed potential NPE in GridCachePartitionExchangeManager.dumpPendingObjects


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

Branch: refs/heads/ignite-426
Commit: ae11e9b5aa9af4d0d58e2a16dd3a3331969961df
Parents: 19fb305
Author: sboikov <sb...@gridgain.com>
Authored: Tue Aug 11 09:42:02 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Aug 11 09:42:43 2015 +0300

----------------------------------------------------------------------
 .../GridCachePartitionExchangeManager.java      | 32 ++++++++++++--------
 1 file changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ae11e9b5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index cf49197..e00d3b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -984,25 +984,33 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
      *
      */
     public void dumpPendingObjects() {
-        U.warn(log, "Pending transactions:");
+        IgniteTxManager tm = cctx.tm();
 
-        for (IgniteInternalTx tx : cctx.tm().activeTransactions())
-            U.warn(log, ">>> " + tx);
+        if (tm != null) {
+            U.warn(log, "Pending transactions:");
 
-        U.warn(log, "Pending explicit locks:");
+            for (IgniteInternalTx tx : tm.activeTransactions())
+                U.warn(log, ">>> " + tx);
+        }
 
-        for (GridCacheExplicitLockSpan lockSpan : cctx.mvcc().activeExplicitLocks())
-            U.warn(log, ">>> " + lockSpan);
+        GridCacheMvccManager mvcc = cctx.mvcc();
 
-        U.warn(log, "Pending cache futures:");
+        if (mvcc != null) {
+            U.warn(log, "Pending explicit locks:");
 
-        for (GridCacheFuture<?> fut : cctx.mvcc().activeFutures())
-            U.warn(log, ">>> " + fut);
+            for (GridCacheExplicitLockSpan lockSpan : mvcc.activeExplicitLocks())
+                U.warn(log, ">>> " + lockSpan);
 
-        U.warn(log, "Pending atomic cache futures:");
+            U.warn(log, "Pending cache futures:");
 
-        for (GridCacheFuture<?> fut : cctx.mvcc().atomicFutures())
-            U.warn(log, ">>> " + fut);
+            for (GridCacheFuture<?> fut : mvcc.activeFutures())
+                U.warn(log, ">>> " + fut);
+
+            U.warn(log, "Pending atomic cache futures:");
+
+            for (GridCacheFuture<?> fut : mvcc.atomicFutures())
+                U.warn(log, ">>> " + fut);
+        }
     }
 
     /**