[
https://issues.apache.org/jira/browse/DIRSERVER-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14698135#comment-14698135
]
Emmanuel Lecharny commented on DIRSERVER-2089:
----------------------------------------------
FTR, an OID defines an AttributeType. Although for an API, we may manipulate
many different instances of an AttributeType, with the same OID but for
different schemas.
This may seems a bit stretched, but I'm afraid this is necessary to distinguish
various AT from various origins.
Note that this part of teh code is a bit convoluted, as the inherited
{{hashCode}} method does nothing, it just returns the value which has been
computed by a factory, calling the {{lock()}} method...
Anyway, wz can discuss these choices. I'm not against moving back to something
simpler, like using the OID to compute the hashcode.
> 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)