On Tue, 2005-12-27 at 10:26 -0800, Per Bothner wrote:
> Michael Barker wrote:
> > Given that the toString() must be the same in order to be equal
> 
> Huh?  I don't believe there is any such requirement.  One would
> normally expect toString to match for equal objects, but it is
> not required.  Atter all, the default toString will not satisfy
> this requirement if equals has been redefined.  And I often put
> in a sequence number in the toString result, for debugging.

>From the equals() code, its applicable in this case:

    // The toString output must match.
    if (! toString().equals(((KerberosPrincipal)that).toString()))
      return false;



_______________________________________________
Classpath mailing list
Classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to