Skip to content

Apache Lucene open-source search software

LUCENE-8228: removed obsolete IndexDeletionPolicy clone() requirements from the javadoc.

Dawid Weisse96811c7a5b2
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index c531b5af542..1a6c1ef93f5 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -113,6 +113,9 @@ New Features
Other
+* LUCENE-8228: removed obsolete IndexDeletionPolicy clone() requirements from
+ the javadoc. (Dawid Weiss)
+
* LUCENE-8219: Use a realistic estimate of the number of nodes and links in
LevensteinAutomaton.java, to save reallocation of arrays.
(Christian Ziech)
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexDeletionPolicy.java b/lucene/core/src/java/org/apache/lucene/index/IndexDeletionPolicy.java
index b556a044421..43d6bfc6f91 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexDeletionPolicy.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexDeletionPolicy.java
@@ -20,17 +20,17 @@ package org.apache.lucene.index;
import java.util.List;
import java.io.IOException;
-import org.apache.lucene.store.Directory;
-
/**
* <p>Expert: policy for deletion of stale {@link IndexCommit index commits}.
*
- * <p>Implement this interface, and pass it to one
- * of the {@link IndexWriter} or {@link IndexReader}
- * constructors, to customize when older
+ * <p>Implement this interface, and set it on
+ * {@link IndexWriterConfig#setIndexDeletionPolicy(IndexDeletionPolicy)}
+ * to customize when older
* {@link IndexCommit point-in-time commits}
- * are deleted from the index directory. The default deletion policy
- * is {@link KeepOnlyLastCommitDeletionPolicy}, which always
+ * are deleted from the index directory.</p>
+ *
+ * <p>The default deletion policy
+ * is {@link KeepOnlyLastCommitDeletionPolicy}, always
* removes old commits as soon as a new commit is done (this
* matches the behavior before 2.2).</p>
*
@@ -48,10 +48,6 @@ import org.apache.lucene.store.Directory;
* target="top"
* href="http://issues.apache.org/jira/browse/LUCENE-710">LUCENE-710</a>
* for details.</p>
- *
- * <p>Implementers of sub-classes should make sure that {@link #clone()}
- * returns an independent instance able to work with any other {@link IndexWriter}
- * or {@link Directory} instance.</p>
*/
public abstract class IndexDeletionPolicy {
diff --git a/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java b/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java
index 9b211e19066..95c8bb8efca 100644
--- a/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java
+++ b/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java
@@ -38,10 +38,4 @@ public final class NoDeletionPolicy extends IndexDeletionPolicy {
@Override
public void onInit(List<? extends IndexCommit> commits) {}
-
- @Override
- public IndexDeletionPolicy clone() {
- return this;
- }
-
}
diff --git a/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java b/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java
index 3616d4e545b..2969d5ba565 100644
--- a/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java
+++ b/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java
@@ -267,11 +267,5 @@ public final class IndexDeletionPolicyWrapper extends IndexDeletionPolicy {
return 0;
}
}
-
- @Override
- public IndexDeletionPolicy clone() {
- // see class-level javadocs
- return this;
- }
}