lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy (JIRA)" <j...@apache.org>
Subject [Lucene.Net] [jira] [Commented] (LUCENENET-437) Port Contrib.Shingle from Java
Date Sun, 17 Jul 2011 19:24:59 GMT

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

Digy commented on LUCENENET-437:
--------------------------------

Using HashCode for equality comparison is not a good idea.

{code}
///
            ListComparer<string> comp = new ListComparer<string>();
            b = comp.Equals(new List<string>() { "\uA0A2\uA0A2" }, new List<string>()
{ "" });
            System.Diagnostics.Debug.Assert(b == false);
            b = comp.Equals(new List<string>() { "\uA0A2\uA0A2" }, new List<string>()
{ "\uA0A2\uA0A2\uA0A2\uA0A2" });
            System.Diagnostics.Debug.Assert(b == false);

            b = new Lucene.Net.Support.EquatableList<string>(){"\uA0A2\uA0A2" }.Equals(new
Lucene.Net.Support.EquatableList<string>() {""});
            System.Diagnostics.Debug.Assert(b == false);
            new Lucene.Net.Support.EquatableList<string>() { "\uA0A2\uA0A2" }.Equals(new
Lucene.Net.Support.EquatableList<string>() { "\uA0A2\uA0A2\uA0A2\uA0A2"});
            System.Diagnostics.Debug.Assert(b == false);

///

{code}


DIGY

> Port Contrib.Shingle from Java
> ------------------------------
>
>                 Key: LUCENENET-437
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-437
>             Project: Lucene.Net
>          Issue Type: Task
>          Components: Lucene.Net Contrib, Lucene.Net Test
>    Affects Versions: Lucene.Net 2.9.4, Lucene.Net 2.9.4g
>            Reporter: Troy Howard
>            Assignee: Troy Howard
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4, Lucene.Net 2.9.4g
>
>
> Port Contrib.Shingle from Java

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message