directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "lucas theisen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRSERVER-2089) AttributeType breaks the equals/hashCode override contract
Date Fri, 14 Aug 2015 20:06:46 GMT

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

lucas theisen commented on DIRSERVER-2089:
------------------------------------------

I don't really understand the logic of this method.  As an {{AttributeType}} is a wrapper
around an {{oid}}, would it not be safer/quicker to just compare the {{oid}} values?  I certainly
need to defer to the experts here and feel free to close this ticket if it is valid/intentional
to inherit {{hashCode}} while overriding {{equals}}.

> AttributeType breaks the equals/hashCode override contract
> ----------------------------------------------------------
>
>                 Key: DIRSERVER-2089
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-2089
>             Project: Directory ApacheDS
>          Issue Type: Bug
>            Reporter: lucas theisen
>             Fix For: 2.0.0-M20
>
>
> {{AttributeType}} contains an override of the {{equals}} method without an accompanying
override to {{hashCode}}.  Per the javadoc on {{Object.equals}}:
> {quote}
> Note that it is generally necessary to override the hashCode method whenever this method
is overridden, so as to maintain the general contract for the hashCode method, which states
that equal objects must have equal hash codes.
> {quote}



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

Mime
View raw message