[ 
https://issues.apache.org/jira/browse/GOSSIP-99?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16180946#comment-16180946
 ] 

ASF GitHub Bot commented on GOSSIP-99:
--------------------------------------

GitHub user tawalaya opened a pull request:

    https://github.com/apache/incubator-gossip/pull/69

    GOSSIP-99 fixed equals cast bug and added a test for that behavior

    see https://issues.apache.org/jira/browse/GOSSIP-99

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tawalaya/incubator-gossip GOSSIP-99

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-gossip/pull/69.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 #69
    
----
commit bec81bcf9bec9b982a37d2bcea6fac6b7921e9e5
Author: Sebastian Werner <wer...@tu-berlin.de>
Date:   2017-09-26T15:22:44Z

    GOSSIP-99 fixed equals cast bug and added a test for that behavior

----


> Cast Error while using equals and RemoteGossipMember
> ----------------------------------------------------
>
>                 Key: GOSSIP-99
>                 URL: https://issues.apache.org/jira/browse/GOSSIP-99
>             Project: Gossip
>          Issue Type: Bug
>    Affects Versions: 0.1.2
>         Environment: java; windows; maven; 0.1.2-incubating 
>            Reporter: Sebastian Werner
>            Priority: Minor
>
> The follwoing code causes an unexpected class cass exception error due to the 
> implementation of equals in the org.apache.gossip.GossipMember class.
> Code Proof:
> {code:java}
> HashSet<GossipMember> foo = new HashSet<>();
>  HashSet<GossipMember> foo = new HashSet<>();
>         foo.add(new RemoteGossipMember("foo1",
>                 new URI(String.format("udp://%s:%d", "127.0.0.1", 
> 50000)),"foo1"));
>         foo.add(new RemoteGossipMember("foo1",
>                 new URI(String.format("udp://%s:%d", "127.0.0.1", 
> 50000)),"foo1"));
> {code}
> this code results in a Exeption: 
> {code:java}
> java.lang.ClassCastException: org.apache.gossip.RemoteGossipMember cannot be 
> cast to org.apache.gossip.LocalGossipMember at 
> org.apache.gossip.GossipMember.equals(GossipMember.java:159)
> {code}
> due to the cast in the equals method.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to