avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eung-ju Park" <co...@isoft.co.kr>
Subject Re: Why Version.equals( final Version other )?
Date Fri, 14 Sep 2001 13:08:34 GMT
Hmm...
No problem with common usages.
But may cause problem with collections.

----- Original Message ----- 
From: "Paulo Gaspar" <paulo.gaspar@krankikom.de>
To: "Avalon Development" <avalon-dev@jakarta.apache.org>
Sent: Friday, September 14, 2001 10:13 PM
Subject: RE: Why Version.equals( final Version other )?


> > Well I like the type safety, however you could also easily implement
> 
> But Peter, since any class inherits a method
>   boolean equals(Object obj)
> 
> from Object, you still have no type safe equals() method just by 
> implementing
>   boolean equals( final Version other )
> 
> since any call with a non Version compatible argument can be handled 
> by the Object.equals() implementation.
> 
> 
> Unless you use a different method name, what is the advantage of this
> type-safe version?
> Am I missing something?
> 
> 
> Have fun,
> Paulo Gaspar
> 
> > -----Original Message-----
> > From: Peter Donald [mailto:donaldp@apache.org]
> > Sent: Thursday, September 13, 2001 3:17 PM
> > To: Avalon Development
> > Subject: Re: Why Version.equals( final Version other )?
> >
> >
> > On Thu, 13 Sep 2001 23:15, Eung-ju Park wrote:
> > > Why use "boolean equals( final Version other )"
> > > instead of "boolean equals( final Object other )"?
> >
> > Well I like the type safety, however you could also easily implement
> >
> > public boolean equals( final Object other )
> > {
> >   if( other instanceof Version ) return equals( (Version)other );
> >   else return false;
> > }
> >
> > --
> > Cheers,
> >
> > Pete
> >
> > "abandon all hope , ye who enter here" - dante, inferno
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message