Am 2018-04-06 um 18:02 schrieb Gary Gregory:
Hi All:

I have cases where I want to use a Set of org.apache.http.NameValuePair
instead of a list of NameValuePair (to track what headers I need to remove
for example.).

But, since NameValuePair  does not specify equals() and hashCode() it feels
like I am using an undocumented feature of the implementation of Basic
NameValuePair.

Adding these two method would tell call sites: Yes, you can use NameValuePair
in a Set, Map, and so on. This assumes that all implementation already
support the two methods... so if a 3rd party does not, the changes are
misleading.

Thought?

This will cause problems. Since Header interface derives from it, you will have to implement both for it. I do remember an issue where exactly this was requested for comparing them, but Oleg rejected to implement it because it is impossible to compare w/o knowing the semantic meaning.

So this has to stay an implementation detail and cannot be enforced.

Michael

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

Reply via email to