ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [14/47] incubator-ignite git commit: # IGNITE-831 Fix NPE
Date Fri, 15 May 2015 14:02:16 GMT
# IGNITE-831 Fix NPE


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

Branch: refs/heads/ignite-709_3
Commit: d0dac7de1e573ae3870e20adfe18abf61caa84ec
Parents: 5ffaa4c
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Wed May 6 14:30:53 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed May 6 14:43:16 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 28 +++++++++++---------
 1 file changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d0dac7de/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 6028901..8051172 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -1766,7 +1766,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
                 log.debug("Discovery notification [node=" + node + ", spiState=" + spiState
+
                     ", type=" + U.gridEventName(type) + ", topVer=" + topVer + ']');
 
-            Collection<ClusterNode> top = F.<TcpDiscoveryNode, ClusterNode>upcast(ring.visibleNodes());
+            Collection<ClusterNode> top = F.upcast(ring.visibleNodes());
 
             Map<Long, Collection<ClusterNode>> hist = updateTopologyHistory(topVer,
top);
 
@@ -4522,20 +4522,22 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
 
                 TcpDiscoveryNode node = ring.node(msg.creatorNodeId());
 
-                try {
-                    Serializable msgObj = marsh.unmarshal(msg.messageBytes(), U.gridClassLoader());
+                if (node != null) {
+                    try {
+                        Serializable msgObj = marsh.unmarshal(msg.messageBytes(), U.gridClassLoader());
 
-                    lsnr.onDiscovery(DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT,
-                        msg.topologyVersion(),
-                        node,
-                        snapshot,
-                        hist,
-                        msgObj);
+                        lsnr.onDiscovery(DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT,
+                            msg.topologyVersion(),
+                            node,
+                            snapshot,
+                            hist,
+                            msgObj);
 
-                    msg.messageBytes(marsh.marshal(msgObj));
-                }
-                catch (IgniteCheckedException e) {
-                    U.error(log, "Failed to unmarshal discovery custom message.", e);
+                        msg.messageBytes(marsh.marshal(msgObj));
+                    }
+                    catch (IgniteCheckedException e) {
+                        U.error(log, "Failed to unmarshal discovery custom message.", e);
+                    }
                 }
             }
         }


Mime
View raw message