Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-17927: Fixing error prone

Ishan Chattopadhyaya45f46b22115e
diff --git a/solr/core/src/java/org/apache/solr/search/vector/SolrKnnByteVectorQuery.java b/solr/core/src/java/org/apache/solr/search/vector/SolrKnnByteVectorQuery.java
index 0e100d1fb36..99783cea9db 100644
--- a/solr/core/src/java/org/apache/solr/search/vector/SolrKnnByteVectorQuery.java
+++ b/solr/core/src/java/org/apache/solr/search/vector/SolrKnnByteVectorQuery.java
@@ -53,7 +53,7 @@ public class SolrKnnByteVectorQuery extends KnnByteVectorQuery {
public boolean equals(Object obj) {
if (this == obj) return true;
if (!super.equals(obj)) return false;
- if (getClass() != obj.getClass()) return false;
+ if (!(obj instanceof SolrKnnByteVectorQuery)) return false;
SolrKnnByteVectorQuery other = (SolrKnnByteVectorQuery) obj;
return this.topK == other.topK;
}
diff --git a/solr/core/src/java/org/apache/solr/search/vector/SolrKnnFloatVectorQuery.java b/solr/core/src/java/org/apache/solr/search/vector/SolrKnnFloatVectorQuery.java
index 3fa9af57df7..fef5e9176a2 100644
--- a/solr/core/src/java/org/apache/solr/search/vector/SolrKnnFloatVectorQuery.java
+++ b/solr/core/src/java/org/apache/solr/search/vector/SolrKnnFloatVectorQuery.java
@@ -54,7 +54,7 @@ public class SolrKnnFloatVectorQuery extends KnnFloatVectorQuery {
public boolean equals(Object obj) {
if (this == obj) return true;
if (!super.equals(obj)) return false;
- if (getClass() != obj.getClass()) return false;
+ if (!(obj instanceof SolrKnnFloatVectorQuery)) return false;
SolrKnnFloatVectorQuery other = (SolrKnnFloatVectorQuery) obj;
return this.topK == other.topK;
}