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/12/22 14:10:03 UTC

[3/3] lucenenet git commit: Bring Query.Equals() to be back in par with the Java impl

Bring Query.Equals() to be back in par with the Java impl


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

Branch: refs/heads/master
Commit: c0c101953e14398a8e3f01f185a3ecfcecbc1609
Parents: 583627a
Author: Itamar Syn-Hershko <it...@code972.com>
Authored: Mon Dec 22 15:09:35 2014 +0200
Committer: Itamar Syn-Hershko <it...@code972.com>
Committed: Mon Dec 22 15:09:35 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c0c10195/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 d553af6..1448093 100644
--- a/src/Lucene.Net.Core/Search/Query.cs
+++ b/src/Lucene.Net.Core/Search/Query.cs
@@ -134,12 +134,17 @@ namespace Lucene.Net.Search
                 return true;
             }
 
+            if (GetType() != obj.GetType())
+            {
+                return false;
+            }
+
             var other = obj as Query;
             if (other == null)
             {
                 return false;
             }
-           
+
             if (Number.FloatToIntBits(Boost) != Number.FloatToIntBits(other.Boost))
             {
                 return false;