lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [03/26] lucenenet git commit: fix Equals for Query object
Date Fri, 14 Nov 2014 11:59:18 GMT
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 <eladmarg@gmail.com>
Authored: Sat Nov 8 17:37:12 2014 -0800
Committer: eladmarg <eladmarg@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)
             {


Mime
View raw message