Skip to content

Apache Lucene open-source search software

LUCENE-8388: Remove PostingsEnum#attributes()

Alan Woodward6d6e67140b44
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 53c19d5d201..a526ae4a80a 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -53,6 +53,9 @@ API Changes
* LUCENE-8373: StandardAnalyzer.ENGLISH_STOP_WORD_SET has been removed
(Alan Woodward)
+* LUCENE-8388: Unused PostingsEnum#attributes() method has been removed
+ (Alan Woodward)
+
Changes in Runtime Behavior
* LUCENE-8333: Switch MoreLikeThis.setMaxDocFreqPct to use maxDoc instead of
diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java b/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java
index 3d86beefefc..8e1f272d3d7 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java
@@ -236,11 +236,6 @@ public abstract class FilterLeafReader extends LeafReader {
this.in = in;
}
- @Override
- public AttributeSource attributes() {
- return in.attributes();
- }
-
@Override
public int docID() {
return in.docID();
diff --git a/lucene/core/src/java/org/apache/lucene/index/PostingsEnum.java b/lucene/core/src/java/org/apache/lucene/index/PostingsEnum.java
index fdd32a9f2fe..e774a78d228 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PostingsEnum.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PostingsEnum.java
@@ -20,7 +20,6 @@ package org.apache.lucene.index;
import java.io.IOException;
import org.apache.lucene.search.DocIdSetIterator;
-import org.apache.lucene.util.AttributeSource;
import org.apache.lucene.util.BytesRef;
/** Iterates through the postings.
@@ -63,8 +62,6 @@ public abstract class PostingsEnum extends DocIdSetIterator {
return (flags & feature) == feature;
}
- private AttributeSource atts = null;
-
/** Sole constructor. (For invocation by subclass
* constructors, typically implicit.) */
protected PostingsEnum() {
@@ -81,12 +78,6 @@ public abstract class PostingsEnum extends DocIdSetIterator {
* the result of this method is undefined.
*/
public abstract int freq() throws IOException;
-
- /** Returns the related attributes. */
- public AttributeSource attributes() {
- if (atts == null) atts = new AttributeSource();
- return atts;
- }
/**
* Returns the next position, or -1 if positions were not indexed.