Re: CVSRoot
Martin Entlicher <[email protected]> Mon, 15 Sep 2003 16:57:39 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.javacvs.devel |
|---|---|
| Organization | Sun Microsystems |
| Message-ID | <[email protected]> |
Yes, this looks good. :-)
-Martin
Ojares Rami EINT wrote:
>
> >Well, it depends on what do you need the equal() method for.
> >You can define the
> >equal() how do you wish, but it must have sense for the usage.
> >E.g. when you
> >would use the equal() for searching of the cvsroot in .cvspass
> >file, you need
> >to take into the account the connection method and user name as well.
> >we need to define the purpose of this method. It's not
> >possible to say whether
> >this is a good or bad implementation unless we have defined
> >the porpose.
>
> You are right.
> How about we implement equals the "natural" way
>
> public boolean equals(Object root) {
> ...
> casting and stuff
> ...
> return this.cvsroot.equals(root.cvsroot);
> }
>
> public int hashCode() {
> return this.cvsroot.hashCode();
> }
>
> and rename my suggested equals method
>
> public refersToSameRepository(CVSRoot root);
>
> - rami
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]