remove "throws IOException" from methods that really never throw this exception

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150397 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2004-08-06 20:19:13 +00:00
parent 9510777ce9
commit 9e2322c5c0
8 changed files with 14 additions and 17 deletions

View File

@ -77,7 +77,7 @@ final class BooleanScorer extends Scorer {
bucketTable.newCollector(mask), scorers); bucketTable.newCollector(mask), scorers);
} }
private final void computeCoordFactors() throws IOException { private final void computeCoordFactors() {
coordFactors = new float[maxCoord]; coordFactors = new float[maxCoord];
for (int i = 0; i < maxCoord; i++) for (int i = 0; i < maxCoord; i++)
coordFactors[i] = getSimilarity().coord(i, maxCoord-1); coordFactors[i] = getSimilarity().coord(i, maxCoord-1);
@ -120,7 +120,7 @@ final class BooleanScorer extends Scorer {
return false; return false;
} }
public float score() throws IOException { public float score() {
if (coordFactors == null) if (coordFactors == null)
computeCoordFactors(); computeCoordFactors();
return current.score * coordFactors[current.coord]; return current.score * coordFactors[current.coord];
@ -185,11 +185,11 @@ final class BooleanScorer extends Scorer {
} }
} }
public boolean skipTo(int target) throws IOException { public boolean skipTo(int target) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public Explanation explain(int doc) throws IOException { public Explanation explain(int doc) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -30,7 +30,7 @@ final class ConjunctionScorer extends Scorer {
super(similarity); super(similarity);
} }
final void add(Scorer scorer) throws IOException { final void add(Scorer scorer) {
scorers.addLast(scorer); scorers.addLast(scorer);
} }
@ -92,7 +92,7 @@ final class ConjunctionScorer extends Scorer {
firstTime = false; firstTime = false;
} }
private void sortScorers() throws IOException { private void sortScorers() {
// move scorers to an array // move scorers to an array
Scorer[] array = (Scorer[])scorers.toArray(new Scorer[scorers.size()]); Scorer[] array = (Scorer[])scorers.toArray(new Scorer[scorers.size()]);
scorers.clear(); // empty the list scorers.clear(); // empty the list
@ -112,7 +112,7 @@ final class ConjunctionScorer extends Scorer {
} }
} }
public Explanation explain(int doc) throws IOException { public Explanation explain(int doc) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -18,7 +18,6 @@ package org.apache.lucene.search;
import org.apache.lucene.util.PriorityQueue; import org.apache.lucene.util.PriorityQueue;
import java.io.IOException;
import java.text.Collator; import java.text.Collator;
import java.util.Locale; import java.util.Locale;
@ -48,10 +47,8 @@ extends PriorityQueue {
* Creates a hit queue sorted by the given list of fields. * Creates a hit queue sorted by the given list of fields.
* @param fields Field names, in priority order (highest priority first). * @param fields Field names, in priority order (highest priority first).
* @param size The number of hits to retain. Must be greater than zero. * @param size The number of hits to retain. Must be greater than zero.
* @throws IOException
*/ */
FieldDocSortedHitQueue (SortField[] fields, int size) FieldDocSortedHitQueue (SortField[] fields, int size) {
throws IOException {
this.fields = fields; this.fields = fields;
this.collators = hasCollators (fields); this.collators = hasCollators (fields);
initialize (size); initialize (size);

View File

@ -28,7 +28,7 @@ public abstract class FilteredTermEnum extends TermEnum {
private Term currentTerm = null; private Term currentTerm = null;
private TermEnum actualEnum = null; private TermEnum actualEnum = null;
public FilteredTermEnum() throws IOException {} public FilteredTermEnum() {}
/** Equality compare on the term */ /** Equality compare on the term */
protected abstract boolean termCompare(Term term); protected abstract boolean termCompare(Term term);

View File

@ -27,7 +27,7 @@ final class PhrasePositions {
TermPositions tp; // stream of positions TermPositions tp; // stream of positions
PhrasePositions next; // used to make lists PhrasePositions next; // used to make lists
PhrasePositions(TermPositions t, int o) throws IOException { PhrasePositions(TermPositions t, int o) {
tp = t; tp = t;
offset = o; offset = o;
} }

View File

@ -33,7 +33,7 @@ abstract class PhraseScorer extends Scorer {
private float freq; private float freq;
PhraseScorer(Weight weight, TermPositions[] tps, Similarity similarity, PhraseScorer(Weight weight, TermPositions[] tps, Similarity similarity,
byte[] norms) throws IOException { byte[] norms) {
super(similarity); super(similarity);
this.norms = norms; this.norms = norms;
this.weight = weight; this.weight = weight;

View File

@ -24,7 +24,7 @@ final class SloppyPhraseScorer extends PhraseScorer {
private int slop; private int slop;
SloppyPhraseScorer(Weight weight, TermPositions[] tps, Similarity similarity, SloppyPhraseScorer(Weight weight, TermPositions[] tps, Similarity similarity,
int slop, byte[] norms) throws IOException { int slop, byte[] norms) {
super(weight, tps, similarity, norms); super(weight, tps, similarity, norms);
this.slop = slop; this.slop = slop;
} }

View File

@ -36,7 +36,7 @@ final class TermScorer extends Scorer {
private float[] scoreCache = new float[SCORE_CACHE_SIZE]; private float[] scoreCache = new float[SCORE_CACHE_SIZE];
TermScorer(Weight weight, TermDocs td, Similarity similarity, TermScorer(Weight weight, TermDocs td, Similarity similarity,
byte[] norms) throws IOException { byte[] norms) {
super(similarity); super(similarity);
this.weight = weight; this.weight = weight;
this.termDocs = td; this.termDocs = td;
@ -65,7 +65,7 @@ final class TermScorer extends Scorer {
return true; return true;
} }
public float score() throws IOException { public float score() {
int f = freqs[pointer]; int f = freqs[pointer];
float raw = // compute tf(f)*weight float raw = // compute tf(f)*weight
f < SCORE_CACHE_SIZE // check cache f < SCORE_CACHE_SIZE // check cache