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

Volodymyr Kyrychenko commented on HTTPCORE-400:
-----------------------------------------------

according to RFC ordering does not matter. Repeating of the attributes is not 
defined at the corresponding RFC since this practice is not anticipated. Hands 
this case does not require special handling. I believe implementation (pseudo) 
of 

this.attrs.length == that.attrs.length && 
this.attrs.ordered.equalsIgnoreNameCase(that.attrs.ordered) 

should be enough.

I believe attributes should be preprocessed in create() method in the way that 
allows good implementation performance-wise of  equals && hashCode methods. 
Attribute names should be lowercased (as permitted by RFC and this operation is 
already in place for mime) and ordered by name, value. This way equals and 
hashCode implementation is straight "compare everything". 



> ContentType.equals & hashCode are not implemented
> -------------------------------------------------
>
>                 Key: HTTPCORE-400
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-400
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>            Reporter: Volodymyr Kyrychenko
>
> Since equals and hashCode are not implemented it's impossible to use them in 
> handful of cases



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to