You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Digy (JIRA)" <ji...@apache.org> on 2011/07/17 21:24:59 UTC
[Lucene.Net] [jira] [Commented] (LUCENENET-437) Port Contrib.Shingle from Java
[ 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