hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: HostConfiguration.equals() is synchronized - why is that?
Date Wed, 15 Jun 2005 18:35:22 GMT
Eric,

It is purely due to the historical reasons. HostConfiguration was
initially introduced around the same time when Mike wrote
MuitiThreadedHttpConnectionManager, which used instances of
HostConfiguration internally to maintain maps of connection pools. 

A lot has changed since that time. HostConfiguration has been modified
numerous times. These days it mainly used in "initialize one, treat as
immutable ever after", even though the class itself is not immutable
strictly speaking. Hence I personally think it is okay to make #equals()
unsynchronized 

Oleg



On Wed, 2005-06-15 at 10:50 -0700, Eric Johnson wrote: 
> As I was doing the changes to the Credentials implementations for
> equals, I noticed that HostConfiguration.equals() is synchronized.  This
> isn't particularly an issue, except that hashCode() is not
> synchronized.  Seems like it should be both or neither.
> 
> Scanning the code, I couldn't see any place that HttpClient uses the
> synchronization internally.  Anyone know why this is the way it is?
> 
> -Eric.
> 
> ---------------------------------------------------------------------
> 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