Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

fix IndexCommit.equals to compare version of the commit instead of segments filename, in addition to the Directory

Michael McCandless6bbb079a688a
diff --git a/src/java/org/apache/lucene/index/IndexCommit.java b/src/java/org/apache/lucene/index/IndexCommit.java
index e0d40c9d6cf..c02c8ee354e 100644
--- a/src/java/org/apache/lucene/index/IndexCommit.java
+++ b/src/java/org/apache/lucene/index/IndexCommit.java
@@ -81,7 +81,7 @@ public abstract class IndexCommit implements IndexCommitPoint {
public boolean equals(Object other) {
if (other instanceof IndexCommit) {
IndexCommit otherCommit = (IndexCommit) other;
- return otherCommit.getDirectory().equals(getDirectory()) && otherCommit.getSegmentsFileName().equals(getSegmentsFileName());
+ return otherCommit.getDirectory().equals(getDirectory()) && otherCommit.getVersion() == getVersion();
} else
return false;
}