On Thursday 20 November 2008 11:42, j16sdiz at freenetproject.org wrote:
> Author: j16sdiz
> Date: 2008-11-20 11:42:05 +0000 (Thu, 20 Nov 2008)
> New Revision: 23754
> 
> Modified:
>    trunk/freenet/src/freenet/node/NetworkIDManager.java
> Log:
> insane .equals() compare PingRecord with PeerNode
>  - this method is currently not in use, fix it anyway

Maybe comparing PeerNode's with PingRecord's was the intended behaviour? It's 
useful to do that sort of thing in some cases, often with collections...
> 
> Modified: trunk/freenet/src/freenet/node/NetworkIDManager.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/NetworkIDManager.java      2008-11-20 
> 11:41:42 
UTC (rev 23753)
> +++ trunk/freenet/src/freenet/node/NetworkIDManager.java      2008-11-20 
> 11:42:05 
UTC (rev 23754)
> @@ -362,9 +362,17 @@
>                       return (short)(htl-diff);
>               }
>               @Override
> -             public boolean equals(Object o) {
> -                     return (o instanceof PeerNode ? via.equals(o) : false);
> -             }
> +        public boolean equals(Object obj) {
> +             if (this == obj)
> +                     return true;
> +             if (obj == null)
> +                     return false;
> +             if (getClass() != obj.getClass())
> +                     return false;
> +              else if (!via.equals(((PingRecord) obj).via))
> +                     return false;
> +             return true;
> +        }
>               @Override
>               public int hashCode() {
>                       return via.hashCode();
> 
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20081121/ba810d1f/attachment.pgp>

Reply via email to