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 33988] - Cookie.java hashCode method violates contract
Date Fri, 10 Feb 2006 09:34:33 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=33988>.
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=33988





------- Additional Comments From chiao@chiaocheng.com  2006-02-10 10:34 -------
I was reading your recommended book "effective java", specifically chapter 
3 "obey the general contract when overriding equals".  The following statement 
caught my attention...

"There is simply no way to extend an instantiable class and add an aspect 
while preserving the equals contract."

After looking over his Point/ColorPoint example carefully, it appears that 
this Cookie class is very similar.  And thus has a similar violation of the 
equals contract?

NameValuePair pair = new NameValuePair("test","blank");
Cookie c = new Cookie("blah.com", "test","blank");

pair.equals(c) --> true;
c.equals(pair) --> false;

This seems to break the symmetry portion of the equals contract.

-- 
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