Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Improve Javadocs, fix wrong getContext() javadocs (contained outdated info, leaves() throws UOE if not top-level), remove lucene.experimental from contexts, as this is now the official API to walk reader tree.

Uwe Schindler73b8ca65ca58
diff --git a/lucene/core/src/java/org/apache/lucene/index/AtomicReaderContext.java b/lucene/core/src/java/org/apache/lucene/index/AtomicReaderContext.java
index 2d6f1d73570..decfc3368b1 100644
--- a/lucene/core/src/java/org/apache/lucene/index/AtomicReaderContext.java
+++ b/lucene/core/src/java/org/apache/lucene/index/AtomicReaderContext.java
@@ -21,8 +21,7 @@ import java.util.Collections;
import java.util.List;
/**
- * {@link IndexReaderContext} for {@link AtomicReader} instances
- * @lucene.experimental
+ * {@link IndexReaderContext} for {@link AtomicReader} instances.
*/
public final class AtomicReaderContext extends IndexReaderContext {
/** The readers ord in the top-level's leaves array */
diff --git a/lucene/core/src/java/org/apache/lucene/index/CompositeReader.java b/lucene/core/src/java/org/apache/lucene/index/CompositeReader.java
index e33195a6577..53f4ee9dda3 100644
--- a/lucene/core/src/java/org/apache/lucene/index/CompositeReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/CompositeReader.java
@@ -81,11 +81,10 @@ public abstract class CompositeReader extends IndexReader {
* reader is logically composed of. This method may not
* return {@code null}.
*
- * <p>In contrast to previous Lucene versions this method is no
- * longer public, code that wants to get all {@link AtomicReader}s
+ * <p><b>NOTE:</b> In contrast to previous Lucene versions this method
+ * is no longer public, code that wants to get all {@link AtomicReader}s
* this composite is composed of should use {@link IndexReader#leaves()}.
- *
- * @lucene.internal
+ * @see IndexReader#leaves()
*/
protected abstract List<? extends IndexReader> getSequentialSubReaders();
diff --git a/lucene/core/src/java/org/apache/lucene/index/CompositeReaderContext.java b/lucene/core/src/java/org/apache/lucene/index/CompositeReaderContext.java
index 2ea78abbf54..0c51872085a 100644
--- a/lucene/core/src/java/org/apache/lucene/index/CompositeReaderContext.java
+++ b/lucene/core/src/java/org/apache/lucene/index/CompositeReaderContext.java
@@ -24,7 +24,6 @@ import java.util.List;
/**
* {@link IndexReaderContext} for {@link CompositeReader} instance.
- * @lucene.experimental
*/
public final class CompositeReaderContext extends IndexReaderContext {
private final List<IndexReaderContext> children;
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexReader.java b/lucene/core/src/java/org/apache/lucene/index/IndexReader.java
index eec1f3e1580..9a41845202f 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexReader.java
@@ -391,17 +391,17 @@ public abstract class IndexReader implements Closeable {
* atomic leaf reader at a time. If this reader is not composed of child
* readers, this method returns an {@link AtomicReaderContext}.
* <p>
- * Note: Any of the sub-{@link CompositeReaderContext} instances reference from this
- * top-level context holds a <code>null</code> {@link CompositeReaderContext#leaves()}
- * reference. Only the top-level context maintains the convenience leaf-view
+ * Note: Any of the sub-{@link CompositeReaderContext} instances referenced
+ * from this top-level context do not support {@link CompositeReaderContext#leaves()}.
+ * Only the top-level context maintains the convenience leaf-view
* for performance reasons.
- *
- * @lucene.experimental
*/
public abstract IndexReaderContext getContext();
/**
- * Returns the reader's leaves, or itself if this reader is Atomic.
+ * Returns the reader's leaves, or itself if this reader is atomic.
+ * This is a convenience method calling {@code this.getContext().leaves()}.
+ * @see IndexReaderContext#leaves()
*/
public final List<AtomicReaderContext> leaves() {
return getContext().leaves();
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexReaderContext.java b/lucene/core/src/java/org/apache/lucene/index/IndexReaderContext.java
index 76e57aa86de..49e4a8e19f2 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexReaderContext.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexReaderContext.java
@@ -22,7 +22,6 @@ import java.util.List;
/**
* A struct like class that represents a hierarchical relationship between
* {@link IndexReader} instances.
- * @lucene.experimental
*/
public abstract class IndexReaderContext {
/** The reader context for this reader's immediate parent, or null if none */