diff --git a/gradle/validation/ecj-lint/ecj.javadocs.prefs b/gradle/validation/ecj-lint/ecj.javadocs.prefs index 8bfb42da977..b85d32aa47c 100644 --- a/gradle/validation/ecj-lint/ecj.javadocs.prefs +++ b/gradle/validation/ecj-lint/ecj.javadocs.prefs @@ -85,7 +85,7 @@ org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=error diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ConcatenateGraphFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ConcatenateGraphFilter.java index bfdfb4316bf..6c938268336 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ConcatenateGraphFilter.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ConcatenateGraphFilter.java @@ -147,6 +147,9 @@ public final class ConcatenateGraphFilter extends TokenStream { super.reset(); // we only capture this if we really need it to save the UTF-8 to UTF-16 conversion charTermAttribute = getAttribute(CharTermAttribute.class); // may return null + // make sure the TermToBytesRefAttribute attribute is implemented by our class, not via + // CharTermAttribute's + assert getAttribute(TermToBytesRefAttribute.class) instanceof BytesRefBuilderTermAttributeImpl; wasReset = true; } @@ -347,8 +350,9 @@ public final class ConcatenateGraphFilter extends TokenStream { * * @lucene.internal */ + @SuppressWarnings("unused") // do not warn/error on redundant interface public static final class BytesRefBuilderTermAttributeImpl extends AttributeImpl - implements BytesRefBuilderTermAttribute, TermToBytesRefAttribute { + implements BytesRefBuilderTermAttribute, TermToBytesRefAttribute /*required*/ { private final BytesRefBuilder bytes = new BytesRefBuilder(); private transient CharsRefBuilder charsRef; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ProtectedTermFilterFactory.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ProtectedTermFilterFactory.java index 71f4e1a9c69..b0d7f9bb705 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ProtectedTermFilterFactory.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/ProtectedTermFilterFactory.java @@ -31,7 +31,6 @@ import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.util.ResourceLoader; -import org.apache.lucene.util.ResourceLoaderAware; /** * Factory for a {@link ProtectedTermFilter} @@ -82,8 +81,7 @@ import org.apache.lucene.util.ResourceLoaderAware; * @since 7.4.0 * @lucene.spi {@value #NAME} */ -public class ProtectedTermFilterFactory extends ConditionalTokenFilterFactory - implements ResourceLoaderAware { +public class ProtectedTermFilterFactory extends ConditionalTokenFilterFactory { public static final String NAME = "protectedTerm"; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/FloatEncoder.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/FloatEncoder.java index b90e137c779..5cf3319aaf5 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/FloatEncoder.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/FloatEncoder.java @@ -23,7 +23,7 @@ import org.apache.lucene.util.BytesRef; * * @see org.apache.lucene.analysis.payloads.PayloadHelper#encodeFloat(float, byte[], int) */ -public class FloatEncoder extends AbstractEncoder implements PayloadEncoder { +public class FloatEncoder extends AbstractEncoder { @Override public BytesRef encode(char[] buffer, int offset, int length) { diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/IdentityEncoder.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/IdentityEncoder.java index 22dd4a186ba..96431dd1835 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/IdentityEncoder.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/IdentityEncoder.java @@ -23,7 +23,7 @@ import java.nio.charset.StandardCharsets; import org.apache.lucene.util.BytesRef; /** Does nothing other than convert the char array to a byte array using the specified encoding. */ -public class IdentityEncoder extends AbstractEncoder implements PayloadEncoder { +public class IdentityEncoder extends AbstractEncoder { protected Charset charset = StandardCharsets.UTF_8; public IdentityEncoder() {} diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/IntegerEncoder.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/IntegerEncoder.java index 01ac02640a3..476718fe9ee 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/IntegerEncoder.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/payloads/IntegerEncoder.java @@ -24,7 +24,7 @@ import org.apache.lucene.util.BytesRef; * *
See {@link org.apache.lucene.analysis.payloads.PayloadHelper#encodeInt(int, byte[], int)}.
*/
-public class IntegerEncoder extends AbstractEncoder implements PayloadEncoder {
+public class IntegerEncoder extends AbstractEncoder {
@Override
public BytesRef encode(char[] buffer, int offset, int length) {
diff --git a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttributeImpl.java b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttributeImpl.java
index d2a389bceae..263656fd0de 100644
--- a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttributeImpl.java
+++ b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttributeImpl.java
@@ -25,7 +25,7 @@ import org.apache.lucene.util.AttributeReflector;
*
* @lucene.experimental
*/
-public class ScriptAttributeImpl extends AttributeImpl implements ScriptAttribute, Cloneable {
+public class ScriptAttributeImpl extends AttributeImpl implements ScriptAttribute {
private int code = UScript.COMMON;
/** Initializes this attribute with Attributes are used to add data in a dynamic, yet type-safe way to a source of usually
* streamed objects, e. g. a {@link org.apache.lucene.analysis.TokenStream}.
+ *
+ * All implementations must list all implemented {@link Attribute} interfaces in their {@code
+ * implements} clause. {@code AttributeSource} reflectively identifies all attributes and makes them
+ * available to consumers like {@code TokenStream}s.
*/
public abstract class AttributeImpl implements Cloneable, Attribute {
/**
diff --git a/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java b/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java
index 7193ca16702..a59d0649192 100644
--- a/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java
+++ b/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java
@@ -181,6 +181,9 @@ public class AttributeSource {
* retrieve the wanted attributes using {@link #getAttribute} after adding with this method and
* cast to your class. The recommended way to use custom implementations is using an {@link
* AttributeFactory}.
+ *
+ * This method will only add the Attribute interfaces directly implemented by the class and its
+ * super classes.
*/
public final void addAttributeImpl(final AttributeImpl att) {
final Class extends AttributeImpl> clazz = att.getClass();
diff --git a/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java b/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java
index 7b79ece2d9d..707ee76b197 100644
--- a/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java
+++ b/lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java
@@ -28,7 +28,7 @@ import org.apache.lucene.search.DocIdSetIterator;
*
* @lucene.internal
*/
-public final class FixedBitSet extends BitSet implements Bits, Accountable {
+public final class FixedBitSet extends BitSet {
private static final long BASE_RAM_BYTES_USED =
RamUsageEstimator.shallowSizeOfInstance(FixedBitSet.class);
diff --git a/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java b/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java
index 2952ee2072c..2a1762a2675 100644
--- a/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java
+++ b/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java
@@ -33,7 +33,7 @@ import org.apache.lucene.search.DocIdSetIterator;
*
* @lucene.internal
*/
-public class SparseFixedBitSet extends BitSet implements Bits, Accountable {
+public class SparseFixedBitSet extends BitSet {
private static final long BASE_RAM_BYTES_USED =
RamUsageEstimator.shallowSizeOfInstance(SparseFixedBitSet.class);
diff --git a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestBytesRefAttImpl.java b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestBytesRefAttImpl.java
index 54f23e7189f..ebf20d8dc56 100644
--- a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestBytesRefAttImpl.java
+++ b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestBytesRefAttImpl.java
@@ -16,6 +16,7 @@
*/
package org.apache.lucene.analysis.tokenattributes;
+import java.util.stream.Stream;
import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;
@@ -44,4 +45,11 @@ public class TestBytesRefAttImpl extends LuceneTestCase {
assertEquals("Copied instance's hashcode must be equal", att.hashCode(), copy.hashCode());
return copy;
}
+
+ public void testLucene9856() {
+ assertTrue(
+ "BytesTermAttributeImpl must explicitly declare to implement TermToBytesRefAttribute",
+ Stream.of(BytesTermAttributeImpl.class.getInterfaces())
+ .anyMatch(TermToBytesRefAttribute.class::equals));
+ }
}
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java b/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
index df9ef10dc43..93ef7e87fc2 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java
@@ -46,8 +46,7 @@ import org.apache.lucene.util.DocIdSetBuilder;
* instantiate one of the {@link Facets} subclasses to do the facet counting. Use the {@code search}
* utility methods to perform an "ordinary" search but also collect into a {@link Collector}.
*/
-// redundant 'implements Collector' to workaround javadocs bugs
-public class FacetsCollector extends SimpleCollector implements Collector {
+public class FacetsCollector extends SimpleCollector {
private LeafReaderContext context;
private Scorable scorer;
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CoreParser.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CoreParser.java
index 9db8d04a6a9..f11477c13a9 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CoreParser.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CoreParser.java
@@ -34,7 +34,7 @@ import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
/** Assembles a QueryBuilder which uses only core Lucene Query objects */
-public class CoreParser implements QueryBuilder, SpanQueryBuilder {
+public class CoreParser implements SpanQueryBuilder {
protected String defaultField;
protected Analyzer analyzer;
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
index 0ab2efb6574..d02a149b24a 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
@@ -24,8 +24,8 @@ import java.io.InputStream;
*
* @lucene.experimental
*/
-public class GeoCompositeMembershipShape extends GeoBaseCompositeMembershipShapeUScript.COMMON
*/
diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/BaseFormAttributeImpl.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/BaseFormAttributeImpl.java
index e1a6e43c022..845c318c214 100644
--- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/BaseFormAttributeImpl.java
+++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/BaseFormAttributeImpl.java
@@ -21,7 +21,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Attribute for {@link Token#getBaseForm()}. */
-public class BaseFormAttributeImpl extends AttributeImpl implements BaseFormAttribute, Cloneable {
+public class BaseFormAttributeImpl extends AttributeImpl implements BaseFormAttribute {
private Token token;
@Override
diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/InflectionAttributeImpl.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/InflectionAttributeImpl.java
index 21df3e9a138..36a04dce089 100644
--- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/InflectionAttributeImpl.java
+++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/InflectionAttributeImpl.java
@@ -22,8 +22,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Attribute for Kuromoji inflection data. */
-public class InflectionAttributeImpl extends AttributeImpl
- implements InflectionAttribute, Cloneable {
+public class InflectionAttributeImpl extends AttributeImpl implements InflectionAttribute {
private Token token;
@Override
diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/PartOfSpeechAttributeImpl.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/PartOfSpeechAttributeImpl.java
index c2f54ffd952..464adbdf7ad 100644
--- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/PartOfSpeechAttributeImpl.java
+++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/PartOfSpeechAttributeImpl.java
@@ -22,8 +22,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Attribute for {@link Token#getPartOfSpeech()}. */
-public class PartOfSpeechAttributeImpl extends AttributeImpl
- implements PartOfSpeechAttribute, Cloneable {
+public class PartOfSpeechAttributeImpl extends AttributeImpl implements PartOfSpeechAttribute {
private Token token;
@Override
diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/ReadingAttributeImpl.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/ReadingAttributeImpl.java
index c71aa64ffe0..bada2421bed 100644
--- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/ReadingAttributeImpl.java
+++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/tokenattributes/ReadingAttributeImpl.java
@@ -22,7 +22,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Attribute for Kuromoji reading data */
-public class ReadingAttributeImpl extends AttributeImpl implements ReadingAttribute, Cloneable {
+public class ReadingAttributeImpl extends AttributeImpl implements ReadingAttribute {
private Token token;
@Override
diff --git a/lucene/analysis/morfologik/src/java/org/apache/lucene/analysis/morfologik/MorphosyntacticTagsAttributeImpl.java b/lucene/analysis/morfologik/src/java/org/apache/lucene/analysis/morfologik/MorphosyntacticTagsAttributeImpl.java
index 0c3ad9c2e73..a749045f0dd 100644
--- a/lucene/analysis/morfologik/src/java/org/apache/lucene/analysis/morfologik/MorphosyntacticTagsAttributeImpl.java
+++ b/lucene/analysis/morfologik/src/java/org/apache/lucene/analysis/morfologik/MorphosyntacticTagsAttributeImpl.java
@@ -27,7 +27,7 @@ import org.apache.lucene.util.AttributeReflector;
* @see MorphosyntacticTagsAttribute
*/
public class MorphosyntacticTagsAttributeImpl extends AttributeImpl
- implements MorphosyntacticTagsAttribute, Cloneable {
+ implements MorphosyntacticTagsAttribute {
/** Initializes this attribute with no tags */
public MorphosyntacticTagsAttributeImpl() {}
diff --git a/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/tokenattributes/PartOfSpeechAttributeImpl.java b/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/tokenattributes/PartOfSpeechAttributeImpl.java
index a46b88859e3..a1b04cb7f05 100644
--- a/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/tokenattributes/PartOfSpeechAttributeImpl.java
+++ b/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/tokenattributes/PartOfSpeechAttributeImpl.java
@@ -28,8 +28,7 @@ import org.apache.lucene.util.AttributeReflector;
*
* @lucene.experimental
*/
-public class PartOfSpeechAttributeImpl extends AttributeImpl
- implements PartOfSpeechAttribute, Cloneable {
+public class PartOfSpeechAttributeImpl extends AttributeImpl implements PartOfSpeechAttribute {
private Token token;
@Override
diff --git a/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/tokenattributes/ReadingAttributeImpl.java b/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/tokenattributes/ReadingAttributeImpl.java
index b6467a09f05..e3a6c0d9062 100644
--- a/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/tokenattributes/ReadingAttributeImpl.java
+++ b/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/tokenattributes/ReadingAttributeImpl.java
@@ -25,7 +25,7 @@ import org.apache.lucene.util.AttributeReflector;
*
* @lucene.experimental
*/
-public class ReadingAttributeImpl extends AttributeImpl implements ReadingAttribute, Cloneable {
+public class ReadingAttributeImpl extends AttributeImpl implements ReadingAttribute {
private Token token;
@Override
diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsReader.java
index 6d8a248042f..c2f975d0a71 100644
--- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsReader.java
+++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/compressing/Lucene50CompressingTermVectorsReader.java
@@ -16,7 +16,6 @@
*/
package org.apache.lucene.backward_codecs.lucene50.compressing;
-import java.io.Closeable;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
@@ -58,8 +57,7 @@ import org.apache.lucene.util.packed.PackedInts;
*
* @lucene.experimental
*/
-public final class Lucene50CompressingTermVectorsReader extends TermVectorsReader
- implements Closeable {
+public final class Lucene50CompressingTermVectorsReader extends TermVectorsReader {
// hard limit on the maximum number of documents per chunk
static final int MAX_DOCUMENTS_PER_CHUNK = 128;
diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene60/Lucene60PointsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene60/Lucene60PointsReader.java
index 75ca01c9d79..f7550570cf6 100644
--- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene60/Lucene60PointsReader.java
+++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene60/Lucene60PointsReader.java
@@ -16,7 +16,6 @@
*/
package org.apache.lucene.backward_codecs.lucene60;
-import java.io.Closeable;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -32,7 +31,7 @@ import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.bkd.BKDReader;
/** Reads point values previously written with Lucene60PointsWriter */
-public class Lucene60PointsReader extends PointsReader implements Closeable {
+public class Lucene60PointsReader extends PointsReader {
final IndexInput dataIn;
final SegmentReadState readState;
final Mapfile.query.maker.file=c:/myqueries.txt
* file.query.maker.default.field=body
*/
-public class FileBasedQueryMaker extends AbstractQueryMaker implements QueryMaker {
+public class FileBasedQueryMaker extends AbstractQueryMaker {
@Override
protected Query[] prepareQueries() throws Exception {
diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersQueryMaker.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersQueryMaker.java
index 795e3a66ac6..1f3216d85b8 100644
--- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersQueryMaker.java
+++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersQueryMaker.java
@@ -34,7 +34,7 @@ import org.apache.lucene.search.spans.SpanTermQuery;
* A QueryMaker that makes queries devised manually (by Grant Ingersoll) for searching in the
* Reuters collection.
*/
-public class ReutersQueryMaker extends AbstractQueryMaker implements QueryMaker {
+public class ReutersQueryMaker extends AbstractQueryMaker {
private static String[] STANDARD_QUERIES = {
// Start with some short queries
diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleQueryMaker.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleQueryMaker.java
index c7036f556ca..ceaabcbcfe7 100644
--- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleQueryMaker.java
+++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleQueryMaker.java
@@ -30,7 +30,7 @@ import org.apache.lucene.search.TermQuery;
* A QueryMaker that makes queries for a collection created using {@link
* org.apache.lucene.benchmark.byTask.feeds.SingleDocSource}.
*/
-public class SimpleQueryMaker extends AbstractQueryMaker implements QueryMaker {
+public class SimpleQueryMaker extends AbstractQueryMaker {
/**
* Prepare the queries for this test. Extending classes can override this method for preparing
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java b/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java
index fff2c569c46..3784f4113b6 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java
@@ -16,7 +16,6 @@
*/
package org.apache.lucene.codecs.blockterms;
-import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -52,7 +51,7 @@ import org.apache.lucene.util.IOUtils;
*
* @lucene.experimental
*/
-public class BlockTermsWriter extends FieldsConsumer implements Closeable {
+public class BlockTermsWriter extends FieldsConsumer {
static final String CODEC_NAME = "BlockTermsWriter";
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/BytesTermAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/BytesTermAttributeImpl.java
index 8783bbfedf9..c9975534b47 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/BytesTermAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/BytesTermAttributeImpl.java
@@ -26,8 +26,9 @@ import org.apache.lucene.util.BytesRef;
*
* @lucene.internal
*/
+@SuppressWarnings("unused") // do not warn/error on redundant interface
public class BytesTermAttributeImpl extends AttributeImpl
- implements BytesTermAttribute, TermToBytesRefAttribute {
+ implements BytesTermAttribute, TermToBytesRefAttribute /*required*/ {
private BytesRef bytes;
/** Initialize this attribute with no bytes. */
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java
index bae5c60968e..c494bda1ab2 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/CharTermAttributeImpl.java
@@ -26,7 +26,7 @@ import org.apache.lucene.util.BytesRefBuilder;
/** Default implementation of {@link CharTermAttribute}. */
public class CharTermAttributeImpl extends AttributeImpl
- implements CharTermAttribute, TermToBytesRefAttribute, Cloneable {
+ implements CharTermAttribute, TermToBytesRefAttribute {
private static int MIN_BUFFER_SIZE = 10;
private char[] termBuffer = new char[ArrayUtil.oversize(MIN_BUFFER_SIZE, Character.BYTES)];
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/FlagsAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/FlagsAttributeImpl.java
index 9a1bdc37db1..9fe02aaf774 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/FlagsAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/FlagsAttributeImpl.java
@@ -20,7 +20,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Default implementation of {@link FlagsAttribute}. */
-public class FlagsAttributeImpl extends AttributeImpl implements FlagsAttribute, Cloneable {
+public class FlagsAttributeImpl extends AttributeImpl implements FlagsAttribute {
private int flags = 0;
/** Initialize this attribute with no bits set */
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttributeImpl.java
index 8ddae001100..8e05ece82b3 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttributeImpl.java
@@ -20,7 +20,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Default implementation of {@link OffsetAttribute}. */
-public class OffsetAttributeImpl extends AttributeImpl implements OffsetAttribute, Cloneable {
+public class OffsetAttributeImpl extends AttributeImpl implements OffsetAttribute {
private int startOffset;
private int endOffset;
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PayloadAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PayloadAttributeImpl.java
index da36ebd01f9..b17f0183313 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PayloadAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PayloadAttributeImpl.java
@@ -21,7 +21,7 @@ import org.apache.lucene.util.AttributeReflector;
import org.apache.lucene.util.BytesRef;
/** Default implementation of {@link PayloadAttribute}. */
-public class PayloadAttributeImpl extends AttributeImpl implements PayloadAttribute, Cloneable {
+public class PayloadAttributeImpl extends AttributeImpl implements PayloadAttribute {
private BytesRef payload;
/** Initialize this attribute with no payload. */
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionIncrementAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionIncrementAttributeImpl.java
index 80ef0d42fbf..31ceca1a62f 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionIncrementAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionIncrementAttributeImpl.java
@@ -21,7 +21,7 @@ import org.apache.lucene.util.AttributeReflector;
/** Default implementation of {@link PositionIncrementAttribute}. */
public class PositionIncrementAttributeImpl extends AttributeImpl
- implements PositionIncrementAttribute, Cloneable {
+ implements PositionIncrementAttribute {
private int positionIncrement = 1;
/** Initialize this attribute with position increment of 1 */
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionLengthAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionLengthAttributeImpl.java
index 3a59faa60e0..b7dd308e0e1 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionLengthAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionLengthAttributeImpl.java
@@ -20,8 +20,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Default implementation of {@link PositionLengthAttribute}. */
-public class PositionLengthAttributeImpl extends AttributeImpl
- implements PositionLengthAttribute, Cloneable {
+public class PositionLengthAttributeImpl extends AttributeImpl implements PositionLengthAttribute {
private int positionLength = 1;
/** Initializes this attribute with position length of 1. */
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java
index 4e8520f384f..f578e28aada 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java
@@ -20,8 +20,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Default implementation of {@link TermFrequencyAttribute}. */
-public class TermFrequencyAttributeImpl extends AttributeImpl
- implements TermFrequencyAttribute, Cloneable {
+public class TermFrequencyAttributeImpl extends AttributeImpl implements TermFrequencyAttribute {
private int termFrequency = 1;
/** Initialize this attribute with term frequency of 1 */
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TypeAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TypeAttributeImpl.java
index dbe5e942e02..0f444044cdd 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TypeAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TypeAttributeImpl.java
@@ -20,7 +20,7 @@ import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
/** Default implementation of {@link TypeAttribute}. */
-public class TypeAttributeImpl extends AttributeImpl implements TypeAttribute, Cloneable {
+public class TypeAttributeImpl extends AttributeImpl implements TypeAttribute {
private String type;
/** Initialize this attribute with {@link TypeAttribute#DEFAULT_TYPE} */
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene86/Lucene86PointsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene86/Lucene86PointsReader.java
index affe4fed773..3b21a403e45 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene86/Lucene86PointsReader.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene86/Lucene86PointsReader.java
@@ -16,7 +16,6 @@
*/
package org.apache.lucene.codecs.lucene86;
-import java.io.Closeable;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -33,7 +32,7 @@ import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.bkd.BKDReader;
/** Reads point values previously written with {@link Lucene86PointsWriter} */
-public class Lucene86PointsReader extends PointsReader implements Closeable {
+public class Lucene86PointsReader extends PointsReader {
final IndexInput indexIn, dataIn;
final SegmentReadState readState;
final Map