hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [HttpCore] Header should implement equals and hashCode
Date Mon, 03 Apr 2006 20:33:09 GMT
On Mon, 2006-04-03 at 21:18 +0200, Ortwin Gl├╝ck wrote: 
> Oleg,
> 
> I think the Header class should implement equals and hashCode. Header is 
> used in HeaderGroup in a List. The remove method of is used which uses 
> equals to identify the right object.
> 
> Odi
> 

Odi,

How do you see the identity equality of HTTP headers?

(1) By header name 

These headers are identity equal

"Content-Type: text/plain"
"Content-Type: text/xml"

But these are not

"Content-Type: text/plain"
"Content-Length: 0"

(2) By header and case-insensitive value

These headers are identity equal

"Content-Type: text/plain"
"Content-Type: text/plain"
"Content-Type: TEXT/PLAIN"

But these are not

"Content-Type: text/plain"
"Content-Type: text/xml"
"Content-Type: text/xml; charset=utf-8"
"Content-Type: text/xml; charset = utf-8"

Anyway I look at it it just does not seem right. The only reasonable
case I see is that an HTTP header is identity equal to itself (this),
which I believe is the case with the current implementation

Oleg


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


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