From 8a8944de1a8350eea984e5c7fd577a1743e2a448 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Wed, 5 Dec 2007 13:59:37 +0000 Subject: [PATCH] LUCENE-1078: remove dead code git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@601337 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/analysis/StopFilter.java | 1 - src/java/org/apache/lucene/index/DocumentsWriter.java | 1 - src/java/org/apache/lucene/index/SegmentReader.java | 5 ----- src/java/org/apache/lucene/index/TermVectorsReader.java | 6 ++---- src/java/org/apache/lucene/index/TermVectorsWriter.java | 3 --- src/java/org/apache/lucene/search/ComplexExplanation.java | 2 -- src/java/org/apache/lucene/search/Similarity.java | 2 -- src/java/org/apache/lucene/search/function/ValueSource.java | 1 - .../org/apache/lucene/store/SingleInstanceLockFactory.java | 1 - 9 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/java/org/apache/lucene/analysis/StopFilter.java b/src/java/org/apache/lucene/analysis/StopFilter.java index 499c3d61f87..439a45bf407 100644 --- a/src/java/org/apache/lucene/analysis/StopFilter.java +++ b/src/java/org/apache/lucene/analysis/StopFilter.java @@ -19,7 +19,6 @@ package org.apache.lucene.analysis; import java.io.IOException; import java.util.Arrays; -import java.util.Iterator; import java.util.Set; /** diff --git a/src/java/org/apache/lucene/index/DocumentsWriter.java b/src/java/org/apache/lucene/index/DocumentsWriter.java index 04a4d0a49f6..ea7d1be01e9 100644 --- a/src/java/org/apache/lucene/index/DocumentsWriter.java +++ b/src/java/org/apache/lucene/index/DocumentsWriter.java @@ -1900,7 +1900,6 @@ final class DocumentsWriter { private ByteSliceReader freq = new ByteSliceReader(); private ByteSliceReader prox = new ByteSliceReader(); - private int lastDocID; private int docID; private int termFreq; diff --git a/src/java/org/apache/lucene/index/SegmentReader.java b/src/java/org/apache/lucene/index/SegmentReader.java index 74b477fe49a..e0df72b67d0 100644 --- a/src/java/org/apache/lucene/index/SegmentReader.java +++ b/src/java/org/apache/lucene/index/SegmentReader.java @@ -36,9 +36,6 @@ import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.BitVector; -import java.io.IOException; -import java.util.*; - /** * @version $Id$ */ @@ -301,7 +298,6 @@ class SegmentReader extends DirectoryIndexReader { fieldInfos = new FieldInfos(cfsDir, segment + ".fnm"); final String fieldsSegment; - final Directory dir; if (si.getDocStoreOffset() != -1) fieldsSegment = si.getDocStoreSegment(); @@ -424,7 +420,6 @@ class SegmentReader extends DirectoryIndexReader { // and can thus not be shared among multiple SegmentReaders // TODO: Change this in case FieldsReader becomes thread-safe in the future final String fieldsSegment; - final Directory dir; Directory storeDir = directory(); diff --git a/src/java/org/apache/lucene/index/TermVectorsReader.java b/src/java/org/apache/lucene/index/TermVectorsReader.java index d1426dd445f..04087b1d847 100644 --- a/src/java/org/apache/lucene/index/TermVectorsReader.java +++ b/src/java/org/apache/lucene/index/TermVectorsReader.java @@ -429,18 +429,16 @@ class TermVectorsReader implements Cloneable { class ParallelArrayTermVectorMapper extends TermVectorMapper { - private int numTerms; private String[] terms; private int[] termFreqs; - private int positions[][] = null; - private TermVectorOffsetInfo offsets[][] = null; + private int positions[][]; + private TermVectorOffsetInfo offsets[][]; private int currentPosition; private boolean storingOffsets; private boolean storingPositions; private String field; public void setExpectations(String field, int numTerms, boolean storeOffsets, boolean storePositions) { - this.numTerms = numTerms; this.field = field; terms = new String[numTerms]; termFreqs = new int[numTerms]; diff --git a/src/java/org/apache/lucene/index/TermVectorsWriter.java b/src/java/org/apache/lucene/index/TermVectorsWriter.java index 8ccee037f18..9cb911ea2cc 100644 --- a/src/java/org/apache/lucene/index/TermVectorsWriter.java +++ b/src/java/org/apache/lucene/index/TermVectorsWriter.java @@ -72,7 +72,6 @@ final class TermVectorsWriter { tvf.writeVInt(numTerms); final TermPositionVector tpVector; - final TermFreqVector tfVector; final byte bits; final boolean storePositions; @@ -81,14 +80,12 @@ final class TermVectorsWriter { if (vectors[i] instanceof TermPositionVector) { // May have positions & offsets tpVector = (TermPositionVector) vectors[i]; - tfVector = null; storePositions = tpVector.size() > 0 && tpVector.getTermPositions(0) != null; storeOffsets = tpVector.size() > 0 && tpVector.getOffsets(0) != null; bits = (byte) ((storePositions ? TermVectorsReader.STORE_POSITIONS_WITH_TERMVECTOR : 0) + (storeOffsets ? TermVectorsReader.STORE_OFFSET_WITH_TERMVECTOR : 0)); } else { tpVector = null; - tfVector = vectors[i]; bits = 0; storePositions = false; storeOffsets = false; diff --git a/src/java/org/apache/lucene/search/ComplexExplanation.java b/src/java/org/apache/lucene/search/ComplexExplanation.java index 06f23a86a6a..0917674a9e2 100644 --- a/src/java/org/apache/lucene/search/ComplexExplanation.java +++ b/src/java/org/apache/lucene/search/ComplexExplanation.java @@ -17,8 +17,6 @@ package org.apache.lucene.search; * limitations under the License. */ -import java.util.ArrayList; - /** Expert: Describes the score computation for document and query, andcan distinguish a match independent of a positive value. */ public class ComplexExplanation extends Explanation { private Boolean match; diff --git a/src/java/org/apache/lucene/search/Similarity.java b/src/java/org/apache/lucene/search/Similarity.java index d4d058804a4..b9dd63e9d34 100644 --- a/src/java/org/apache/lucene/search/Similarity.java +++ b/src/java/org/apache/lucene/search/Similarity.java @@ -17,8 +17,6 @@ package org.apache.lucene.search; * limitations under the License. */ -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.util.SmallFloat; diff --git a/src/java/org/apache/lucene/search/function/ValueSource.java b/src/java/org/apache/lucene/search/function/ValueSource.java index 2818cd29e62..72934e8cd02 100755 --- a/src/java/org/apache/lucene/search/function/ValueSource.java +++ b/src/java/org/apache/lucene/search/function/ValueSource.java @@ -19,7 +19,6 @@ package org.apache.lucene.search.function; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.function.DocValues; -import org.apache.lucene.util.ToStringUtils; import java.io.IOException; import java.io.Serializable; diff --git a/src/java/org/apache/lucene/store/SingleInstanceLockFactory.java b/src/java/org/apache/lucene/store/SingleInstanceLockFactory.java index 69be4f57431..a00d4a0f7b2 100755 --- a/src/java/org/apache/lucene/store/SingleInstanceLockFactory.java +++ b/src/java/org/apache/lucene/store/SingleInstanceLockFactory.java @@ -19,7 +19,6 @@ package org.apache.lucene.store; import java.io.IOException; import java.util.HashSet; -import java.util.Enumeration; /** * Implements {@link LockFactory} for a single in-process instance,