You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gossip.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/01/10 08:31:58 UTC
[jira] [Commented] (GOSSIP-40) Gossip member hashcode failed with
parentheses missing
[ https://issues.apache.org/jira/browse/GOSSIP-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15814325#comment-15814325 ]
ASF GitHub Bot commented on GOSSIP-40:
--------------------------------------
GitHub user goby opened a pull request:
https://github.com/apache/incubator-gossip/pull/23
GOSSIP-40 fix GossipMember hash code bug
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/goby/incubator-gossip master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-gossip/pull/23.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #23
----
commit 62eb09a1dca77a50fa6961f2686a656f8cc9338e
Author: laidonglin <go...@foxmail.com>
Date: 2017-01-10T08:30:10Z
GOSSIP-40: fix GossipMember hash code bug
----
> Gossip member hashcode failed with parentheses missing
> ------------------------------------------------------
>
> Key: GOSSIP-40
> URL: https://issues.apache.org/jira/browse/GOSSIP-40
> Project: Gossip
> Issue Type: Bug
> Reporter: lai donglin
>
> org.apache.gossip.GossipMember#hashCode will always return clusterName.hashCode() for a pair of parentheses missing.
> here is the code:
> {code:java}
> @Override
> public int hashCode() {
> final int prime = 31;
> int result = 1;
> String address = getAddress();
> result = prime * result + ((address == null) ? 0 : address.hashCode()) + clusterName == null ? 0
> : clusterName.hashCode();
> return result;
> {code}
> this expression {code}prime * result + ((address == null) ? 0 : address.hashCode()) + clusterName == null{code}is always false
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)