Apache Lucene open-source search software
LUCENE-8638: remove unused deprecated methods and related tests (#248)
Michael Sokolovd1d60e2db655
diff --git a/lucene/core/src/java/org/apache/lucene/store/DataInput.java b/lucene/core/src/java/org/apache/lucene/store/DataInput.javaindex 6a65c085e98..f68bad59176 100644--- a/lucene/core/src/java/org/apache/lucene/store/DataInput.java+++ b/lucene/core/src/java/org/apache/lucene/store/DataInput.java@@ -39,18 +39,6 @@ import org.apache.lucene.util.BitUtil;*/public abstract class DataInput implements Cloneable {- private static final int SKIP_BUFFER_SIZE = 1024;-- /* This buffer is used to skip over bytes with the slow implementation of- * skipBytesSlowly. The reason why we need to use an instance member instead of- * sharing a single instance across threads is that some delegating- * implementations of DataInput might want to reuse the provided buffer in- * order to eg. update the checksum. If we shared the same buffer across- * threads, then another thread might update the buffer while the checksum is- * being computed, making it invalid. See LUCENE-5583 for more information.- */- private byte[] skipBuffer;-/*** Reads and returns a single byte.*@@ -336,30 +324,6 @@ public abstract class DataInput implements Cloneable {}}- /**- * Skip over <code>numBytes</code> bytes. The contract on this method is that it should have the- * same behavior as reading the same number of bytes into a buffer and discarding its content.- * Negative values of <code>numBytes</code> are not supported.- *- * @deprecated Implementing subclasses should override #skipBytes with a more performant solution- * where possible.- */- @Deprecated- protected void skipBytesSlowly(final long numBytes) throws IOException {- if (numBytes < 0) {- throw new IllegalArgumentException("numBytes must be >= 0, got " + numBytes);- }- if (skipBuffer == null) {- skipBuffer = new byte[SKIP_BUFFER_SIZE];- }- assert skipBuffer.length == SKIP_BUFFER_SIZE;- for (long skipped = 0; skipped < numBytes; ) {- final int step = (int) Math.min(SKIP_BUFFER_SIZE, numBytes - skipped);- readBytes(skipBuffer, 0, step, false);- skipped += step;- }- }-/*** Skip over <code>numBytes</code> bytes. This method may skip bytes in whatever way is most* optimal, and may not have the same behavior as reading the skipped bytes. In general, negativediff --git a/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java b/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.javaindex 343ef015f95..02361b6f464 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java@@ -211,24 +211,6 @@ public class FacetsConfig {dimConfig.indexFieldName = indexFieldName;}- /**- * Specify whether drill down on the dimension is necessary.- *- * @deprecated Use {@link FacetsConfig#setDrillDownTermsIndexing(String, DrillDownTermsIndexing)}- * instead- */- @Deprecated- public synchronized void setRequireDimensionDrillDown(String dimName, boolean value) {- DimConfig dimConfig = fieldTypes.get(dimName);- if (dimConfig == null) {- dimConfig = new DimConfig();- fieldTypes.put(dimName, dimConfig);- }-- dimConfig.drillDownTermsIndexing =- value ? DrillDownTermsIndexing.ALL : DrillDownTermsIndexing.ALL_PATHS_NO_DIM;- }-/** Specify drill down terms option on the field / dimension. */public synchronized void setDrillDownTermsIndexing(String dimName, DrillDownTermsIndexing drillDownTermsIndexing) {diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestDrillDownQuery.java b/lucene/facet/src/test/org/apache/lucene/facet/TestDrillDownQuery.javaindex 3f7f18dcfa5..8f216f3abd3 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/TestDrillDownQuery.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/TestDrillDownQuery.java@@ -259,50 +259,6 @@ public class TestDrillDownQuery extends FacetTestCase {assertEquals(base, rewrite);}- @SuppressWarnings("deprecation")- public void testRequireDimensionDrillDown() throws Exception {- Directory dir = newDirectory();- RandomIndexWriter writer =- new RandomIndexWriter(- random(),- dir,- newIndexWriterConfig(new MockAnalyzer(random(), MockTokenizer.KEYWORD, false)));- Directory taxoDir = newDirectory();- TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);- FacetsConfig config = new FacetsConfig();-- config.setRequireDimensionDrillDown("a", true);- config.setRequireDimensionDrillDown("b", false);-- Document doc = new Document();- doc.add(new FacetField("a", "1"));- doc.add(new FacetField("b", "2"));- writer.addDocument(config.build(taxoWriter, doc));- taxoWriter.close();-- IndexReader reader = writer.getReader();- DirectoryTaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);- IndexSearcher searcher = newSearcher(reader);-- DrillDownQuery q = new DrillDownQuery(config);- q.add("a", "1");- assertEquals(1, searcher.count(q));-- q = new DrillDownQuery(config);- q.add("a");- assertEquals(1, searcher.count(q));-- q = new DrillDownQuery(config);- q.add("b", "2");- assertEquals(1, searcher.count(q));-- q = new DrillDownQuery(config);- q.add("b");- // no hits because we disabled dimension drill down for dimension "b":- assertEquals(0, searcher.count(q));- IOUtils.close(taxoReader, reader, writer, dir, taxoDir);- }-public void testSkipDrillDownTermsIndexing() throws Exception {Directory dir = newDirectory();RandomIndexWriter writer =diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/LengthGoalBreakIterator.java b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/LengthGoalBreakIterator.javaindex 1f9fe1e8a19..8f6a1486198 100644--- a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/LengthGoalBreakIterator.java+++ b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/LengthGoalBreakIterator.java@@ -50,14 +50,6 @@ public class LengthGoalBreakIterator extends BreakIterator {baseIter, minLength, fragmentAlignment, true, baseIter.current());}- /**- * For backwards compatibility you can initialise the break iterator without fragmentAlignment.- */- @Deprecated- public static LengthGoalBreakIterator createMinLength(BreakIterator baseIter, int minLength) {- return createMinLength(baseIter, minLength, 0.f);- }-/*** Breaks will be on average {@code targetLength} apart; the closest break to this target (before* or after) is chosen. The match will be positioned according to {@code fragmentAlignment} as@@ -69,15 +61,6 @@ public class LengthGoalBreakIterator extends BreakIterator {baseIter, targetLength, fragmentAlignment, false, baseIter.current());}- /**- * For backwards compatibility you can initialise the break iterator without fragmentAlignment.- */- @Deprecated- public static LengthGoalBreakIterator createClosestToLength(- BreakIterator baseIter, int targetLength) {- return createClosestToLength(baseIter, targetLength, 0.f);- }-private LengthGoalBreakIterator(BreakIterator baseIter,int lengthGoal,diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestLengthGoalBreakIterator.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestLengthGoalBreakIterator.javaindex 85d467d3867..bc54425f218 100644--- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestLengthGoalBreakIterator.java+++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestLengthGoalBreakIterator.java@@ -62,12 +62,6 @@ public class TestLengthGoalBreakIterator extends LuceneTestCase {LengthGoalBreakIterator.createClosestToLength(baseBI, 50, alignment);});}- // test backwards compatibility constructors- String backwardCompString =- LengthGoalBreakIterator.createClosestToLength(baseBI, 50).toString();- assertTrue(backwardCompString, backwardCompString.contains("fragAlign=0.0"));- backwardCompString = LengthGoalBreakIterator.createMinLength(baseBI, 50).toString();- assertTrue(backwardCompString, backwardCompString.contains("fragAlign=0.0"));}public void testTargetLen() throws IOException {diff --git a/lucene/join/src/java/org/apache/lucene/search/join/BlockJoinSelector.java b/lucene/join/src/java/org/apache/lucene/search/join/BlockJoinSelector.javaindex 5bd780b2135..c8e0d6dad24 100644--- a/lucene/join/src/java/org/apache/lucene/search/join/BlockJoinSelector.java+++ b/lucene/join/src/java/org/apache/lucene/search/join/BlockJoinSelector.java@@ -82,16 +82,6 @@ public class BlockJoinSelector {};}- /**- * Wraps the provided {@link SortedSetDocValues} in order to only select one value per parent- * among its {@code children} using the configured {@code selection} type.- */- @Deprecated- public static SortedDocValues wrap(- SortedSetDocValues sortedSet, Type selection, BitSet parents, BitSet children) {- return wrap(sortedSet, selection, parents, toIter(children));- }-/*** Wraps the provided {@link SortedSetDocValues} in order to only select one value per parent* among its {@code children} using the configured {@code selection} type.