lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei Iliev (JIRA)" <>
Subject [jira] Created: (LUCENENET-284) java vs .Net GetHashCode and Equals for ArrayList
Date Wed, 18 Nov 2009 18:22:39 GMT
java vs .Net GetHashCode and Equals for ArrayList 

                 Key: LUCENENET-284
             Project: Lucene.Net
          Issue Type: Bug
            Reporter: Andrei Iliev
         Attachments: ArrayList.patch

1)In java the hash code of a list (and ArrayList) is defined to be the result of the following
hashCode = 1;
  Iterator i = list.iterator();
  while (i.hasNext()) {
      Object obj =;
      hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
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
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.

View raw message