cleanup: don't declare exceptions that can never be thrown

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150585 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2004-10-10 15:44:45 +00:00
parent a25fdef56d
commit 8bf11bc856
4 changed files with 7 additions and 15 deletions

View File

@ -18,8 +18,6 @@ package org.apache.lucene.index;
import org.apache.lucene.store.BufferedIndexInput;
import java.io.IOException;
public class MockIndexInput extends BufferedIndexInput {
private byte[] buffer;
private int pointer = 0;
@ -30,8 +28,7 @@ public class MockIndexInput extends BufferedIndexInput {
length = bytes.length;
}
protected void readInternal(byte[] dest, int destOffset, int len)
throws IOException {
protected void readInternal(byte[] dest, int destOffset, int len) {
int remainder = len;
int start = pointer;
while (remainder != 0) {
@ -47,11 +44,11 @@ public class MockIndexInput extends BufferedIndexInput {
pointer += len;
}
public void close() throws IOException {
public void close() {
// ignore
}
protected void seekInternal(long pos) throws IOException {
protected void seekInternal(long pos) {
pointer = (int) pos;
}

View File

@ -34,8 +34,7 @@ public class TestFilterIndexReader extends TestCase {
/** Filter that only permits terms containing 'e'.*/
private static class TestTermEnum extends FilterTermEnum {
public TestTermEnum(TermEnum termEnum)
throws IOException {
public TestTermEnum(TermEnum termEnum) {
super(termEnum);
}
@ -51,8 +50,7 @@ public class TestFilterIndexReader extends TestCase {
/** Filter that only returns odd numbered documents. */
private static class TestTermPositions extends FilterTermPositions {
public TestTermPositions(TermPositions in)
throws IOException {
public TestTermPositions(TermPositions in) {
super(in);
}

View File

@ -25,8 +25,6 @@ import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.store.RAMDirectory;
import java.util.BitSet;
import java.io.IOException;
/**
* FilteredQuery JUnit tests.
@ -76,7 +74,7 @@ extends TestCase {
searcher = new IndexSearcher (directory);
query = new TermQuery (new Term ("field", "three"));
filter = new Filter() {
public BitSet bits (IndexReader reader) throws IOException {
public BitSet bits (IndexReader reader) {
BitSet bitset = new BitSet(5);
bitset.set (1);
bitset.set (3);

View File

@ -30,7 +30,6 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import java.io.Reader;
import java.io.IOException;
import java.io.StringReader;
import junit.framework.TestCase;
@ -51,7 +50,7 @@ public class TestPositionIncrement extends TestCase {
private final int[] INCREMENTS = {1, 2, 1, 0, 1};
private int i = 0;
public Token next() throws IOException {
public Token next() {
if (i == TOKENS.length)
return null;
Token t = new Token(TOKENS[i], i, i);