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 975CE18211 for ; Wed, 3 Feb 2016 12:28:03 +0000 (UTC) Received: (qmail 48420 invoked by uid 500); 3 Feb 2016 12:27:57 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 48313 invoked by uid 500); 3 Feb 2016 12:27:57 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 47722 invoked by uid 99); 3 Feb 2016 12:27:56 -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; Wed, 03 Feb 2016 12:27:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B16FCE3901; Wed, 3 Feb 2016 12:27:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Wed, 03 Feb 2016 12:28:10 -0000 Message-Id: <14f481f067c2495cbb839211fdcbce00@git.apache.org> In-Reply-To: <4911a6ef916743c1a70fd29a00430bf3@git.apache.org> References: <4911a6ef916743c1a70fd29a00430bf3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [15/28] ignite git commit: fixed npe - https://issues.apache.org/jira/browse/IGNITE-2532 fixed npe - https://issues.apache.org/jira/browse/IGNITE-2532 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4035d40f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4035d40f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4035d40f Branch: refs/heads/ignite-2508 Commit: 4035d40f18fa2d829eaa17c0496eeecfad81fee1 Parents: ee20f1d Author: Yakov Zhdanov Authored: Tue Feb 2 16:42:35 2016 +0300 Committer: Yakov Zhdanov Committed: Tue Feb 2 16:42:35 2016 +0300 ---------------------------------------------------------------------- .../multicast/TcpDiscoveryMulticastIpFinder.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/4035d40f/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java index 8402cbf..75b5f91 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java @@ -116,7 +116,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder { private String locAddr; /** Time to live. */ - private Integer ttl; + private int ttl = -1; /** */ @GridToStringExclude @@ -267,6 +267,8 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder { *

* If TTL is {@code 0}, packets are not transmitted on the network, * but may be delivered locally. + *

+ * Default value is {@code -1} which corresponds to system default value. * * @param ttl Time to live. */ @@ -307,7 +309,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder { throw new IgniteSpiException("Invalid number of address request attempts, " + "value greater than zero is expected: " + addrReqAttempts); - if (ttl != null && (ttl < 0 || ttl > 255)) + if (ttl != -1 && (ttl < 0 || ttl > 255)) throw new IgniteSpiException("Time-to-live value is out of 0 <= TTL <= 255 range: " + ttl); if (F.isEmpty(getRegisteredAddresses())) @@ -545,7 +547,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder { sock.setSoTimeout(resWaitTime); - if (ttl != null) + if (ttl != -1) sock.setTimeToLive(ttl); reqPckt.setData(MSG_ADDR_REQ_DATA); @@ -817,7 +819,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder { sock.joinGroup(mcastGrp); - if (ttl != null) + if (ttl != -1) sock.setTimeToLive(ttl); return sock; @@ -908,4 +910,4 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder { } } } -} \ No newline at end of file +}