You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2014/11/14 12:59:18 UTC

[03/26] lucenenet git commit: fix Equals for Query object

fix Equals for Query object


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ca463d34
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ca463d34
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ca463d34

Branch: refs/heads/master
Commit: ca463d34051f3abac7c4ae4f104a6af03c1e14f9
Parents: 9971717
Author: eladmarg <el...@gmail.com>
Authored: Sat Nov 8 17:37:12 2014 -0800
Committer: eladmarg <el...@gmail.com>
Committed: Sat Nov 8 17:37:12 2014 -0800

----------------------------------------------------------------------
 src/Lucene.Net.Core/Search/Query.cs | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ca463d34/src/Lucene.Net.Core/Search/Query.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Query.cs b/src/Lucene.Net.Core/Search/Query.cs
index 3a66bd3..5a32b5b 100644
--- a/src/Lucene.Net.Core/Search/Query.cs
+++ b/src/Lucene.Net.Core/Search/Query.cs
@@ -133,6 +133,14 @@ namespace Lucene.Net.Search
             {
                 return true;
             }
+            if (Object.ReferenceEquals(obj, this))
+            {
+                return true;
+            }
+
+            if (GetType() != obj.GetType())
+                return false;
+
             var other = obj as Query;
             if (other == null)
             {