The guidelines I've seen say that if two items are equal, then their
hashcodes should match. If they are unequal, their hashcodes should not
match.
I have implemented the equals function like so:
public boolean equals(Object that)
{
if (that == this)
return true;
if
Hi Jeff,
I'm just beating on the KerberosPrincipal class, and am trying to deal
the comments given by people.
The problem I'm having is that I have a name string and a type int.
This is the comment at the top of my equals function:
* From Section 7.2 of rfc1510: When comparing
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
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
Michael Barker wrote:
From the equals() code, its applicable in this case:
// The toString output must match.
if (! toString().equals(((KerberosPrincipal)that).toString()))
return false;
In your message you did phrase things in terms of general contracts.
More to the point:
On Tue, 2005-12-27 at 11:14 -0800, Per Bothner wrote:
Michael Barker wrote:
From the equals() code, its applicable in this case:
// The toString output must match.
if (! toString().equals(((KerberosPrincipal)that).toString()))
return false;
In your message you did
Le lundi 26 décembre 2005 à 09:50 -0500, Brian Jones a écrit :
* From Section 7.2 of rfc1510: When comparing names, a name of type
* UNKNOWN will match principals authenticated with names of any type.
* A principal authenticated with a name of type UNKNOWN, however, will
* only
Heya All,
I'm just beating on the KerberosPrincipal class, and am trying to deal
the comments given by people.
The problem I'm having is that I have a name string and a type int.
This is the comment at the top of my equals function:
* From Section 7.2 of rfc1510: When comparing names, a
8 matches
Mail list logo