hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: HttpParams read-only access as Set
Date Wed, 15 Dec 2010 19:12:59 GMT
On 15 December 2010 15:26, Oleg Kalnichevski <olegk@apache.org> wrote:
> ...
>
>> In the case of DefaultedHttpParams, I think the local names should
>> also be made available, e.g. through a method such as getLocalNames().
>> But the default getNames() should include all names.
>>

It's easy create a new Set with the current set of names - much harder
to create a read-only Set that tracks subsequent changes to both local
and default sets - so I propose to create a new Set in each case, i.e.
the Sets will be a snapshot of the current names.

This also completely decouples the output from the implementation.

I've updated SVN accordingly.

>> The default names can be easily extracted using getDefaults().getNames().
>>
>> Though I do wonder why the getDefaults() method is present: given that
>> defaults are supposed to be immutable, it seems odd to expose the
>> field and thus permit updates to it.
>>
>> Perhaps the method should be deprecated?
>> Or maybe the method should return an immutable view of the defaults?
>>
>
> Agreed. Feel free to deprecate it.

OK, done.

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

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


Mime
View raw message