You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2015/10/09 12:08:58 UTC

svn commit: r1707686 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/CHANGES.txt lucene/core/ lucene/core/src/java/org/apache/lucene/search/Query.java

Author: jpountz
Date: Fri Oct  9 10:08:57 2015
New Revision: 1707686

URL: http://svn.apache.org/viewvc?rev=1707686&view=rev
Log:
LUCENE-6467: Simplify Query.equals.

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/Query.java

Modified: lucene/dev/branches/branch_5x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/CHANGES.txt?rev=1707686&r1=1707685&r2=1707686&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/lucene/CHANGES.txt Fri Oct  9 10:08:57 2015
@@ -183,6 +183,8 @@ Other
   reflection on Java's runtime classes is very restricted.
   (Robert Muir, Uwe Schindler)
 
+* LUCENE-6467: Simplify Query.equals. (Paul Elschot via Adrien Grand)
+
 Build
 
 * LUCENE-6732: Improve checker for invalid source patterns to also

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/Query.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/Query.java?rev=1707686&r1=1707685&r2=1707686&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/Query.java (original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/Query.java Fri Oct  9 10:08:57 2015
@@ -113,15 +113,11 @@ public abstract class Query implements C
 
   @Override
   public boolean equals(Object obj) {
-    if (this == obj)
-      return true;
     if (obj == null)
       return false;
     if (getClass() != obj.getClass())
       return false;
     Query other = (Query) obj;
-    if (Float.floatToIntBits(boost) != Float.floatToIntBits(other.boost))
-      return false;
-    return true;
+    return Float.floatToIntBits(boost) == Float.floatToIntBits(other.boost)
   }
 }