lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Garski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-284) java vs .Net GetHashCode and Equals for ArrayList
Date Thu, 19 Nov 2009 21:55:39 GMT

    [ https://issues.apache.org/jira/browse/LUCENENET-284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780291#action_12780291
] 

Michael Garski commented on LUCENENET-284:
------------------------------------------

Nick - I'm not able to apply your patch (error on chunk size/number of lines changed).  Can
you create a new patch?  There are a few tests in Search.Spans that this would probably take
care of and I'd like to verify that as I am working through some of those tests today.

> java vs .Net GetHashCode and Equals for ArrayList 
> --------------------------------------------------
>
>                 Key: LUCENENET-284
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-284
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Andrei Iliev
>         Attachments: ArrayList.patch, EquatableListOfT.patch
>
>
> 1)In java the hash code of a list (and ArrayList) is defined to be the result of the
following calc:
> <code>
> hashCode = 1;
>   Iterator i = list.iterator();
>   while (i.hasNext()) {
>       Object obj = i.next();
>       hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
>   }
> </code>
> In .Net it hash code of object itself.
>  
> 2) In java two lists are defined to be equal if they contain the same elements in the
same order. 
> In .Net it compares the object references.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message