hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Volodymyr Kyrychenko (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCORE-400) ContentType.equals & hashCode are not implemented
Date Wed, 22 Apr 2015 16:51:58 GMT

    [ 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

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

View raw message