hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35365] - No equals operation for Credentials implementations
Date Sun, 19 Jun 2005 10:34:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35365>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35365





------- Additional Comments From olegk@apache.org  2005-06-19 12:34 -------
(In reply to comment #8)
case-sensitive to case-insensitive.
> 
> Different point:
> UsernamePasswordCredentials upc = new UsernamePasswordCredentials("n", "p");
> NTCredentials ntc = new NTCredentials("n", "p", "h", "d");
> 
> using the above, you get the following with my patch:
> upc.equals(ntc) --> true
> ntc.equals(upc) --> false.
> 
> What's the best way to work around this?  Changing the test in 
> UsernamePasswordCredentials.equals(), so that it does
>  o.getClass() == this.getClass()
> 
> would work, but is that the best way?
> 

Eric,
I think this problem cannot be fully solved by devising a very elaborate equals
method that works in all cases, because the concept of credentials equality can
be (often is) context dependent. Having a specific Comparator for a specific
context should be the way to go. 

I believe the patch is good to be checked in

Oleg


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message