You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Richard Wise (Jira)" <ji...@apache.org> on 2019/10/23 11:33:00 UTC

[jira] [Commented] (HTTPCORE-439) Contribute BasicHeader override of equals() and hashCode()

    [ https://issues.apache.org/jira/browse/HTTPCORE-439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957777#comment-16957777 ] 

Richard Wise commented on HTTPCORE-439:
---------------------------------------

Can I understand why equals and hashcode were removed? I understand that you may want different semantics in certain scenarios, but equals and hashcode are more widely used (e.g. testing) and it is not best practice to use the default equals and hashcode implementations defined in Object?

> Contribute BasicHeader override of equals() and hashCode()
> ----------------------------------------------------------
>
>                 Key: HTTPCORE-439
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-439
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: Contrib, HttpCore
>    Affects Versions: 5.0-alpha2
>         Environment: All
>            Reporter: John Lewis
>            Priority: Major
>             Fix For: 5.0-alpha2
>
>
> When removing headers from a HeaderGroup, the header is only removed if the header you are trying to remove is an object in the header list.  It seems it would be better if headers were removed that matched the name and value of one of the objects in the list.  To accomplish this, I have overridden the equals and hashCode methods in BasicHeader.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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