Skip to content

Apache Lucene open-source search software

adjust code to fix compile/javadoc errors on JDK 1.5

Erik Hatcherdd472377dd56
diff --git a/contrib/similarity/src/java/org/apache/lucene/search/similar/MoreLikeThis.java b/contrib/similarity/src/java/org/apache/lucene/search/similar/MoreLikeThis.java
index 4d8375adc6d..881cc7638fc 100755
--- a/contrib/similarity/src/java/org/apache/lucene/search/similar/MoreLikeThis.java
+++ b/contrib/similarity/src/java/org/apache/lucene/search/similar/MoreLikeThis.java
@@ -1,5 +1,5 @@
/**
- * Copyright 2004 The Apache Software Foundation.
+ * Copyright 2004-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,16 +15,35 @@
*/
package org.apache.lucene.search.similar;
-import java.io.*;
-import java.util.*;
-import java.net.*;
+import org.apache.lucene.util.PriorityQueue;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermFreqVector;
+import org.apache.lucene.search.DefaultSimilarity;
+import org.apache.lucene.search.Similarity;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Hits;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.Document;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Collection;
+import java.util.Iterator;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.File;
+import java.io.PrintStream;
+import java.io.StringReader;
+import java.io.FileReader;
+import java.io.InputStreamReader;
+import java.net.URL;
-import org.apache.lucene.analysis.*;
-import org.apache.lucene.analysis.standard.*;
-import org.apache.lucene.document.*;
-import org.apache.lucene.search.*;
-import org.apache.lucene.index.*;
-import org.apache.lucene.util.*;
/**
* Generate "more like this" similarity queries.
diff --git a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java
index e61490e23b2..b8808a78bf7 100755
--- a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java
+++ b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java
@@ -45,13 +45,13 @@ public class LuceneDictionary implements Dictionary {
final class LuceneIterator implements Iterator {
- private TermEnum enum;
+ private TermEnum termEnum;
private Term actualTerm;
private boolean has_next_called;
public LuceneIterator() {
try {
- enum = reader.terms(new Term(field, ""));
+ termEnum = reader.terms(new Term(field, ""));
} catch (IOException ex) {
ex.printStackTrace();
}
@@ -71,12 +71,12 @@ public class LuceneDictionary implements Dictionary {
has_next_called = true;
try {
// if there is still words
- if (!enum.next()) {
+ if (!termEnum.next()) {
actualTerm = null;
return false;
}
// if the next word are in the field
- actualTerm = enum.term();
+ actualTerm = termEnum.term();
String fieldt = actualTerm.field();
if (fieldt != field) {
actualTerm = null;