On Thursday 20 November 2008 11:42, [EMAIL PROTECTED] 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
> [EMAIL PROTECTED]
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 

Attachment: pgpav4WGP93BI.pgp
Description: PGP signature

_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to