| Index: lucene/contrib/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java
|
| ===================================================================
|
| --- lucene/contrib/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java (revision 1297142)
|
| +++ lucene/contrib/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java (working copy)
|
| @@ -38,6 +38,7 @@
|
| import org.apache.lucene.document.FieldType; |
| import org.apache.lucene.document.TextField; |
| import org.apache.lucene.index.CorruptIndexException; |
| +import org.apache.lucene.index.DirectoryReader; |
| import org.apache.lucene.index.IndexReader; |
| import org.apache.lucene.index.IndexWriter; |
| import org.apache.lucene.index.IndexWriterConfig; |
| @@ -83,7 +84,7 @@
|
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
| //Take all completed form fields and add to a Properties object |
| Properties completedFormFields = new Properties(); |
| - Enumeration pNames = request.getParameterNames(); |
| + Enumeration<?> pNames = request.getParameterNames(); |
| while (pNames.hasMoreElements()) { |
| String propName = (String) pNames.nextElement(); |
| String value = request.getParameter(propName); |
| @@ -147,7 +148,7 @@
|
| |
| //open searcher |
| // this example never closes it reader! |
| - IndexReader reader = IndexReader.open(rd); |
| + IndexReader reader = DirectoryReader.open(rd); |
| searcher = new IndexSearcher(reader); |
| } |
| } |
| Index: lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
|
| ===================================================================
|
| --- lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (revision 1297142)
|
| +++ lucene/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (working copy)
|
| @@ -723,7 +723,6 @@
|
| @Override |
| public void run() throws Exception { |
| numHighlights = 0; |
| - String queryString = FIELD_NAME + ":[kannedy TO kznnedy]"; |
| |
| // Need to explicitly set the QueryParser property to use TermRangeQuery |
| // rather |
| @@ -1250,8 +1249,6 @@
|
| |
| String text = "this is a text with searchterm in it"; |
| SimpleHTMLFormatter fm = new SimpleHTMLFormatter(); |
| - TokenStream tokenStream = new MockAnalyzer(random, MockTokenizer.SIMPLE, true, stopWords, true) |
| - .tokenStream("text", new StringReader(text)); |
| Highlighter hg = getHighlighter(query, "text", fm); |
| hg.setTextFragmenter(new NullFragmenter()); |
| hg.setMaxDocCharsToAnalyze(36); |
| Index: lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
|
| ===================================================================
|
| --- lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java (revision 1297142)
|
| +++ lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java (working copy)
|
| @@ -45,7 +45,6 @@
|
| import org.apache.lucene.index.FieldsEnum; |
| import org.apache.lucene.index.OrdTermState; |
| import org.apache.lucene.index.StoredFieldVisitor; |
| -import org.apache.lucene.index.Term; |
| import org.apache.lucene.index.TermState; |
| import org.apache.lucene.index.Terms; |
| import org.apache.lucene.index.TermsEnum; |
| @@ -205,7 +204,7 @@
|
| * Arrays.binarySearch() and Arrays.sort() |
| */ |
| private static final Comparator<Object> termComparator = new Comparator<Object>() { |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public int compare(Object o1, Object o2) { |
| if (o1 instanceof Map.Entry<?,?>) o1 = ((Map.Entry<?,?>) o1).getKey(); |
| if (o2 instanceof Map.Entry<?,?>) o2 = ((Map.Entry<?,?>) o2).getKey(); |
| @@ -609,9 +608,6 @@
|
| /** Boost factor for hits for this field */ |
| private final float boost; |
| |
| - /** Term for this field's fieldName, lazily computed on demand */ |
| - public transient Term template; |
| - |
| private final long sumTotalTermFreq; |
| |
| public Info(HashMap<BytesRef,ArrayIntList> terms, int numTokens, int numOverlapTokens, float boost) { |
| @@ -642,16 +638,6 @@
|
| if (sortedTerms == null) sortedTerms = sort(terms); |
| } |
| |
| - /** note that the frequency can be calculated as numPosition(getPositions(x)) */ |
| - public ArrayIntList getPositions(BytesRef term) { |
| - return terms.get(term); |
| - } |
| - |
| - /** note that the frequency can be calculated as numPosition(getPositions(x)) */ |
| - public ArrayIntList getPositions(int pos) { |
| - return sortedTerms[pos].getValue(); |
| - } |
| - |
| public float getBoost() { |
| return boost; |
| } |
| @@ -671,10 +657,6 @@
|
| private int[] elements; |
| private int size = 0; |
| |
| - public ArrayIntList() { |
| - this(10); |
| - } |
| - |
| public ArrayIntList(int initialCapacity) { |
| elements = new int[initialCapacity]; |
| } |
| @@ -701,16 +683,6 @@
|
| return size; |
| } |
| |
| - public int[] toArray(int stride) { |
| - int[] arr = new int[size() / stride]; |
| - if (stride == 1) { |
| - System.arraycopy(elements, 0, arr, 0, size); // fast path |
| - } else { |
| - for (int i=0, j=0; j < size; i++, j += stride) arr[i] = elements[j]; |
| - } |
| - return arr; |
| - } |
| - |
| private void ensureCapacity(int minCapacity) { |
| int newCapacity = Math.max(minCapacity, (elements.length * 3) / 2 + 1); |
| int[] newElements = new int[newCapacity]; |
| @@ -1163,16 +1135,7 @@
|
| |
| public static final int PTR = Constants.JRE_IS_64BIT ? 8 : 4; |
| |
| - // bytes occupied by primitive data types |
| - public static final int BOOLEAN = 1; |
| - public static final int BYTE = 1; |
| - public static final int CHAR = 2; |
| - public static final int SHORT = 2; |
| public static final int INT = 4; |
| - public static final int LONG = 8; |
| - public static final int FLOAT = 4; |
| - public static final int DOUBLE = 8; |
| - |
| private static final int LOG_PTR = (int) Math.round(log2(PTR)); |
| |
| /** |
| @@ -1200,28 +1163,15 @@
|
| return sizeOfObject(INT + PTR*len); |
| } |
| |
| - public static int sizeOfCharArray(int len) { |
| - return sizeOfObject(INT + CHAR*len); |
| - } |
| - |
| public static int sizeOfIntArray(int len) { |
| return sizeOfObject(INT + INT*len); |
| } |
| |
| - public static int sizeOfString(int len) { |
| - return sizeOfObject(3*INT + PTR) + sizeOfCharArray(len); |
| - } |
| - |
| public static int sizeOfHashMap(int len) { |
| return sizeOfObject(4*PTR + 4*INT) + sizeOfObjectArray(len) |
| + len * sizeOfObject(3*PTR + INT); // entries |
| } |
| |
| - // note: does not include referenced objects |
| - public static int sizeOfArrayList(int len) { |
| - return sizeOfObject(PTR + 2*INT) + sizeOfObjectArray(len); |
| - } |
| - |
| public static int sizeOfArrayIntList(int len) { |
| return sizeOfObject(PTR + INT) + sizeOfIntArray(len); |
| } |
| Index: lucene/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
|
| ===================================================================
|
| --- lucene/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java (revision 1297142)
|
| +++ lucene/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java (working copy)
|
| @@ -34,6 +34,7 @@
|
| import org.apache.lucene.document.Field; |
| import org.apache.lucene.document.TextField; |
| import org.apache.lucene.index.AtomicReader; |
| +import org.apache.lucene.index.DirectoryReader; |
| import org.apache.lucene.index.DocsAndPositionsEnum; |
| import org.apache.lucene.index.DocsEnum; |
| import org.apache.lucene.index.IndexReader; |
| @@ -135,7 +136,7 @@
|
| * Run all queries against both the RAMDirectory and MemoryIndex, ensuring they are the same. |
| */ |
| public void assertAllQueries(MemoryIndex memory, Directory ramdir, Analyzer analyzer) throws Exception { |
| - IndexReader reader = IndexReader.open(ramdir); |
| + IndexReader reader = DirectoryReader.open(ramdir); |
| IndexSearcher ram = new IndexSearcher(reader); |
| IndexSearcher mem = memory.createSearcher(); |
| QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "foo", analyzer); |
| Index: lucene/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java
|
| ===================================================================
|
| --- lucene/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java (revision 1297142)
|
| +++ lucene/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java (working copy)
|
| @@ -20,8 +20,6 @@
|
| |
| import org.apache.lucene.analysis.MockAnalyzer; |
| import org.apache.lucene.document.Document; |
| -import org.apache.lucene.document.Field; |
| -import org.apache.lucene.document.StringField; |
| import org.apache.lucene.index.IndexWriterConfig.OpenMode; |
| import org.apache.lucene.store.Directory; |
| import org.apache.lucene.util.LuceneTestCase; |
| Index: lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedStringComparator.java
|
| ===================================================================
|
| --- lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedStringComparator.java (revision 1297142)
|
| +++ lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedStringComparator.java (working copy)
|
| @@ -90,7 +90,7 @@
|
| } |
| |
| @Override |
| - public FieldComparator setNextReader(AtomicReaderContext context) throws IOException { |
| + public FieldComparator<String> setNextReader(AtomicReaderContext context) throws IOException { |
| currentDocTerms = FieldCache.DEFAULT.getTerms(context.reader(), field); |
| return this; |
| } |
| Index: lucene/contrib/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java
|
| ===================================================================
|
| --- lucene/contrib/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java (revision 1297142)
|
| +++ lucene/contrib/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java (working copy)
|
| @@ -83,31 +83,4 @@
|
| reader.close(); |
| directory.close(); |
| } |
| - |
| - private void createRAMDirectories() throws CorruptIndexException, |
| - LockObtainFailedException, IOException { |
| - // creating a document to store |
| - Document lDoc = new Document(); |
| - FieldType customType = new FieldType(TextField.TYPE_UNSTORED); |
| - customType.setOmitNorms(true); |
| - lDoc.add(newField("field", "a1 b1", customType)); |
| - |
| - // creating a document to store |
| - Document lDoc2 = new Document(); |
| - lDoc2.add(newField("field", "a2 b2", customType)); |
| - |
| - // creating first index writer |
| - IndexWriter writerA = new IndexWriter(indexStoreA, newIndexWriterConfig( |
| - TEST_VERSION_CURRENT, new MockAnalyzer(random)).setOpenMode(OpenMode.CREATE)); |
| - writerA.addDocument(lDoc); |
| - writerA.forceMerge(1); |
| - writerA.close(); |
| - |
| - // creating second index writer |
| - IndexWriter writerB = new IndexWriter(indexStoreB, newIndexWriterConfig( |
| - TEST_VERSION_CURRENT, new MockAnalyzer(random)).setOpenMode(OpenMode.CREATE)); |
| - writerB.addDocument(lDoc2); |
| - writerB.forceMerge(1); |
| - writerB.close(); |
| - } |
| } |
| Index: lucene/contrib/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java
|
| ===================================================================
|
| --- lucene/contrib/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java (revision 1297142)
|
| +++ lucene/contrib/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java (working copy)
|
| @@ -91,7 +91,7 @@
|
| public void testSort() throws Exception { |
| SortField sf = new SortField("field", new FieldComparatorSource() { |
| @Override |
| - public FieldComparator newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { |
| + public FieldComparator<String> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { |
| return new SlowCollatedStringComparator(numHits, fieldname, collator); |
| } |
| }); |
| Index: lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionLengthAttributeImpl.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionLengthAttributeImpl.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/PositionLengthAttributeImpl.java (working copy)
|
| @@ -17,7 +17,6 @@
|
| * limitations under the License. |
| */ |
| |
| -import org.apache.lucene.analysis.TokenStream; |
| import org.apache.lucene.util.AttributeImpl; |
| |
| /** See {@link PositionLengthAttribute}. */ |
| Index: lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingPostingsFormat.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingPostingsFormat.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingPostingsFormat.java (working copy)
|
| @@ -32,7 +32,6 @@
|
| import org.apache.lucene.index.SegmentInfo; |
| import org.apache.lucene.index.SegmentReadState; |
| import org.apache.lucene.index.SegmentWriteState; |
| -import org.apache.lucene.store.Directory; |
| |
| /** |
| * Appending postings impl |
| Index: lucene/core/src/java/org/apache/lucene/codecs/BlockTermsReader.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/BlockTermsReader.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/BlockTermsReader.java (working copy)
|
| @@ -778,9 +778,6 @@
|
| return state.ord; |
| } |
| |
| - private void doPendingSeek() { |
| - } |
| - |
| /* Does initial decode of next block of terms; this |
| doesn't actually decode the docFreq, totalTermFreq, |
| postings details (frq/prx offset, etc.) metadata; |
| Index: lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsReader.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsReader.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsReader.java (working copy)
|
| @@ -35,7 +35,6 @@
|
| import org.apache.lucene.index.SegmentInfo; |
| import org.apache.lucene.index.TermState; |
| import org.apache.lucene.index.Terms; |
| -import org.apache.lucene.index.TermsEnum.SeekStatus; |
| import org.apache.lucene.index.TermsEnum; |
| import org.apache.lucene.store.ByteArrayDataInput; |
| import org.apache.lucene.store.Directory; |
| @@ -1947,6 +1946,7 @@
|
| } |
| } |
| |
| + @SuppressWarnings("unused") |
| private void printSeekState() throws IOException { |
| if (currentFrame == staticFrame) { |
| System.out.println(" no prior seek"); |
| Index: lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java (working copy)
|
| @@ -639,7 +639,8 @@
|
| } |
| |
| // for debugging |
| - private String toString(BytesRef b) { |
| + @SuppressWarnings("unused") |
| + private String toString(BytesRef b) { |
| try { |
| return b.utf8ToString() + " " + b; |
| } catch (Throwable t) { |
| Index: lucene/core/src/java/org/apache/lucene/codecs/FieldsProducer.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/FieldsProducer.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/FieldsProducer.java (working copy)
|
| @@ -21,8 +21,6 @@
|
| import java.io.IOException; |
| |
| import org.apache.lucene.index.Fields; |
| -import org.apache.lucene.index.FieldsEnum; |
| -import org.apache.lucene.index.Terms; |
| |
| /** Abstract API that produces terms, doc, freq, prox and |
| * payloads postings. |
| Index: lucene/core/src/java/org/apache/lucene/codecs/FixedGapTermsIndexReader.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/FixedGapTermsIndexReader.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/FixedGapTermsIndexReader.java (working copy)
|
| @@ -227,8 +227,6 @@
|
| |
| private final class FieldIndexData { |
| |
| - final private FieldInfo fieldInfo; |
| - |
| volatile CoreFieldIndex coreIndex; |
| |
| private final long indexStart; |
| @@ -241,7 +239,6 @@
|
| public FieldIndexData(FieldInfo fieldInfo, int numIndexTerms, long indexStart, long termsStart, long packedIndexStart, |
| long packedOffsetsStart) throws IOException { |
| |
| - this.fieldInfo = fieldInfo; |
| this.termsStart = termsStart; |
| this.indexStart = indexStart; |
| this.packedIndexStart = packedIndexStart; |
| Index: lucene/core/src/java/org/apache/lucene/codecs/FixedGapTermsIndexWriter.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/FixedGapTermsIndexWriter.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/FixedGapTermsIndexWriter.java (working copy)
|
| @@ -53,7 +53,8 @@
|
| final private int termIndexInterval; |
| |
| private final List<SimpleFieldWriter> fields = new ArrayList<SimpleFieldWriter>(); |
| - private final FieldInfos fieldInfos; // unread |
| + |
| + @SuppressWarnings("unused") private final FieldInfos fieldInfos; // unread |
| |
| public FixedGapTermsIndexWriter(SegmentWriteState state) throws IOException { |
| final String indexFileName = IndexFileNames.segmentFileName(state.segmentName, state.segmentSuffix, TERMS_INDEX_EXTENSION); |
| Index: lucene/core/src/java/org/apache/lucene/codecs/TermsIndexReaderBase.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/TermsIndexReaderBase.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/TermsIndexReaderBase.java (working copy)
|
| @@ -22,7 +22,6 @@
|
| |
| import java.io.IOException; |
| import java.io.Closeable; |
| -import java.util.Collection; |
| |
| |
| // TODO |
| Index: lucene/core/src/java/org/apache/lucene/codecs/TermVectorsWriter.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/TermVectorsWriter.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/TermVectorsWriter.java (working copy)
|
| @@ -22,7 +22,6 @@
|
| import java.util.Comparator; |
| |
| import org.apache.lucene.index.DocsAndPositionsEnum; |
| -import org.apache.lucene.index.DocsEnum; |
| import org.apache.lucene.index.FieldInfo; |
| import org.apache.lucene.index.FieldInfos; |
| import org.apache.lucene.index.Fields; |
| Index: lucene/core/src/java/org/apache/lucene/codecs/VariableGapTermsIndexWriter.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/codecs/VariableGapTermsIndexWriter.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/codecs/VariableGapTermsIndexWriter.java (working copy)
|
| @@ -54,7 +54,8 @@
|
| final static int VERSION_CURRENT = VERSION_START; |
| |
| private final List<FSTFieldWriter> fields = new ArrayList<FSTFieldWriter>(); |
| - private final FieldInfos fieldInfos; // unread |
| + |
| + @SuppressWarnings("unused") private final FieldInfos fieldInfos; // unread |
| private final IndexTermSelector policy; |
| |
| /** @lucene.experimental */ |
| @@ -214,7 +215,6 @@
|
| private final long startTermsFilePointer; |
| |
| final FieldInfo fieldInfo; |
| - int numIndexTerms; |
| FST<Long> fst; |
| final long indexStart; |
| |
| Index: lucene/core/src/java/org/apache/lucene/index/AtomicReader.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/index/AtomicReader.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/index/AtomicReader.java (working copy)
|
| @@ -20,7 +20,6 @@
|
| import java.io.IOException; |
| |
| import org.apache.lucene.search.SearcherManager; // javadocs |
| -import org.apache.lucene.store.*; |
| import org.apache.lucene.util.Bits; |
| import org.apache.lucene.util.BytesRef; |
| import org.apache.lucene.util.ReaderUtil; // for javadocs |
| Index: lucene/core/src/java/org/apache/lucene/index/DocTermOrds.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/index/DocTermOrds.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/index/DocTermOrds.java (working copy)
|
| @@ -642,13 +642,11 @@
|
| * ord; in this case we "wrap" our own terms index |
| * around it. */ |
| private final class OrdWrappedTermsEnum extends TermsEnum { |
| - private final AtomicReader reader; |
| private final TermsEnum termsEnum; |
| private BytesRef term; |
| private long ord = -indexInterval-1; // force "real" seek |
| |
| public OrdWrappedTermsEnum(AtomicReader reader) throws IOException { |
| - this.reader = reader; |
| assert indexedTermsArray != null; |
| termsEnum = reader.fields().terms(field).iterator(null); |
| } |
| Index: lucene/core/src/java/org/apache/lucene/index/IndexFileNameFilter.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/index/IndexFileNameFilter.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/index/IndexFileNameFilter.java (working copy)
|
| @@ -19,7 +19,6 @@
|
| |
| import java.io.File; |
| import java.io.FilenameFilter; |
| -import java.util.HashSet; |
| import java.util.regex.Pattern; |
| |
| /** |
| Index: lucene/core/src/java/org/apache/lucene/index/NormsConsumerPerField.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/index/NormsConsumerPerField.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/index/NormsConsumerPerField.java (working copy)
|
| @@ -18,11 +18,8 @@
|
| import java.io.IOException; |
| |
| import org.apache.lucene.codecs.DocValuesConsumer; |
| -import org.apache.lucene.document.DocValuesField; |
| -import org.apache.lucene.document.Field; |
| import org.apache.lucene.index.DocValues.Type; |
| import org.apache.lucene.search.similarities.Similarity; |
| -import org.apache.lucene.util.BytesRef; |
| |
| public class NormsConsumerPerField extends InvertedDocEndConsumerPerField implements Comparable<NormsConsumerPerField> { |
| private final FieldInfo fieldInfo; |
| Index: lucene/core/src/java/org/apache/lucene/index/ParallelAtomicReader.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/index/ParallelAtomicReader.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/index/ParallelAtomicReader.java (working copy)
|
| @@ -19,7 +19,6 @@
|
| |
| import java.io.IOException; |
| import java.util.Collections; |
| -import java.util.HashMap; |
| import java.util.IdentityHashMap; |
| import java.util.Iterator; |
| import java.util.Map; |
| Index: lucene/core/src/java/org/apache/lucene/index/PerDocWriteState.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/index/PerDocWriteState.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/index/PerDocWriteState.java (working copy)
|
| @@ -1,22 +1,4 @@
|
| package org.apache.lucene.index; |
| -/** |
| - * Licensed to the Apache Software Foundation (ASF) under one or more |
| - * contributor license agreements. See the NOTICE file distributed with |
| - * this work for additional information regarding copyright ownership. |
| - * The ASF licenses this file to You under the Apache License, Version 2.0 |
| - * (the "License"); you may not use this file except in compliance with |
| - * the License. You may obtain a copy of the License at |
| - * |
| - * http://www.apache.org/licenses/LICENSE-2.0 |
| - * |
| - * Unless required by applicable law or agreed to in writing, software |
| - * distributed under the License is distributed on an "AS IS" BASIS, |
| - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| - * See the License for the specific language governing permissions and |
| - * limitations under the License. |
| - */ |
| -import java.io.PrintStream; |
| - |
| import org.apache.lucene.codecs.PerDocConsumer; |
| import org.apache.lucene.store.Directory; |
| import org.apache.lucene.store.IOContext; |
| Index: lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java (working copy)
|
| @@ -203,8 +203,6 @@
|
| private final int minNrShouldMatch; |
| private int end; |
| private Bucket current; |
| - private int doc = -1; |
| - |
| // Any time a prohibited clause matches we set bit 0: |
| private static final int PROHIBITED_MASK = 1; |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/BooleanScorer2.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/search/BooleanScorer2.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/search/BooleanScorer2.java (working copy)
|
| @@ -25,7 +25,6 @@
|
| import org.apache.lucene.search.BooleanClause.Occur; |
| import org.apache.lucene.search.BooleanQuery.BooleanWeight; |
| import org.apache.lucene.search.similarities.Similarity; |
| -import org.apache.lucene.search.Scorer.ChildScorer; |
| |
| /* See the description in BooleanScorer.java, comparing |
| * BooleanScorer & BooleanScorer2 */ |
| Index: lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java (working copy)
|
| @@ -414,10 +414,6 @@
|
| } |
| } |
| |
| - final public DocsEnum peek() { |
| - return top(); |
| - } |
| - |
| @Override |
| public final boolean lessThan(DocsAndPositionsEnum a, DocsAndPositionsEnum b) { |
| return a.docID() < b.docID(); |
| Index: lucene/core/src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java (working copy)
|
| @@ -25,7 +25,6 @@
|
| import org.apache.lucene.search.Weight; |
| import org.apache.lucene.search.Explanation; |
| import org.apache.lucene.search.ComplexExplanation; |
| -import org.apache.lucene.search.payloads.PayloadNearQuery.PayloadNearSpanScorer; |
| import org.apache.lucene.search.similarities.DefaultSimilarity; |
| import org.apache.lucene.search.similarities.Similarity; |
| import org.apache.lucene.search.similarities.Similarity.SloppySimScorer; |
| Index: lucene/core/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java (working copy)
|
| @@ -23,7 +23,6 @@
|
| import java.util.Map; |
| import java.util.Set; |
| |
| -import org.apache.lucene.index.AtomicReader; |
| import org.apache.lucene.index.CompositeReader; |
| import org.apache.lucene.index.IndexReader; |
| import org.apache.lucene.search.FieldCache; |
| Index: lucene/core/src/java/org/apache/lucene/util/IndexableBinaryStringTools.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/util/IndexableBinaryStringTools.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/util/IndexableBinaryStringTools.java (working copy)
|
| @@ -17,8 +17,6 @@
|
| * limitations under the License. |
| */ |
| |
| -import java.nio.CharBuffer; |
| -import java.nio.ByteBuffer; |
| import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute; // javadoc |
| |
| /** |
| Index: lucene/core/src/java/org/apache/lucene/util/ReaderUtil.java
|
| ===================================================================
|
| --- lucene/core/src/java/org/apache/lucene/util/ReaderUtil.java (revision 1297142)
|
| +++ lucene/core/src/java/org/apache/lucene/util/ReaderUtil.java (working copy)
|
| @@ -17,13 +17,10 @@
|
| * limitations under the License. |
| */ |
| |
| -import java.util.ArrayList; |
| import java.util.List; |
| import java.io.IOException; |
| |
| import org.apache.lucene.index.AtomicReaderContext; |
| -import org.apache.lucene.index.FieldInfo; |
| -import org.apache.lucene.index.FieldInfos; |
| import org.apache.lucene.index.CompositeReader; |
| import org.apache.lucene.index.AtomicReader; |
| import org.apache.lucene.index.IndexReader; |
| Index: lucene/core/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java
|
| ===================================================================
|
| --- lucene/core/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java (revision 1297142)
|
| +++ lucene/core/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java (working copy)
|
| @@ -3,8 +3,6 @@
|
| import java.io.StringReader; |
| import java.util.Arrays; |
| |
| -import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; |
| -import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; |
| import org.apache.lucene.util._TestUtil; |
| import org.apache.lucene.util.automaton.Automaton; |
| import org.apache.lucene.util.automaton.BasicAutomata; |
| Index: lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java
|
| ===================================================================
|
| --- lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java (revision 1297142)
|
| +++ lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java (working copy)
|
| @@ -17,8 +17,6 @@
|
| * limitations under the License. |
| */ |
| |
| -import java.util.*; |
| - |
| import org.apache.lucene.analysis.MockAnalyzer; |
| import org.apache.lucene.document.Document; |
| import org.apache.lucene.document.TextField; |
| Index: lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java
|
| ===================================================================
|
| --- lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java (revision 1297142)
|
| +++ lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java (working copy)
|
| @@ -111,31 +111,27 @@
|
| } |
| |
| final IndexReader r; |
| - if (true) { |
| - final IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)) |
| - .setOpenMode(IndexWriterConfig.OpenMode.CREATE) |
| - .setMergePolicy(newLogMergePolicy()); |
| - iwc.setRAMBufferSizeMB(16.0 + 16.0 * random.nextDouble()); |
| - iwc.setMaxBufferedDocs(-1); |
| - final RandomIndexWriter riw = new RandomIndexWriter(random, dir, iwc); |
| + final IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)) |
| + .setOpenMode(IndexWriterConfig.OpenMode.CREATE) |
| + .setMergePolicy(newLogMergePolicy()); |
| + iwc.setRAMBufferSizeMB(16.0 + 16.0 * random.nextDouble()); |
| + iwc.setMaxBufferedDocs(-1); |
| + final RandomIndexWriter riw = new RandomIndexWriter(random, dir, iwc); |
| + |
| + for(int idx=0;idx<NUM_DOCS;idx++) { |
| + final Document doc = new Document(); |
| + String s = isS1.get(idx) ? s1 : s2; |
| + final Field f = newField("field", s, TextField.TYPE_UNSTORED); |
| + final int count = _TestUtil.nextInt(random, 1, 4); |
| + for(int ct=0;ct<count;ct++) { |
| + doc.add(f); |
| + } |
| + riw.addDocument(doc); |
| + } |
| + |
| + r = riw.getReader(); |
| + riw.close(); |
| |
| - for(int idx=0;idx<NUM_DOCS;idx++) { |
| - final Document doc = new Document(); |
| - String s = isS1.get(idx) ? s1 : s2; |
| - final Field f = newField("field", s, TextField.TYPE_UNSTORED); |
| - final int count = _TestUtil.nextInt(random, 1, 4); |
| - for(int ct=0;ct<count;ct++) { |
| - doc.add(f); |
| - } |
| - riw.addDocument(doc); |
| - } |
| - |
| - r = riw.getReader(); |
| - riw.close(); |
| - } else { |
| - r = IndexReader.open(dir); |
| - } |
| - |
| /* |
| if (VERBOSE) { |
| System.out.println("TEST: terms"); |
| Index: lucene/core/src/test/org/apache/lucene/TestExternalCodecs.java
|
| ===================================================================
|
| --- lucene/core/src/test/org/apache/lucene/TestExternalCodecs.java (revision 1297142)
|
| +++ lucene/core/src/test/org/apache/lucene/TestExternalCodecs.java (working copy)
|
| @@ -17,9 +17,6 @@
|
| * limitations under the License. |
| */ |
| |
| -import java.io.*; |
| -import java.util.*; |
| - |
| import org.apache.lucene.analysis.*; |
| import org.apache.lucene.codecs.*; |
| import org.apache.lucene.codecs.lucene40.Lucene40Codec; |
| Index: modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java
|
| ===================================================================
|
| --- modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java (revision 1297142)
|
| +++ modules/analysis/common/src/java/org/apache/lucene/analysis/util/CharArrayMap.java (working copy)
|
| @@ -376,7 +376,7 @@
|
| |
| /** Returns an {@link CharArraySet} view on the map's keys. |
| * The set will use the same {@code matchVersion} as this map. */ |
| - @Override @SuppressWarnings("unchecked") |
| + @Override @SuppressWarnings({"unchecked","rawtypes"}) |
| public final CharArraySet keySet() { |
| if (keySet == null) { |
| // prevent adding of entries |
| @@ -508,10 +508,11 @@
|
| } |
| |
| @Override |
| + @SuppressWarnings("unchecked") |
| public boolean contains(Object o) { |
| if (!(o instanceof Map.Entry)) |
| return false; |
| - final Map.Entry e = (Map.Entry)o; |
| + final Map.Entry<Object,V> e = (Map.Entry<Object,V>)o; |
| final Object key = e.getKey(); |
| final Object val = e.getValue(); |
| final Object v = get(key); |
| Index: modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractAllGroupHeadsCollector.java
|
| ===================================================================
|
| --- modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractAllGroupHeadsCollector.java (revision 1297142)
|
| +++ modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractAllGroupHeadsCollector.java (working copy)
|
| @@ -29,6 +29,7 @@
|
| * |
| * @lucene.experimental |
| */ |
| +@SuppressWarnings({"unchecked","rawtypes"}) |
| public abstract class AbstractAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCollector.GroupHead> extends Collector { |
| |
| protected final int[] reversed; |
| Index: modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java
|
| ===================================================================
|
| --- modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java (revision 1297142)
|
| +++ modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java (working copy)
|
| @@ -36,7 +36,7 @@
|
| abstract public class AbstractFirstPassGroupingCollector<GROUP_VALUE_TYPE> extends Collector { |
| |
| private final Sort groupSort; |
| - private final FieldComparator[] comparators; |
| + private final FieldComparator<?>[] comparators; |
| private final int[] reversed; |
| private final int topNGroups; |
| private final HashMap<GROUP_VALUE_TYPE, CollectedSearchGroup<GROUP_VALUE_TYPE>> groupMap; |
| @@ -136,7 +136,7 @@
|
| |
| @Override |
| public void setScorer(Scorer scorer) throws IOException { |
| - for (FieldComparator comparator : comparators) { |
| + for (FieldComparator<?> comparator : comparators) { |
| comparator.setScorer(scorer); |
| } |
| } |
| @@ -196,7 +196,7 @@
|
| sg.groupValue = copyDocGroupValue(groupValue, null); |
| sg.comparatorSlot = groupMap.size(); |
| sg.topDoc = docBase + doc; |
| - for (FieldComparator fc : comparators) { |
| + for (FieldComparator<?> fc : comparators) { |
| fc.copy(sg.comparatorSlot, doc); |
| } |
| groupMap.put(sg.groupValue, sg); |
| @@ -222,7 +222,7 @@
|
| bottomGroup.groupValue = copyDocGroupValue(groupValue, bottomGroup.groupValue); |
| bottomGroup.topDoc = docBase + doc; |
| |
| - for (FieldComparator fc : comparators) { |
| + for (FieldComparator<?> fc : comparators) { |
| fc.copy(bottomGroup.comparatorSlot, doc); |
| } |
| |
| @@ -231,7 +231,7 @@
|
| assert orderedGroups.size() == topNGroups; |
| |
| final int lastComparatorSlot = orderedGroups.last().comparatorSlot; |
| - for (FieldComparator fc : comparators) { |
| + for (FieldComparator<?> fc : comparators) { |
| fc.setBottom(lastComparatorSlot); |
| } |
| |
| @@ -240,7 +240,7 @@
|
| |
| // Update existing group: |
| for (int compIDX = 0;; compIDX++) { |
| - final FieldComparator fc = comparators[compIDX]; |
| + final FieldComparator<?> fc = comparators[compIDX]; |
| fc.copy(spareSlot, doc); |
| |
| final int c = reversed[compIDX] * fc.compare(group.comparatorSlot, spareSlot); |
| @@ -287,7 +287,7 @@
|
| final CollectedSearchGroup newLast = orderedGroups.last(); |
| // If we changed the value of the last group, or changed which group was last, then update bottom: |
| if (group == newLast || prevLast != newLast) { |
| - for (FieldComparator fc : comparators) { |
| + for (FieldComparator<?> fc : comparators) { |
| fc.setBottom(newLast.comparatorSlot); |
| } |
| } |
| @@ -298,7 +298,7 @@
|
| final Comparator<CollectedSearchGroup> comparator = new Comparator<CollectedSearchGroup>() { |
| public int compare(CollectedSearchGroup o1, CollectedSearchGroup o2) { |
| for (int compIDX = 0;; compIDX++) { |
| - FieldComparator fc = comparators[compIDX]; |
| + FieldComparator<?> fc = comparators[compIDX]; |
| final int c = reversed[compIDX] * fc.compare(o1.comparatorSlot, o2.comparatorSlot); |
| if (c != 0) { |
| return c; |
| @@ -313,7 +313,7 @@
|
| orderedGroups.addAll(groupMap.values()); |
| assert orderedGroups.size() > 0; |
| |
| - for (FieldComparator fc : comparators) { |
| + for (FieldComparator<?> fc : comparators) { |
| fc.setBottom(orderedGroups.last().comparatorSlot); |
| } |
| } |
| Index: modules/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java
|
| ===================================================================
|
| --- modules/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java (revision 1297142)
|
| +++ modules/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java (working copy)
|
| @@ -76,7 +76,7 @@
|
| // TODO: specialize into 2 classes, static "create" method: |
| private final boolean needsScores; |
| |
| - private final FieldComparator[] comparators; |
| + private final FieldComparator<?>[] comparators; |
| private final int[] reversed; |
| private final int compIDXEnd; |
| private int bottomSlot; |
| @@ -323,7 +323,7 @@
|
| |
| // At this point we hold all docs w/ in each group, |
| // unsorted; we now sort them: |
| - final TopDocsCollector collector; |
| + final TopDocsCollector<?> collector; |
| if (withinGroupSort == null) { |
| // Sort by score |
| if (!needsScores) { |
| @@ -384,7 +384,7 @@
|
| @Override |
| public void setScorer(Scorer scorer) throws IOException { |
| this.scorer = scorer; |
| - for (FieldComparator comparator : comparators) { |
| + for (FieldComparator<?> comparator : comparators) { |
| comparator.setScorer(scorer); |
| } |
| } |
| @@ -425,7 +425,7 @@
|
| assert !queueFull; |
| |
| //System.out.println(" init copy to bottomSlot=" + bottomSlot); |
| - for (FieldComparator fc : comparators) { |
| + for (FieldComparator<?> fc : comparators) { |
| fc.copy(bottomSlot, doc); |
| fc.setBottom(bottomSlot); |
| } |
| @@ -450,7 +450,7 @@
|
| |
| //System.out.println(" best w/in group!"); |
| |
| - for (FieldComparator fc : comparators) { |
| + for (FieldComparator<?> fc : comparators) { |
| fc.copy(bottomSlot, doc); |
| // Necessary because some comparators cache |
| // details of bottom slot; this forces them to |
| @@ -480,7 +480,7 @@
|
| } |
| } |
| groupCompetes = true; |
| - for (FieldComparator fc : comparators) { |
| + for (FieldComparator<?> fc : comparators) { |
| fc.copy(bottomSlot, doc); |
| // Necessary because some comparators cache |
| // details of bottom slot; this forces them to |
| Index: modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java
|
| ===================================================================
|
| --- modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java (revision 1297142)
|
| +++ modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupHeadsCollector.java (working copy)
|
| @@ -18,7 +18,6 @@
|
| */ |
| |
| import org.apache.lucene.index.AtomicReaderContext; |
| -import org.apache.lucene.index.IndexReader; |
| import org.apache.lucene.queries.function.FunctionValues; |
| import org.apache.lucene.queries.function.ValueSource; |
| import org.apache.lucene.search.FieldComparator; |
| @@ -98,7 +97,7 @@
|
| public void setScorer(Scorer scorer) throws IOException { |
| this.scorer = scorer; |
| for (GroupHead groupHead : groups.values()) { |
| - for (FieldComparator comparator : groupHead.comparators) { |
| + for (FieldComparator<?> comparator : groupHead.comparators) { |
| comparator.setScorer(scorer); |
| } |
| } |
| @@ -119,7 +118,7 @@
|
| |
| class GroupHead extends AbstractAllGroupHeadsCollector.GroupHead<MutableValue> { |
| |
| - final FieldComparator[] comparators; |
| + final FieldComparator<?>[] comparators; |
| |
| private GroupHead(MutableValue groupValue, Sort sort, int doc) throws IOException { |
| super(groupValue, doc + readerContext.docBase); |
| @@ -138,7 +137,7 @@
|
| } |
| |
| public void updateDocHead(int doc) throws IOException { |
| - for (FieldComparator comparator : comparators) { |
| + for (FieldComparator<?> comparator : comparators) { |
| comparator.copy(0, doc); |
| comparator.setBottom(0); |
| } |
| Index: modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java
|
| ===================================================================
|
| --- modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java (revision 1297142)
|
| +++ modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionAllGroupsCollector.java (working copy)
|
| @@ -18,7 +18,6 @@
|
| */ |
| |
| import org.apache.lucene.index.AtomicReaderContext; |
| -import org.apache.lucene.index.IndexReader; |
| import org.apache.lucene.queries.function.FunctionValues; |
| import org.apache.lucene.queries.function.ValueSource; |
| import org.apache.lucene.search.grouping.AbstractAllGroupsCollector; |
| Index: modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionFirstPassGroupingCollector.java
|
| ===================================================================
|
| --- modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionFirstPassGroupingCollector.java (revision 1297142)
|
| +++ modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionFirstPassGroupingCollector.java (working copy)
|
| @@ -18,7 +18,6 @@
|
| */ |
| |
| import org.apache.lucene.index.AtomicReaderContext; |
| -import org.apache.lucene.index.IndexReader; |
| import org.apache.lucene.queries.function.FunctionValues; |
| import org.apache.lucene.queries.function.ValueSource; |
| import org.apache.lucene.search.Sort; |
| Index: modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionSecondPassGroupingCollector.java
|
| ===================================================================
|
| --- modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionSecondPassGroupingCollector.java (revision 1297142)
|
| +++ modules/grouping/src/java/org/apache/lucene/search/grouping/function/FunctionSecondPassGroupingCollector.java (working copy)
|
| @@ -18,7 +18,6 @@
|
| */ |
| |
| import org.apache.lucene.index.AtomicReaderContext; |
| -import org.apache.lucene.index.IndexReader; |
| import org.apache.lucene.queries.function.FunctionValues; |
| import org.apache.lucene.queries.function.ValueSource; |
| import org.apache.lucene.search.Sort; |
| Index: modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java
|
| ===================================================================
|
| --- modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java (revision 1297142)
|
| +++ modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java (working copy)
|
| @@ -406,7 +406,7 @@
|
| |
| // At this point we hold all docs w/ in each group, |
| // unsorted; we now sort them: |
| - final TopDocsCollector collector; |
| + final TopDocsCollector<?> collector; |
| if (withinGroupSort == null) { |
| // Sort by score |
| if (!trackScores) { |
| Index: modules/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
|
| ===================================================================
|
| --- modules/queries/src/java/org/apache/lucene/queries/function/ValueSource.java (revision 1297142)
|
| +++ modules/queries/src/java/org/apache/lucene/queries/function/ValueSource.java (working copy)
|
| @@ -120,7 +120,7 @@
|
| } |
| |
| @Override |
| - public FieldComparator newComparator(String fieldname, int numHits, |
| + public FieldComparator<Double> newComparator(String fieldname, int numHits, |
| int sortPos, boolean reversed) throws IOException { |
| return new ValueSourceComparator(context, numHits); |
| } |
| Index: modules/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeFilterBuilder.java
|
| ===================================================================
|
| --- modules/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeFilterBuilder.java (revision 1297142)
|
| +++ modules/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeFilterBuilder.java (working copy)
|
| @@ -18,7 +18,6 @@
|
| */ |
| |
| import org.apache.lucene.index.AtomicReader; |
| -import org.apache.lucene.index.AtomicReaderContext; |
| import org.apache.lucene.index.IndexReader; |
| import org.apache.lucene.index.IndexWriter; |
| import org.apache.lucene.index.SlowCompositeReaderWrapper; |
| @@ -79,7 +78,7 @@
|
| } |
| } |
| |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public void testGetFilterInt() throws Exception { |
| NumericRangeFilterBuilder filterBuilder = new NumericRangeFilterBuilder(); |
| filterBuilder.setStrictMode(true); |
| @@ -99,7 +98,7 @@
|
| String xml2 = "<NumericRangeFilter fieldName='AGE' type='int' lowerTerm='-1' upperTerm='10' includeUpper='false'/>"; |
| Document doc2 = getDocumentFromString(xml2); |
| Filter filter2 = filterBuilder.getFilter(doc2.getDocumentElement()); |
| - assertTrue(filter2 instanceof NumericRangeFilter<?>); |
| + assertTrue(filter2 instanceof NumericRangeFilter); |
| |
| NumericRangeFilter<Integer> numRangeFilter2 = (NumericRangeFilter) filter2; |
| assertEquals(Integer.valueOf(-1), numRangeFilter2.getMin()); |
| @@ -109,7 +108,7 @@
|
| assertFalse(numRangeFilter2.includesMax()); |
| } |
| |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public void testGetFilterLong() throws Exception { |
| NumericRangeFilterBuilder filterBuilder = new NumericRangeFilterBuilder(); |
| filterBuilder.setStrictMode(true); |
| @@ -138,7 +137,7 @@
|
| assertFalse(numRangeFilter2.includesMax()); |
| } |
| |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public void testGetFilterDouble() throws Exception { |
| NumericRangeFilterBuilder filterBuilder = new NumericRangeFilterBuilder(); |
| filterBuilder.setStrictMode(true); |
| @@ -169,7 +168,7 @@
|
| assertFalse(numRangeFilter2.includesMax()); |
| } |
| |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public void testGetFilterFloat() throws Exception { |
| NumericRangeFilterBuilder filterBuilder = new NumericRangeFilterBuilder(); |
| filterBuilder.setStrictMode(true); |
| Index: modules/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeQueryBuilder.java
|
| ===================================================================
|
| --- modules/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeQueryBuilder.java (revision 1297142)
|
| +++ modules/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeQueryBuilder.java (working copy)
|
| @@ -46,7 +46,7 @@
|
| fail("Expected to throw " + ParserException.class); |
| } |
| |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public void testGetFilterInt() throws Exception { |
| NumericRangeQueryBuilder filterBuilder = new NumericRangeQueryBuilder(); |
| |
| @@ -75,7 +75,7 @@
|
| assertFalse(numRangeFilter2.includesMax()); |
| } |
| |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public void testGetFilterLong() throws Exception { |
| NumericRangeQueryBuilder filterBuilder = new NumericRangeQueryBuilder(); |
| |
| @@ -103,7 +103,7 @@
|
| assertFalse(numRangeFilter2.includesMax()); |
| } |
| |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public void testGetFilterDouble() throws Exception { |
| NumericRangeQueryBuilder filterBuilder = new NumericRangeQueryBuilder(); |
| |
| @@ -133,7 +133,7 @@
|
| assertFalse(numRangeFilter2.includesMax()); |
| } |
| |
| - @SuppressWarnings("unchecked") |
| + @SuppressWarnings({"unchecked","rawtypes"}) |
| public void testGetFilterFloat() throws Exception { |
| NumericRangeQueryBuilder filterBuilder = new NumericRangeQueryBuilder(); |
| |