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

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150400 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2004-08-06 20:50:29 +00:00
parent ab798c960e
commit c122d5bf3f
5 changed files with 11 additions and 17 deletions

View File

@ -52,13 +52,12 @@ public class MultiReader extends IndexReader {
} }
/** Construct reading the named set of readers. */ /** Construct reading the named set of readers. */
MultiReader(Directory directory, SegmentInfos sis, boolean closeDirectory, IndexReader[] subReaders) MultiReader(Directory directory, SegmentInfos sis, boolean closeDirectory, IndexReader[] subReaders) {
throws IOException {
super(directory, sis, closeDirectory); super(directory, sis, closeDirectory);
initialize(subReaders); initialize(subReaders);
} }
private void initialize(IndexReader[] subReaders) throws IOException{ private void initialize(IndexReader[] subReaders) {
this.subReaders = subReaders; this.subReaders = subReaders;
starts = new int[subReaders.length + 1]; // build starts array starts = new int[subReaders.length + 1]; // build starts array
for (int i = 0; i < subReaders.length; i++) { for (int i = 0; i < subReaders.length; i++) {

View File

@ -178,11 +178,9 @@ public class MultipleTermPositions
* Describe <code>nextPosition</code> method here. * Describe <code>nextPosition</code> method here.
* *
* @return an <code>int</code> value * @return an <code>int</code> value
* @exception IOException if an error occurs
* @see TermPositions#nextPosition() * @see TermPositions#nextPosition()
*/ */
public final int nextPosition() public final int nextPosition()
throws IOException
{ {
return _posList.next(); return _posList.next();
} }

View File

@ -188,7 +188,7 @@ final class SegmentReader extends IndexReader {
return false; return false;
} }
protected final void doDelete(int docNum) throws IOException { protected final void doDelete(int docNum) {
if (deletedDocs == null) if (deletedDocs == null)
deletedDocs = new BitVector(maxDoc()); deletedDocs = new BitVector(maxDoc());
deletedDocsDirty = true; deletedDocsDirty = true;
@ -196,7 +196,7 @@ final class SegmentReader extends IndexReader {
deletedDocs.set(docNum); deletedDocs.set(docNum);
} }
protected final void doUndeleteAll() throws IOException { protected final void doUndeleteAll() {
deletedDocs = null; deletedDocs = null;
deletedDocsDirty = false; deletedDocsDirty = false;
undeleteAll = true; undeleteAll = true;
@ -222,7 +222,7 @@ final class SegmentReader extends IndexReader {
return files; return files;
} }
public final TermEnum terms() throws IOException { public final TermEnum terms() {
return tis.terms(); return tis.terms();
} }
@ -271,7 +271,7 @@ final class SegmentReader extends IndexReader {
/** /**
* @see IndexReader#getFieldNames() * @see IndexReader#getFieldNames()
*/ */
public Collection getFieldNames() throws IOException { public Collection getFieldNames() {
// maintain a unique set of field names // maintain a unique set of field names
Set fieldSet = new HashSet(); Set fieldSet = new HashSet();
for (int i = 0; i < fieldInfos.size(); i++) { for (int i = 0; i < fieldInfos.size(); i++) {
@ -284,7 +284,7 @@ final class SegmentReader extends IndexReader {
/** /**
* @see IndexReader#getFieldNames(boolean) * @see IndexReader#getFieldNames(boolean)
*/ */
public Collection getFieldNames(boolean indexed) throws IOException { public Collection getFieldNames(boolean indexed) {
// maintain a unique set of field names // maintain a unique set of field names
Set fieldSet = new HashSet(); Set fieldSet = new HashSet();
for (int i = 0; i < fieldInfos.size(); i++) { for (int i = 0; i < fieldInfos.size(); i++) {
@ -386,8 +386,7 @@ final class SegmentReader extends IndexReader {
* the specified field of this document, if the field had storeTermVector * the specified field of this document, if the field had storeTermVector
* flag set. If the flag was not set, the method returns null. * flag set. If the flag was not set, the method returns null.
*/ */
public TermFreqVector getTermFreqVector(int docNumber, String field) public TermFreqVector getTermFreqVector(int docNumber, String field) {
throws IOException {
// Check if this field is invalid or has no stored term vector // Check if this field is invalid or has no stored term vector
FieldInfo fi = fieldInfos.fieldInfo(field); FieldInfo fi = fieldInfos.fieldInfo(field);
if (fi == null || !fi.storeTermVector) return null; if (fi == null || !fi.storeTermVector) return null;
@ -402,8 +401,7 @@ final class SegmentReader extends IndexReader {
* in a given vectorized field. * in a given vectorized field.
* If no such fields existed, the method returns null. * If no such fields existed, the method returns null.
*/ */
public TermFreqVector[] getTermFreqVectors(int docNumber) public TermFreqVector[] getTermFreqVectors(int docNumber) {
throws IOException {
if (termVectorsReader == null) if (termVectorsReader == null)
return null; return null;

View File

@ -39,8 +39,7 @@ class SegmentTermDocs implements TermDocs {
private long skipPointer; private long skipPointer;
private boolean haveSkipped; private boolean haveSkipped;
SegmentTermDocs(SegmentReader parent) SegmentTermDocs(SegmentReader parent) {
throws IOException {
this.parent = parent; this.parent = parent;
this.freqStream = (InputStream) parent.freqStream.clone(); this.freqStream = (InputStream) parent.freqStream.clone();
this.deletedDocs = parent.deletedDocs; this.deletedDocs = parent.deletedDocs;

View File

@ -94,7 +94,7 @@ final class TermInfosReader {
} }
/** Returns the offset of the greatest index entry which is less than or equal to term.*/ /** Returns the offset of the greatest index entry which is less than or equal to term.*/
private final int getIndexOffset(Term term) throws IOException { private final int getIndexOffset(Term term) {
int lo = 0; // binary search indexTerms[] int lo = 0; // binary search indexTerms[]
int hi = indexTerms.length - 1; int hi = indexTerms.length - 1;