Apache Lucene open-source search software
LUCENE-4172: clean up redundant throws clauses
Steven Rowefd16190940d7
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.javaindex 23166ad43f2..cdd5f73dbe6 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/cjk/CJKBigramFilter.java@@ -205,7 +205,7 @@ public final class CJKBigramFilter extends TokenFilter {/*** refills buffers with new data from the current token.*/- private void refill() throws IOException {+ private void refill() {// compact buffers to keep them smallish if they become large// just a safety check, but technically we only need the last codepointif (bufferLen > 64) {diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.javaindex eececf2e78d..5d105d73a42 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java@@ -64,7 +64,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer {static final int ELEM_HYPHEN = 4;- public PatternParser() throws HyphenationException {+ public PatternParser() {token = new StringBuilder();parser = createParser();parser.setContentHandler(this);@@ -74,7 +74,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer {}- public PatternParser(PatternConsumer consumer) throws HyphenationException {+ public PatternParser(PatternConsumer consumer) {this();this.consumer = consumer;}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.javaindex aaa2d56e166..0aad88207d3 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java@@ -648,7 +648,7 @@ public class TernaryTree implements Cloneable {}- public static void main(String[] args) throws Exception {+ public static void main(String[] args) {TernaryTree tt = new TernaryTree();tt.insert("Carlos", 'C');tt.insert("Car", 'r');diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilter.javaindex 036d33b6fcc..b2808f138e9 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilter.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/StopFilter.java@@ -17,7 +17,6 @@ package org.apache.lucene.analysis.core;* limitations under the License.*/-import java.io.IOException;import java.util.Arrays;import java.util.List;@@ -122,7 +121,7 @@ public final class StopFilter extends FilteringTokenFilter {* Returns the next input Token whose term() is not a stop word.*/@Override- protected boolean accept() throws IOException {+ protected boolean accept() {return !stopWords.contains(termAtt.buffer(), 0, termAtt.length());}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilter.javaindex f564af2212b..8c23fcff0f2 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilter.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/core/TypeTokenFilter.java@@ -48,7 +48,7 @@ public final class TypeTokenFilter extends FilteringTokenFilter {* When the useWhiteList parameter is set to true then accept the token if its type is contained in the stopTypes*/@Override- protected boolean accept() throws IOException {+ protected boolean accept() {return useWhiteList == stopTypes.contains(typeAttribute.type());}}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/EmptyTokenStream.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/EmptyTokenStream.javaindex 3fb371dbcaa..6b2b2db17c9 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/EmptyTokenStream.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/EmptyTokenStream.java@@ -19,15 +19,13 @@ package org.apache.lucene.analysis.miscellaneous;import org.apache.lucene.analysis.TokenStream;-import java.io.IOException;-/*** An always exhausted token stream.*/public final class EmptyTokenStream extends TokenStream {@Override- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {return false;}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/KeepWordFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/KeepWordFilter.javaindex 3216bfdf1a1..f3209a87db8 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/KeepWordFilter.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/KeepWordFilter.java@@ -17,9 +17,6 @@package org.apache.lucene.analysis.miscellaneous;-import java.io.IOException;--import org.apache.lucene.analysis.TokenFilter;import org.apache.lucene.analysis.TokenStream;import org.apache.lucene.analysis.util.FilteringTokenFilter;import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;@@ -43,7 +40,7 @@ public final class KeepWordFilter extends FilteringTokenFilter {}@Override- public boolean accept() throws IOException {+ public boolean accept() {return words.contains(termAtt.buffer(), 0, termAtt.length());}}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/LengthFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/LengthFilter.javaindex 289688a443a..984d9f8151c 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/LengthFilter.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/LengthFilter.java@@ -17,10 +17,7 @@ package org.apache.lucene.analysis.miscellaneous;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.analysis.TokenStream;-import org.apache.lucene.analysis.TokenFilter;import org.apache.lucene.analysis.util.FilteringTokenFilter;import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;@@ -48,7 +45,7 @@ public final class LengthFilter extends FilteringTokenFilter {}@Override- public boolean accept() throws IOException {+ public boolean accept() {final int len = termAtt.length();return (len >= min && len <= max);}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/SingleTokenTokenStream.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/SingleTokenTokenStream.javaindex 94e31e0037a..0bdc357af4f 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/SingleTokenTokenStream.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/SingleTokenTokenStream.java@@ -17,8 +17,6 @@ package org.apache.lucene.analysis.miscellaneous;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.util.AttributeImpl;import org.apache.lucene.analysis.Token;import org.apache.lucene.analysis.TokenStream;@@ -46,7 +44,7 @@ public final class SingleTokenTokenStream extends TokenStream {}@Override- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {if (exhausted) {return false;} else {@@ -58,7 +56,7 @@ public final class SingleTokenTokenStream extends TokenStream {}@Override- public void reset() throws IOException {+ public void reset() {exhausted = false;}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternTokenizer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternTokenizer.javaindex 6dd473ac2b4..7b0fcc39032 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternTokenizer.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternTokenizer.java@@ -84,7 +84,7 @@ public final class PatternTokenizer extends Tokenizer {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (index >= str.length()) return false;clearAttributes();if (group >= 0) {@@ -130,7 +130,7 @@ public final class PatternTokenizer extends Tokenizer {}@Override- public void end() throws IOException {+ public void end() {final int ofs = correctOffset(str.length());offsetAtt.setOffset(ofs, ofs);}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/sinks/TeeSinkTokenFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/sinks/TeeSinkTokenFilter.javaindex 2d8b6fba505..418fe7a950c 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/sinks/TeeSinkTokenFilter.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/sinks/TeeSinkTokenFilter.java@@ -212,7 +212,7 @@ public final class TeeSinkTokenFilter extends TokenFilter {}@Override- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {// lazy init the iteratorif (it == null) {it = cachedStates.iterator();@@ -228,7 +228,7 @@ public final class TeeSinkTokenFilter extends TokenFilter {}@Override- public final void end() throws IOException {+ public final void end() {if (finalState != null) {restoreState(finalState);}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/WordnetSynonymParser.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/WordnetSynonymParser.javaindex ead008b1092..db7d3540e02 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/WordnetSynonymParser.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/WordnetSynonymParser.java@@ -92,7 +92,7 @@ public class WordnetSynonymParser extends SynonymMap.Builder {return analyze(analyzer, text, reuse);}- private void addInternal(CharsRef synset[], int size) throws IOException {+ private void addInternal(CharsRef synset[], int size) {if (size <= 1) {return; // nothing to do}diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizer.javaindex 85ca71b6478..4a7930fa285 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizer.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizer.java@@ -331,7 +331,7 @@ public final class WikipediaTokenizer extends Tokenizer {}@Override- public void end() throws IOException {+ public void end() {// set final offsetfinal int finalOffset = correctOffset(scanner.yychar() + scanner.yylength());this.offsetAtt.setOffset(finalOffset, finalOffset);diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.javaindex 179ff95d465..1019e88771f 100644--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java@@ -1,6 +1,5 @@package org.apache.lucene.analysis.core;-import java.io.IOException;import java.io.Reader;import java.nio.CharBuffer;@@ -68,7 +67,7 @@ public class TestBugInSomething extends BaseTokenStreamTestCase {CharStream wrappedStream = new CharStream() {@Override- public void mark(int readAheadLimit) throws IOException {+ public void mark(int readAheadLimit) {throw new UnsupportedOperationException("mark(int)");}@@ -78,32 +77,32 @@ public class TestBugInSomething extends BaseTokenStreamTestCase {}@Override- public int read() throws IOException {+ public int read() {throw new UnsupportedOperationException("read()");}@Override- public int read(char[] cbuf) throws IOException {+ public int read(char[] cbuf) {throw new UnsupportedOperationException("read(char[])");}@Override- public int read(CharBuffer target) throws IOException {+ public int read(CharBuffer target) {throw new UnsupportedOperationException("read(CharBuffer)");}@Override- public boolean ready() throws IOException {+ public boolean ready() {throw new UnsupportedOperationException("ready()");}@Override- public void reset() throws IOException {+ public void reset() {throw new UnsupportedOperationException("reset()");}@Override- public long skip(long n) throws IOException {+ public long skip(long n) {throw new UnsupportedOperationException("skip(long)");}@@ -113,12 +112,12 @@ public class TestBugInSomething extends BaseTokenStreamTestCase {}@Override- public void close() throws IOException {+ public void close() {throw new UnsupportedOperationException("close()");}@Override- public int read(char[] arg0, int arg1, int arg2) throws IOException {+ public int read(char[] arg0, int arg1, int arg2) {throw new UnsupportedOperationException("read(char[], int, int)");}};diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.javaindex a6f384079cf..a508a8577c9 100644--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java@@ -224,7 +224,7 @@ public class TestRandomChains extends BaseTokenStreamTestCase {}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {tokenizers = null;tokenfilters = null;charfilters = null;diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/position/PositionFilterTest.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/position/PositionFilterTest.javaindex cea2a62d337..be13ec63ce9 100644--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/position/PositionFilterTest.java+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/position/PositionFilterTest.java@@ -17,8 +17,6 @@ package org.apache.lucene.analysis.position;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.analysis.BaseTokenStreamTestCase;import org.apache.lucene.analysis.TokenStream;import org.apache.lucene.analysis.shingle.ShingleFilter;@@ -38,7 +36,7 @@ public class PositionFilterTest extends BaseTokenStreamTestCase {}@Override- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {clearAttributes();if (index < testToken.length) {termAtt.setEmpty().append(testToken[index++]);diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.javaindex e398162af4f..0a6194fd801 100644--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java@@ -54,7 +54,7 @@ public class ShingleFilterTest extends BaseTokenStreamTestCase {}@Override- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {clearAttributes();if (index < testToken.length) {Token t = testToken[index++];diff --git a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizer.java b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizer.javaindex 7cdcc7fce9c..1872e606f18 100644--- a/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizer.java+++ b/lucene/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/ICUTokenizer.java@@ -109,7 +109,7 @@ public final class ICUTokenizer extends Tokenizer {}@Override- public void end() throws IOException {+ public void end() {final int finalOffset = (length < 0) ? offset : offset + length;offsetAtt.setOffset(correctOffset(finalOffset), correctOffset(finalOffset));}diff --git a/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateHTMLStripCharFilterSupplementaryMacros.java b/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateHTMLStripCharFilterSupplementaryMacros.javaindex 849fd1be5e5..b3569d21126 100644--- a/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateHTMLStripCharFilterSupplementaryMacros.java+++ b/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateHTMLStripCharFilterSupplementaryMacros.java@@ -52,7 +52,7 @@ public class GenerateHTMLStripCharFilterSupplementaryMacros {+ " */" + NL + NL;- public static void main(String args[]) throws Exception {+ public static void main(String args[]) {outputHeader();outputMacro("ID_Start_Supp", "[:ID_Start:]");outputMacro("ID_Continue_Supp", "[:ID_Continue:]");diff --git a/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateJFlexSupplementaryMacros.java b/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateJFlexSupplementaryMacros.javaindex a44ee893128..29f7937a128 100644--- a/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateJFlexSupplementaryMacros.java+++ b/lucene/analysis/icu/src/tools/java/org/apache/lucene/analysis/icu/GenerateJFlexSupplementaryMacros.java@@ -55,7 +55,7 @@ public class GenerateJFlexSupplementaryMacros {+ " */" + NL + NL;- public static void main(String args[]) throws Exception {+ public static void main(String args[]) {outputHeader();outputMacro("ALetterSupp", "[:WordBreak=ALetter:]");outputMacro("FormatSupp", "[:WordBreak=Format:]");diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapanesePartOfSpeechStopFilter.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapanesePartOfSpeechStopFilter.javaindex fe0b3521b50..24cc847375a 100644--- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapanesePartOfSpeechStopFilter.java+++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapanesePartOfSpeechStopFilter.java@@ -17,7 +17,6 @@ package org.apache.lucene.analysis.ja;* limitations under the License.*/-import java.io.IOException;import java.util.Set;import org.apache.lucene.analysis.ja.tokenattributes.PartOfSpeechAttribute;@@ -37,7 +36,7 @@ public final class JapanesePartOfSpeechStopFilter extends FilteringTokenFilter {}@Override- protected boolean accept() throws IOException {+ protected boolean accept() {final String pos = posAtt.getPartOfSpeech();return pos == null || !stopTags.contains(pos);}diff --git a/lucene/analysis/kuromoji/src/tools/java/org/apache/lucene/analysis/ja/util/BinaryDictionaryWriter.java b/lucene/analysis/kuromoji/src/tools/java/org/apache/lucene/analysis/ja/util/BinaryDictionaryWriter.javaindex e66b89201fc..a9625fd36ee 100644--- a/lucene/analysis/kuromoji/src/tools/java/org/apache/lucene/analysis/ja/util/BinaryDictionaryWriter.java+++ b/lucene/analysis/kuromoji/src/tools/java/org/apache/lucene/analysis/ja/util/BinaryDictionaryWriter.java@@ -224,7 +224,7 @@ public abstract class BinaryDictionaryWriter {lastWordId = wordId;}- protected final String getBaseFileName(String baseDir) throws IOException {+ protected final String getBaseFileName(String baseDir) {return baseDir + File.separator + implClazz.getName().replace('.', File.separatorChar);}diff --git a/lucene/analysis/kuromoji/src/tools/java/org/apache/lucene/analysis/ja/util/DictionaryBuilder.java b/lucene/analysis/kuromoji/src/tools/java/org/apache/lucene/analysis/ja/util/DictionaryBuilder.javaindex 6660c7471aa..ea366296465 100644--- a/lucene/analysis/kuromoji/src/tools/java/org/apache/lucene/analysis/ja/util/DictionaryBuilder.java+++ b/lucene/analysis/kuromoji/src/tools/java/org/apache/lucene/analysis/ja/util/DictionaryBuilder.java@@ -55,7 +55,7 @@ public class DictionaryBuilder {System.out.println("done");}- public static void main(String[] args) throws IOException, ClassNotFoundException {+ public static void main(String[] args) throws IOException {DictionaryFormat format;if (args[0].equalsIgnoreCase("ipadic")) {format = DictionaryFormat.IPADIC;diff --git a/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java b/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.javaindex b3cd79e1804..9f150dde070 100644--- a/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java+++ b/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java@@ -123,7 +123,7 @@ public final class SentenceTokenizer extends Tokenizer {}@Override- public void end() throws IOException {+ public void end() {// set final offsetfinal int finalOffset = correctOffset(tokenEnd);offsetAtt.setOffset(finalOffset, finalOffset);diff --git a/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BigramDictionary.java b/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BigramDictionary.javaindex b68df406109..4152143335a 100644--- a/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BigramDictionary.java+++ b/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BigramDictionary.java@@ -148,8 +148,7 @@ class BigramDictionary extends AbstractDictionary {* @throws IOException* @throws UnsupportedEncodingException*/- public void loadFromFile(String dctFilePath) throws FileNotFoundException,- IOException, UnsupportedEncodingException {+ public void loadFromFile(String dctFilePath) throws IOException {int i, cnt, length, total = 0;// The file only counted 6763 Chinese characters plus 5 reserved slots 3756~3760.diff --git a/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java b/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.javaindex 70515b53856..af3897b7f94 100644--- a/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java+++ b/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java@@ -190,8 +190,7 @@ class WordDictionary extends AbstractDictionary {* @throws IOException* @throws UnsupportedEncodingException*/- private int loadMainDataFromFile(String dctFilePath)- throws FileNotFoundException, IOException, UnsupportedEncodingException {+ private int loadMainDataFromFile(String dctFilePath) throws IOException {int i, cnt, length, total = 0;// The file only counted 6763 Chinese characters plus 5 reserved slots 3756~3760.// The 3756th is used (as a header) to store information.diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.javaindex 54674ea09ba..9f30059da9f 100644--- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java+++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java@@ -20,7 +20,6 @@ package org.apache.lucene.benchmark.byTask.tasks;import org.apache.lucene.benchmark.byTask.PerfRunData;import org.apache.lucene.benchmark.byTask.utils.Config;import org.apache.lucene.codecs.Codec;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.IndexCommit;import org.apache.lucene.index.IndexDeletionPolicy;import org.apache.lucene.index.IndexWriter;@@ -34,7 +33,6 @@ import org.apache.lucene.index.NoDeletionPolicy;import org.apache.lucene.index.NoMergePolicy;import org.apache.lucene.index.NoMergeScheduler;import org.apache.lucene.index.IndexWriterConfig.OpenMode;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.Version;import java.io.BufferedOutputStream;@@ -174,7 +172,7 @@ public class CreateIndexTask extends PerfTask {return iwConf;}- public static IndexWriter configureWriter(Config config, PerfRunData runData, OpenMode mode, IndexCommit commit) throws CorruptIndexException, LockObtainFailedException, IOException {+ public static IndexWriter configureWriter(Config config, PerfRunData runData, OpenMode mode, IndexCommit commit) throws IOException {IndexWriterConfig iwc = createWriterConfig(config, runData, mode, commit);String infoStreamVal = config.get("writer.info.stream", null);if (infoStreamVal != null) {diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/utils/DocNameExtractor.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/utils/DocNameExtractor.javaindex 103781aaa71..25b48dfcf90 100755--- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/utils/DocNameExtractor.java+++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/utils/DocNameExtractor.java@@ -22,9 +22,7 @@ import java.util.List;import org.apache.lucene.index.FieldInfo;import org.apache.lucene.index.StoredFieldVisitor;-import org.apache.lucene.index.StoredFieldVisitor.Status;import org.apache.lucene.search.IndexSearcher;-import org.apache.lucene.store.IndexInput;/*** Utility: extract doc names from an index@@ -52,12 +50,12 @@ public class DocNameExtractor {final List<String> name = new ArrayList<String>();searcher.getIndexReader().document(docid, new StoredFieldVisitor() {@Override- public void stringField(FieldInfo fieldInfo, String value) throws IOException {+ public void stringField(FieldInfo fieldInfo, String value) {name.add(value);}@Override- public Status needsField(FieldInfo fieldInfo) throws IOException {+ public Status needsField(FieldInfo fieldInfo) {if (!name.isEmpty()) {return Status.STOP;} else if (fieldInfo.name.equals(docNameField)) {diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.javaindex bb7fb14b4aa..b38584635b9 100644--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java@@ -35,14 +35,14 @@ public abstract class BenchmarkTestCase extends LuceneTestCase {private static File WORKDIR;@BeforeClass- public static void beforeClassBenchmarkTestCase() throws Exception {+ public static void beforeClassBenchmarkTestCase() {WORKDIR = _TestUtil.getTempDir("benchmark");WORKDIR.delete();WORKDIR.mkdirs();}@AfterClass- public static void afterClassBenchmarkTestCase() throws Exception {+ public static void afterClassBenchmarkTestCase() {WORKDIR = null;}diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.javaindex 0b958365bb3..110de00b8e9 100644--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.java+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.java@@ -18,7 +18,6 @@ package org.apache.lucene.benchmark.byTask.feeds;*/import java.io.File;-import java.io.IOException;import java.io.PrintStream;import java.util.Properties;@@ -46,12 +45,11 @@ public class DocMakerTest extends BenchmarkTestCase {private boolean finish = false;@Override- public void close() throws IOException {+ public void close() {}@Override- public DocData getNextDocData(DocData docData) throws NoMoreDataException,- IOException {+ public DocData getNextDocData(DocData docData) throws NoMoreDataException {if (finish) {throw new NoMoreDataException();}diff --git a/lucene/core/src/java/org/apache/lucene/analysis/CachingTokenFilter.java b/lucene/core/src/java/org/apache/lucene/analysis/CachingTokenFilter.javaindex 3ff7368b281..a6c1e822a77 100644--- a/lucene/core/src/java/org/apache/lucene/analysis/CachingTokenFilter.java+++ b/lucene/core/src/java/org/apache/lucene/analysis/CachingTokenFilter.java@@ -61,14 +61,14 @@ public final class CachingTokenFilter extends TokenFilter {}@Override- public final void end() throws IOException {+ public final void end() {if (finalState != null) {restoreState(finalState);}}@Override- public void reset() throws IOException {+ public void reset() {if(cache != null) {iterator = cache.iterator();}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/BlockTermsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/BlockTermsReader.javaindex 4097d15e49a..09b427cf97d 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/BlockTermsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/BlockTermsReader.java@@ -18,7 +18,6 @@ package org.apache.lucene.codecs;*/import java.io.IOException;-import java.util.Collection;import java.util.Comparator;import java.util.Iterator;import java.util.TreeMap;@@ -30,7 +29,6 @@ import org.apache.lucene.index.FieldInfo;import org.apache.lucene.index.FieldInfos;import org.apache.lucene.index.FieldsEnum;import org.apache.lucene.index.IndexFileNames;-import org.apache.lucene.index.SegmentInfo;import org.apache.lucene.index.TermState;import org.apache.lucene.index.Terms;import org.apache.lucene.index.TermsEnum;@@ -713,7 +711,7 @@ public class BlockTermsReader extends FieldsProducer {}@Override- public void seekExact(BytesRef target, TermState otherState) throws IOException {+ public void seekExact(BytesRef target, TermState otherState) {//System.out.println("BTR.seekExact termState target=" + target.utf8ToString() + " " + target + " this=" + this);assert otherState != null && otherState instanceof BlockTermState;assert !doOrd || ((BlockTermState) otherState).ord < numTerms;diff --git a/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsReader.javaindex a4d95160b01..49dde51fdec 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsReader.java@@ -466,7 +466,7 @@ public class BlockTreeTermsReader extends FieldsProducer {}@Override- public int getDocCount() throws IOException {+ public int getDocCount() {return docCount;}@@ -863,7 +863,7 @@ public class BlockTreeTermsReader extends FieldsProducer {}@Override- public BytesRef term() throws IOException {+ public BytesRef term() {return term;}@@ -1156,22 +1156,22 @@ public class BlockTreeTermsReader extends FieldsProducer {}@Override- public boolean seekExact(BytesRef text, boolean useCache) throws IOException {+ public boolean seekExact(BytesRef text, boolean useCache) {throw new UnsupportedOperationException();}@Override- public void seekExact(long ord) throws IOException {+ public void seekExact(long ord) {throw new UnsupportedOperationException();}@Override- public long ord() throws IOException {+ public long ord() {throw new UnsupportedOperationException();}@Override- public SeekStatus seekCeil(BytesRef text, boolean useCache) throws IOException {+ public SeekStatus seekCeil(BytesRef text, boolean useCache) {throw new UnsupportedOperationException();}}@@ -2144,7 +2144,7 @@ public class BlockTreeTermsReader extends FieldsProducer {}@Override- public void seekExact(BytesRef target, TermState otherState) throws IOException {+ public void seekExact(BytesRef target, TermState otherState) {// if (DEBUG) {// System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);// }@@ -2174,7 +2174,7 @@ public class BlockTreeTermsReader extends FieldsProducer {}@Override- public void seekExact(long ord) throws IOException {+ public void seekExact(long ord) {throw new UnsupportedOperationException();}@@ -2351,7 +2351,7 @@ public class BlockTreeTermsReader extends FieldsProducer {// }}- void rewind() throws IOException {+ void rewind() {// Force reload:fp = fpOrig;diff --git a/lucene/core/src/java/org/apache/lucene/codecs/MappingMultiDocsAndPositionsEnum.java b/lucene/core/src/java/org/apache/lucene/codecs/MappingMultiDocsAndPositionsEnum.javaindex 8d22f7b5dd6..4ebb14c95ce 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/MappingMultiDocsAndPositionsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/MappingMultiDocsAndPositionsEnum.java@@ -42,7 +42,7 @@ public final class MappingMultiDocsAndPositionsEnum extends DocsAndPositionsEnumint doc = -1;private MergeState mergeState;- MappingMultiDocsAndPositionsEnum reset(MultiDocsAndPositionsEnum postingsEnum) throws IOException {+ MappingMultiDocsAndPositionsEnum reset(MultiDocsAndPositionsEnum postingsEnum) {this.numSubs = postingsEnum.getNumSubs();this.subs = postingsEnum.getSubs();upto = -1;@@ -73,7 +73,7 @@ public final class MappingMultiDocsAndPositionsEnum extends DocsAndPositionsEnum}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {throw new UnsupportedOperationException();}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/MappingMultiDocsEnum.java b/lucene/core/src/java/org/apache/lucene/codecs/MappingMultiDocsEnum.javaindex 631b5e9b2ed..2bd6bb6b205 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/MappingMultiDocsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/MappingMultiDocsEnum.java@@ -41,7 +41,7 @@ public final class MappingMultiDocsEnum extends DocsEnum {int doc = -1;private MergeState mergeState;- MappingMultiDocsEnum reset(MultiDocsEnum docsEnum) throws IOException {+ MappingMultiDocsEnum reset(MultiDocsEnum docsEnum) {this.numSubs = docsEnum.getNumSubs();this.subs = docsEnum.getSubs();upto = -1;@@ -72,7 +72,7 @@ public final class MappingMultiDocsEnum extends DocsEnum {}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {throw new UnsupportedOperationException();}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.java b/lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.javaindex df7edc47746..107e8656a26 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.java@@ -251,7 +251,7 @@ public abstract class MultiLevelSkipListReader {}@Override- public void close() throws IOException {+ public void close() {data = null;}@@ -266,18 +266,18 @@ public abstract class MultiLevelSkipListReader {}@Override- public byte readByte() throws IOException {+ public byte readByte() {return data[pos++];}@Override- public void readBytes(byte[] b, int offset, int len) throws IOException {+ public void readBytes(byte[] b, int offset, int len) {System.arraycopy(data, pos, b, offset, len);pos += len;}@Override- public void seek(long pos) throws IOException {+ public void seek(long pos) {this.pos = (int) (pos - pointer);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsReader.javaindex f758bd8334f..a8fec4425e4 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/StoredFieldsReader.java@@ -19,7 +19,6 @@ package org.apache.lucene.codecs;import java.io.Closeable;import java.io.IOException;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.StoredFieldVisitor;/**@@ -33,7 +32,7 @@ import org.apache.lucene.index.StoredFieldVisitor;public abstract class StoredFieldsReader implements Cloneable, Closeable {/** Visit the stored fields for document <code>n</code> */- public abstract void visitDocument(int n, StoredFieldVisitor visitor) throws CorruptIndexException, IOException;+ public abstract void visitDocument(int n, StoredFieldVisitor visitor) throws IOException;public abstract StoredFieldsReader clone();}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/intblock/FixedIntBlockIndexInput.java b/lucene/core/src/java/org/apache/lucene/codecs/intblock/FixedIntBlockIndexInput.javaindex 68d8dad18ef..259ce6a3bb8 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/intblock/FixedIntBlockIndexInput.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/intblock/FixedIntBlockIndexInput.java@@ -89,8 +89,7 @@ public abstract class FixedIntBlockIndexInput extends IntIndexInput {private final int blockSize;private final IntsRef bulkResult = new IntsRef();- public Reader(final IndexInput in, final int[] pending, final BlockReader blockReader)- throws IOException {+ public Reader(final IndexInput in, final int[] pending, final BlockReader blockReader) {this.in = in;this.pending = pending;this.blockSize = pending.length;diff --git a/lucene/core/src/java/org/apache/lucene/codecs/intblock/VariableIntBlockIndexInput.java b/lucene/core/src/java/org/apache/lucene/codecs/intblock/VariableIntBlockIndexInput.javaindex 865a4757cd2..0804dd7aa2e 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/intblock/VariableIntBlockIndexInput.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/intblock/VariableIntBlockIndexInput.java@@ -92,15 +92,14 @@ public abstract class VariableIntBlockIndexInput extends IntIndexInput {private final BlockReader blockReader;private final IntsRef bulkResult = new IntsRef();- public Reader(final IndexInput in, final int[] pending, final BlockReader blockReader)- throws IOException {+ public Reader(final IndexInput in, final int[] pending, final BlockReader blockReader) {this.in = in;this.pending = pending;bulkResult.ints = pending;this.blockReader = blockReader;}- void seek(final long fp, final int upto) throws IOException {+ void seek(final long fp, final int upto) {// TODO: should we do this in real-time, not lazy?pendingFP = fp;pendingUpto = upto;diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesConsumer.javaindex 8e02c187f35..6f00416f8cb 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesConsumer.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesConsumer.java@@ -39,7 +39,7 @@ public class Lucene40DocValuesConsumer extends DocValuesWriterBase {public final static String DOC_VALUES_SEGMENT_SUFFIX = "dv";- public Lucene40DocValuesConsumer(PerDocWriteState state, String segmentSuffix) throws IOException {+ public Lucene40DocValuesConsumer(PerDocWriteState state, String segmentSuffix) {super(state);this.segmentSuffix = segmentSuffix;mainDirectory = state.directory;diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.javaindex 3fd2ed49e67..585c1900d03 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java@@ -96,7 +96,7 @@ public class Lucene40NormsFormat extends NormsFormat {public static class Lucene40NormsDocValuesConsumer extends Lucene40DocValuesConsumer {public Lucene40NormsDocValuesConsumer(PerDocWriteState state,- String segmentSuffix) throws IOException {+ String segmentSuffix) {super(state, segmentSuffix);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.javaindex 5d0f9facc6c..5898d301c45 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java@@ -319,7 +319,7 @@ public class Lucene40PostingsReader extends PostingsReaderBase {protected boolean skipped;protected final Bits liveDocs;- SegmentDocsEnumBase(IndexInput startFreqIn, Bits liveDocs) throws IOException {+ SegmentDocsEnumBase(IndexInput startFreqIn, Bits liveDocs) {this.startFreqIn = startFreqIn;this.freqIn = (IndexInput)startFreqIn.clone();this.liveDocs = liveDocs;@@ -353,7 +353,7 @@ public class Lucene40PostingsReader extends PostingsReaderBase {}@Override- public final int freq() throws IOException {+ public final int freq() {assert !indexOmitsTF;return freq;}@@ -499,7 +499,7 @@ public class Lucene40PostingsReader extends PostingsReaderBase {private final class AllDocsSegmentDocsEnum extends SegmentDocsEnumBase {- AllDocsSegmentDocsEnum(IndexInput startFreqIn) throws IOException {+ AllDocsSegmentDocsEnum(IndexInput startFreqIn) {super(startFreqIn, null);assert liveDocs == null;}@@ -576,7 +576,7 @@ public class Lucene40PostingsReader extends PostingsReaderBase {private final class LiveDocsSegmentDocsEnum extends SegmentDocsEnumBase {- LiveDocsSegmentDocsEnum(IndexInput startFreqIn, Bits liveDocs) throws IOException {+ LiveDocsSegmentDocsEnum(IndexInput startFreqIn, Bits liveDocs) {super(startFreqIn, liveDocs);assert liveDocs != null;}@@ -696,7 +696,7 @@ public class Lucene40PostingsReader extends PostingsReaderBase {Lucene40SkipListReader skipper;private long lazyProxPointer;- public SegmentDocsAndPositionsEnum(IndexInput freqIn, IndexInput proxIn) throws IOException {+ public SegmentDocsAndPositionsEnum(IndexInput freqIn, IndexInput proxIn) {startFreqIn = freqIn;this.freqIn = (IndexInput) freqIn.clone();this.proxIn = (IndexInput) proxIn.clone();@@ -772,7 +772,7 @@ public class Lucene40PostingsReader extends PostingsReaderBase {}@Override- public int freq() throws IOException {+ public int freq() {return freq;}@@ -853,12 +853,12 @@ public class Lucene40PostingsReader extends PostingsReaderBase {}@Override- public int startOffset() throws IOException {+ public int startOffset() {return -1;}@Override- public int endOffset() throws IOException {+ public int endOffset() {return -1;}@@ -909,7 +909,7 @@ public class Lucene40PostingsReader extends PostingsReaderBase {int offsetLength;int startOffset;- public SegmentFullPositionsEnum(IndexInput freqIn, IndexInput proxIn) throws IOException {+ public SegmentFullPositionsEnum(IndexInput freqIn, IndexInput proxIn) {startFreqIn = freqIn;this.freqIn = (IndexInput) freqIn.clone();this.proxIn = (IndexInput) proxIn.clone();diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.javaindex e48aa634eeb..3cb24de1e99 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java@@ -136,7 +136,7 @@ public final class Lucene40StoredFieldsReader extends StoredFieldsReader implemeindexStream.seek(HEADER_LENGTH_IDX + docID * 8L);}- public final void visitDocument(int n, StoredFieldVisitor visitor) throws CorruptIndexException, IOException {+ public final void visitDocument(int n, StoredFieldVisitor visitor) throws IOException {seekIndex(n);fieldsStream.seek(indexStream.readLong());diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsWriter.javaindex 2b6438acac3..dfdcbd17f8e 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsWriter.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsWriter.java@@ -22,12 +22,10 @@ import org.apache.lucene.codecs.CodecUtil;import org.apache.lucene.codecs.StoredFieldsReader;import org.apache.lucene.codecs.StoredFieldsWriter;import org.apache.lucene.document.Document;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.FieldInfo;import org.apache.lucene.index.FieldInfos;import org.apache.lucene.index.IndexFileNames;import org.apache.lucene.index.IndexableField;-import org.apache.lucene.index.MergePolicy.MergeAbortedException;import org.apache.lucene.index.MergeState;import org.apache.lucene.index.SegmentReader;import org.apache.lucene.store.Directory;@@ -209,7 +207,7 @@ public final class Lucene40StoredFieldsWriter extends StoredFieldsWriter {}@Override- public void finish(FieldInfos fis, int numDocs) throws IOException {+ public void finish(FieldInfos fis, int numDocs) {if (HEADER_LENGTH_IDX+((long) numDocs)*8 != indexStream.getFilePointer())// This is most likely a bug in Sun JRE 1.6.0_04/_05;// we detect that the bug has struck, here, and@@ -255,7 +253,7 @@ public final class Lucene40StoredFieldsWriter extends StoredFieldsWriter {private int copyFieldsWithDeletions(MergeState mergeState, final MergeState.IndexReaderAndLiveDocs reader,final Lucene40StoredFieldsReader matchingFieldsReader, int rawDocLengths[])- throws IOException, MergeAbortedException, CorruptIndexException {+ throws IOException {int docCount = 0;final int maxDoc = reader.reader.maxDoc();final Bits liveDocs = reader.liveDocs;@@ -309,7 +307,7 @@ public final class Lucene40StoredFieldsWriter extends StoredFieldsWriter {private int copyFieldsNoDeletions(MergeState mergeState, final MergeState.IndexReaderAndLiveDocs reader,final Lucene40StoredFieldsReader matchingFieldsReader, int rawDocLengths[])- throws IOException, MergeAbortedException, CorruptIndexException {+ throws IOException {final int maxDoc = reader.reader.maxDoc();int docCount = 0;if (matchingFieldsReader != null) {diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.javaindex 0eaebc46fd0..0bd9b4d0fe2 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java@@ -25,7 +25,6 @@ import java.util.Map;import org.apache.lucene.codecs.CodecUtil;import org.apache.lucene.codecs.TermVectorsReader;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DocsAndPositionsEnum;import org.apache.lucene.index.DocsEnum;import org.apache.lucene.index.FieldInfo;@@ -96,7 +95,7 @@ public class Lucene40TermVectorsReader extends TermVectorsReader {}public Lucene40TermVectorsReader(Directory d, SegmentInfo si, FieldInfos fieldInfos, IOContext context)- throws CorruptIndexException, IOException {+ throws IOException {final String segment = si.name;final int size = si.getDocCount();@@ -252,7 +251,7 @@ public class Lucene40TermVectorsReader extends TermVectorsReader {private int fieldUpto;@Override- public String next() throws IOException {+ public String next() {if (fieldNumbers != null && fieldUpto < fieldNumbers.length) {return fieldInfos.fieldInfo(fieldNumbers[fieldUpto++]).name;} else {@@ -365,7 +364,7 @@ public class Lucene40TermVectorsReader extends TermVectorsReader {private int[] endOffsets;// NOTE: tvf is pre-positioned by caller- public TVTermsEnum() throws IOException {+ public TVTermsEnum() {this.origTVF = Lucene40TermVectorsReader.this.tvf;tvf = (IndexInput) origTVF.clone();}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.javaindex b66970ed898..ce9adeda54a 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java@@ -27,7 +27,6 @@ import org.apache.lucene.index.FieldInfo;import org.apache.lucene.index.FieldInfos;import org.apache.lucene.index.Fields;import org.apache.lucene.index.IndexFileNames;-import org.apache.lucene.index.MergePolicy.MergeAbortedException;import org.apache.lucene.index.MergeState;import org.apache.lucene.index.SegmentReader;import org.apache.lucene.store.DataInput;@@ -284,7 +283,7 @@ public final class Lucene40TermVectorsWriter extends TermVectorsWriter {final MergeState.IndexReaderAndLiveDocs reader,int rawDocLengths[],int rawDocLengths2[])- throws IOException, MergeAbortedException {+ throws IOException {final int maxDoc = reader.reader.maxDoc();final Bits liveDocs = reader.liveDocs;int totalNumDocs = 0;@@ -337,7 +336,7 @@ public final class Lucene40TermVectorsWriter extends TermVectorsWriter {final MergeState.IndexReaderAndLiveDocs reader,int rawDocLengths[],int rawDocLengths2[])- throws IOException, MergeAbortedException {+ throws IOException {final int maxDoc = reader.reader.maxDoc();if (matchingVectorsReader != null) {// We can bulk-copy because the fieldInfos are "congruent"@@ -362,7 +361,7 @@ public final class Lucene40TermVectorsWriter extends TermVectorsWriter {}@Override- public void finish(FieldInfos fis, int numDocs) throws IOException {+ public void finish(FieldInfos fis, int numDocs) {if (HEADER_LENGTH_INDEX+((long) numDocs)*16 != tvx.getFilePointer())// This is most likely a bug in Sun JRE 1.6.0_04/_05;// we detect that the bug has struck, here, and@@ -382,7 +381,7 @@ public final class Lucene40TermVectorsWriter extends TermVectorsWriter {}@Override- public Comparator<BytesRef> getComparator() throws IOException {+ public Comparator<BytesRef> getComparator() {return BytesRef.getUTF8SortedAsUnicodeComparator();}}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Bytes.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Bytes.javaindex fd092aa2bfc..cbec979bd78 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Bytes.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Bytes.java@@ -121,14 +121,11 @@ public final class Bytes {* {@link Type#BYTES_VAR_SORTED}.* @param context I/O Context* @return a new {@link Writer} instance- * @throws IOException- * if the files for the writer can not be created.* @see PackedInts#getReader(org.apache.lucene.store.DataInput)*/public static DocValuesConsumer getWriter(Directory dir, String id, Mode mode,boolean fixedSize, Comparator<BytesRef> sortComparator,- Counter bytesUsed, IOContext context, float acceptableOverheadRatio)- throws IOException {+ Counter bytesUsed, IOContext context, float acceptableOverheadRatio) {// TODO -- i shouldn't have to specify fixed? can// track itself & do the write thing at write time?if (sortComparator == null) {@@ -244,7 +241,7 @@ public final class Bytes {private final IOContext context;protected BytesWriterBase(Directory dir, String id, String codecNameIdx, String codecNameDat,- int version, Counter bytesUsed, IOContext context, Type type) throws IOException {+ int version, Counter bytesUsed, IOContext context, Type type) {super(bytesUsed, type);this.id = id;this.dir = dir;@@ -388,21 +385,19 @@ public final class Bytes {protected long maxBytes = 0;protected DerefBytesWriterBase(Directory dir, String id, String codecNameIdx, String codecNameDat,- int codecVersion, Counter bytesUsed, IOContext context, Type type)- throws IOException {+ int codecVersion, Counter bytesUsed, IOContext context, Type type) {this(dir, id, codecNameIdx, codecNameDat, codecVersion, new DirectTrackingAllocator(ByteBlockPool.BYTE_BLOCK_SIZE, bytesUsed), bytesUsed, context, PackedInts.DEFAULT, type);}protected DerefBytesWriterBase(Directory dir, String id, String codecNameIdx, String codecNameDat,- int codecVersion, Counter bytesUsed, IOContext context, float acceptableOverheadRatio, Type type)- throws IOException {+ int codecVersion, Counter bytesUsed, IOContext context, float acceptableOverheadRatio, Type type) {this(dir, id, codecNameIdx, codecNameDat, codecVersion, new DirectTrackingAllocator(ByteBlockPool.BYTE_BLOCK_SIZE, bytesUsed), bytesUsed, context, acceptableOverheadRatio, type);}protected DerefBytesWriterBase(Directory dir, String id, String codecNameIdx, String codecNameDat, int codecVersion, Allocator allocator,- Counter bytesUsed, IOContext context, float acceptableOverheadRatio, Type type) throws IOException {+ Counter bytesUsed, IOContext context, float acceptableOverheadRatio, Type type) {super(dir, id, codecNameIdx, codecNameDat, codecVersion, bytesUsed, context, type);hash = new BytesRefHash(new ByteBlockPool(allocator),BytesRefHash.DEFAULT_CAPACITY, new TrackingDirectBytesStartArray(diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/DirectSource.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/DirectSource.javaindex 66112c986af..2acbb5615b0 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/DirectSource.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/DirectSource.java@@ -126,7 +126,7 @@ abstract class DirectSource extends Source {private static final class BytesToFloat extends ToNumeric {@Override- long toLong(IndexInput input) throws IOException {+ long toLong(IndexInput input) {throw new UnsupportedOperationException("ints are not supported");}@@ -137,7 +137,7 @@ abstract class DirectSource extends Source {private static final class BytesToDouble extends ToNumeric {@Override- long toLong(IndexInput input) throws IOException {+ long toLong(IndexInput input) {throw new UnsupportedOperationException("ints are not supported");}@@ -153,7 +153,7 @@ abstract class DirectSource extends Source {return input.readLong();}- double toDouble(IndexInput input) throws IOException {+ double toDouble(IndexInput input) {throw new UnsupportedOperationException("doubles are not supported");}}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedDerefBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedDerefBytesImpl.javaindex c7ddb6d7485..5f733188ad8 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedDerefBytesImpl.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedDerefBytesImpl.java@@ -46,8 +46,7 @@ class FixedDerefBytesImpl {static final int VERSION_CURRENT = VERSION_START;public static class Writer extends DerefBytesWriterBase {- public Writer(Directory dir, String id, Counter bytesUsed, IOContext context)- throws IOException {+ public Writer(Directory dir, String id, Counter bytesUsed, IOContext context) {super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, Type.BYTES_FIXED_DEREF);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedSortedBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedSortedBytesImpl.javaindex 104f82bd0de..3e18fbc1c56 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedSortedBytesImpl.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedSortedBytesImpl.java@@ -58,7 +58,7 @@ class FixedSortedBytesImpl {private final Comparator<BytesRef> comp;public Writer(Directory dir, String id, Comparator<BytesRef> comp,- Counter bytesUsed, IOContext context, float acceptableOverheadRatio) throws IOException {+ Counter bytesUsed, IOContext context, float acceptableOverheadRatio) {super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, acceptableOverheadRatio, Type.BYTES_FIXED_SORTED);this.comp = comp;}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedStraightBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedStraightBytesImpl.javaindex 2d47bd66a5b..bc072adc586 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedStraightBytesImpl.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedStraightBytesImpl.java@@ -62,12 +62,12 @@ class FixedStraightBytesImpl {private final ByteBlockPool pool;protected FixedBytesWriterBase(Directory dir, String id, String codecNameDat,- int version, Counter bytesUsed, IOContext context) throws IOException {+ int version, Counter bytesUsed, IOContext context) {this(dir, id, codecNameDat, version, bytesUsed, context, Type.BYTES_FIXED_STRAIGHT);}protected FixedBytesWriterBase(Directory dir, String id, String codecNameDat,- int version, Counter bytesUsed, IOContext context, Type type) throws IOException {+ int version, Counter bytesUsed, IOContext context, Type type) {super(dir, id, null, codecNameDat, version, bytesUsed, context, type);pool = new ByteBlockPool(new DirectTrackingAllocator(bytesUsed));pool.nextBuffer();@@ -140,11 +140,11 @@ class FixedStraightBytesImpl {private boolean hasMerged;private IndexOutput datOut;- public Writer(Directory dir, String id, Counter bytesUsed, IOContext context) throws IOException {+ public Writer(Directory dir, String id, Counter bytesUsed, IOContext context) {super(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context);}- public Writer(Directory dir, String id, String codecNameDat, int version, Counter bytesUsed, IOContext context) throws IOException {+ public Writer(Directory dir, String id, String codecNameDat, int version, Counter bytesUsed, IOContext context) {super(dir, id, codecNameDat, version, bytesUsed, context);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Floats.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Floats.javaindex b31b52bc699..c8a96fd5440 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Floats.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Floats.java@@ -47,7 +47,7 @@ public class Floats {protected static final int VERSION_CURRENT = VERSION_START;public static DocValuesConsumer getWriter(Directory dir, String id, Counter bytesUsed,- IOContext context, Type type) throws IOException {+ IOContext context, Type type) {return new FloatsWriter(dir, id, bytesUsed, context, type);}@@ -72,7 +72,7 @@ public class Floats {private final int size;private final DocValuesArraySource template;public FloatsWriter(Directory dir, String id, Counter bytesUsed,- IOContext context, Type type) throws IOException {+ IOContext context, Type type) {super(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context);size = typeToSize(type);this.bytesRef = new BytesRef(size);diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Ints.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Ints.javaindex b0f8b1631c7..2d937f6b25d 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Ints.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Ints.java@@ -46,7 +46,7 @@ public final class Ints {}public static DocValuesConsumer getWriter(Directory dir, String id, Counter bytesUsed,- Type type, IOContext context) throws IOException {+ Type type, IOContext context) {return type == Type.VAR_INTS ? new PackedIntValues.PackedIntsWriter(dir, id,bytesUsed, context) : new IntsWriter(dir, id, bytesUsed, context, type);}@@ -92,12 +92,12 @@ public final class Ints {private final DocValuesArraySource template;public IntsWriter(Directory dir, String id, Counter bytesUsed,- IOContext context, Type valueType) throws IOException {+ IOContext context, Type valueType) {this(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context, valueType);}protected IntsWriter(Directory dir, String id, String codecName,- int version, Counter bytesUsed, IOContext context, Type valueType) throws IOException {+ int version, Counter bytesUsed, IOContext context, Type valueType) {super(dir, id, codecName, version, bytesUsed, context);size = typeToSize(valueType);this.bytesRef = new BytesRef(size);diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/PackedIntValues.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/PackedIntValues.javaindex 8599c9b17b1..c40534f0af2 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/PackedIntValues.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/PackedIntValues.java@@ -57,7 +57,7 @@ class PackedIntValues {private int lastDocId = -1;protected PackedIntsWriter(Directory dir, String id, Counter bytesUsed,- IOContext context) throws IOException {+ IOContext context) {super(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context, Type.VAR_INTS);bytesRef = new BytesRef(8);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarDerefBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarDerefBytesImpl.javaindex afbb38b355b..c766a3640c1 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarDerefBytesImpl.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarDerefBytesImpl.java@@ -57,8 +57,7 @@ class VarDerefBytesImpl {* order and merge them in a streamed fashion.*/static class Writer extends DerefBytesWriterBase {- public Writer(Directory dir, String id, Counter bytesUsed, IOContext context)- throws IOException {+ public Writer(Directory dir, String id, Counter bytesUsed, IOContext context) {super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, Type.BYTES_VAR_DEREF);size = 0;}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarSortedBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarSortedBytesImpl.javaindex aab0b713b45..0cbf6b96226 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarSortedBytesImpl.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarSortedBytesImpl.java@@ -60,7 +60,7 @@ final class VarSortedBytesImpl {private final Comparator<BytesRef> comp;public Writer(Directory dir, String id, Comparator<BytesRef> comp,- Counter bytesUsed, IOContext context, float acceptableOverheadRatio) throws IOException {+ Counter bytesUsed, IOContext context, float acceptableOverheadRatio) {super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, acceptableOverheadRatio, Type.BYTES_VAR_SORTED);this.comp = comp;size = 0;diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarStraightBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarStraightBytesImpl.javaindex 52c2166bd31..ebe83e3e193 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarStraightBytesImpl.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarStraightBytesImpl.java@@ -64,8 +64,7 @@ class VarStraightBytesImpl {private final ByteBlockPool pool;private IndexOutput datOut;private boolean merge = false;- public Writer(Directory dir, String id, Counter bytesUsed, IOContext context)- throws IOException {+ public Writer(Directory dir, String id, Counter bytesUsed, IOContext context) {super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, Type.BYTES_VAR_STRAIGHT);pool = new ByteBlockPool(new DirectTrackingAllocator(bytesUsed));docToAddress = new long[1];diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Writer.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Writer.javaindex dc0354acd27..547ecb17542 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Writer.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Writer.java@@ -83,11 +83,10 @@ abstract class Writer extends DocValuesConsumer {* docvalues of type {@link Type#BYTES_FIXED_SORTED} and* {@link Type#BYTES_VAR_SORTED}.* @return a new {@link Writer} instance for the given {@link Type}- * @throws IOException* @see PackedInts#getReader(org.apache.lucene.store.DataInput, float)*/public static DocValuesConsumer create(Type type, String id, Directory directory,- Comparator<BytesRef> comp, Counter bytesUsed, IOContext context, float acceptableOverheadRatio) throws IOException {+ Comparator<BytesRef> comp, Counter bytesUsed, IOContext context, float acceptableOverheadRatio) {if (comp == null) {comp = BytesRef.getUTF8SortedAsUnicodeComparator();}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.javaindex 91c2aa57645..fb25738f8fb 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java@@ -427,7 +427,7 @@ public class MemoryPostingsFormat extends PostingsFormat {}@Override- public int freq() throws IOException {+ public int freq() {assert indexOptions != IndexOptions.DOCS_ONLY;return freq;}@@ -627,7 +627,7 @@ public class MemoryPostingsFormat extends PostingsFormat {}@Override- public int freq() throws IOException {+ public int freq() {return freq;}}@@ -647,7 +647,7 @@ public class MemoryPostingsFormat extends PostingsFormat {fstEnum = new BytesRefFSTEnum<BytesRef>(fst);}- private void decodeMetaData() throws IOException {+ private void decodeMetaData() {if (!didDecode) {buffer.reset(current.output.bytes, 0, current.output.length);docFreq = buffer.readVInt();@@ -696,7 +696,7 @@ public class MemoryPostingsFormat extends PostingsFormat {}@Override- public DocsEnum docs(Bits liveDocs, DocsEnum reuse, boolean needsFreqs) throws IOException {+ public DocsEnum docs(Bits liveDocs, DocsEnum reuse, boolean needsFreqs) {decodeMetaData();FSTDocsEnum docsEnum;@@ -714,7 +714,7 @@ public class MemoryPostingsFormat extends PostingsFormat {}@Override- public DocsAndPositionsEnum docsAndPositions(Bits liveDocs, DocsAndPositionsEnum reuse, boolean needsOffsets) throws IOException {+ public DocsAndPositionsEnum docsAndPositions(Bits liveDocs, DocsAndPositionsEnum reuse, boolean needsOffsets) {boolean hasOffsets = field.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;if (needsOffsets && !hasOffsets) {@@ -757,13 +757,13 @@ public class MemoryPostingsFormat extends PostingsFormat {}@Override- public int docFreq() throws IOException {+ public int docFreq() {decodeMetaData();return docFreq;}@Override- public long totalTermFreq() throws IOException {+ public long totalTermFreq() {decodeMetaData();return totalTermFreq;}@@ -817,17 +817,17 @@ public class MemoryPostingsFormat extends PostingsFormat {}@Override- public long getSumDocFreq() throws IOException {+ public long getSumDocFreq() {return sumDocFreq;}@Override- public int getDocCount() throws IOException {+ public int getDocCount() {return docCount;}@Override- public long size() throws IOException {+ public long size() {return termCount;}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.javaindex e0b3017d5e8..ca1b47da2a0 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java@@ -85,7 +85,7 @@ public abstract class PerFieldPostingsFormat extends PostingsFormat {private final SegmentWriteState segmentWriteState;- public FieldsWriter(SegmentWriteState state) throws IOException {+ public FieldsWriter(SegmentWriteState state) {segmentWriteState = state;}@@ -206,7 +206,7 @@ public abstract class PerFieldPostingsFormat extends PostingsFormat {}@Override- public String next() throws IOException {+ public String next() {if (it.hasNext()) {current = it.next();} else {diff --git a/lucene/core/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsReader.javaindex 79cfbb793c1..e805e77f1a8 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsReader.java@@ -52,7 +52,7 @@ public class PulsingPostingsReader extends PostingsReaderBase {final PostingsReaderBase wrappedPostingsReader;int maxPositions;- public PulsingPostingsReader(PostingsReaderBase wrappedPostingsReader) throws IOException {+ public PulsingPostingsReader(PostingsReaderBase wrappedPostingsReader) {this.wrappedPostingsReader = wrappedPostingsReader;}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.javaindex c4c7b4fa5fa..32afac2b08e 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java@@ -92,7 +92,7 @@ public final class PulsingPostingsWriter extends PostingsWriterBase {/** If the total number of positions (summed across all docs* for this term) is <= maxPositions, then the postings are* inlined into terms dict */- public PulsingPostingsWriter(int maxPositions, PostingsWriterBase wrappedPostingsWriter) throws IOException {+ public PulsingPostingsWriter(int maxPositions, PostingsWriterBase wrappedPostingsWriter) {pending = new Position[maxPositions];for(int i=0;i<maxPositions;i++) {pending[i] = new Position();diff --git a/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.javaindex c8586444393..d5dbb4e4494 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java@@ -17,8 +17,6 @@ package org.apache.lucene.codecs.sep;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.codecs.lucene40.values.DocValuesWriterBase;import org.apache.lucene.index.PerDocWriteState;import org.apache.lucene.store.Directory;@@ -31,7 +29,7 @@ import org.apache.lucene.store.Directory;public class SepDocValuesConsumer extends DocValuesWriterBase {private final Directory directory;- public SepDocValuesConsumer(PerDocWriteState state) throws IOException {+ public SepDocValuesConsumer(PerDocWriteState state) {super(state);this.directory = state.directory;}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsReader.javaindex 3267fc17978..7d829c3aa95 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsReader.java@@ -105,7 +105,7 @@ class SimpleTextFieldsReader extends FieldsProducer {private boolean ended;private final BytesRefFSTEnum<PairOutputs.Pair<Long,PairOutputs.Pair<Long,Long>>> fstEnum;- public SimpleTextTermsEnum(FST<PairOutputs.Pair<Long,PairOutputs.Pair<Long,Long>>> fst, IndexOptions indexOptions) throws IOException {+ public SimpleTextTermsEnum(FST<PairOutputs.Pair<Long,PairOutputs.Pair<Long,Long>>> fst, IndexOptions indexOptions) {this.indexOptions = indexOptions;fstEnum = new BytesRefFSTEnum<PairOutputs.Pair<Long,PairOutputs.Pair<Long,Long>>>(fst);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextLiveDocsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextLiveDocsFormat.javaindex 56b0fbb5f6d..4d9007d35cb 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextLiveDocsFormat.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextLiveDocsFormat.java@@ -99,7 +99,7 @@ public class SimpleTextLiveDocsFormat extends LiveDocsFormat {}}- private int parseIntAt(BytesRef bytes, int offset, CharsRef scratch) throws IOException {+ private int parseIntAt(BytesRef bytes, int offset, CharsRef scratch) {UnicodeUtil.UTF8toUTF16(bytes.bytes, bytes.offset+offset, bytes.length-offset, scratch);return ArrayUtil.parseInt(scratch.chars, 0, scratch.length);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextNormsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextNormsFormat.javaindex c926bf73f52..5ba5f745dc7 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextNormsFormat.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextNormsFormat.java@@ -95,8 +95,7 @@ public class SimpleTextNormsFormat extends NormsFormat {public static class SimpleTextNormsPerDocConsumer extendsSimpleTextPerDocConsumer {- public SimpleTextNormsPerDocConsumer(PerDocWriteState state)- throws IOException {+ public SimpleTextNormsPerDocConsumer(PerDocWriteState state) {super(state, NORMS_SEG_SUFFIX);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocConsumer.javaindex d437fc6abc5..d95e09bbd69 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocConsumer.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocConsumer.java@@ -32,8 +32,7 @@ class SimpleTextPerDocConsumer extends PerDocConsumer {protected final PerDocWriteState state;protected final String segmentSuffix;- public SimpleTextPerDocConsumer(PerDocWriteState state, String segmentSuffix)- throws IOException {+ public SimpleTextPerDocConsumer(PerDocWriteState state, String segmentSuffix) {this.state = state;this.segmentSuffix = segmentSuffix;}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsReader.javaindex 62b5d18fcd3..dd18138db82 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsReader.java@@ -21,7 +21,6 @@ import java.io.IOException;import java.util.ArrayList;import org.apache.lucene.codecs.StoredFieldsReader;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.FieldInfo;import org.apache.lucene.index.FieldInfos;import org.apache.lucene.index.IndexFileNames;@@ -88,7 +87,7 @@ public class SimpleTextStoredFieldsReader extends StoredFieldsReader {}@Override- public void visitDocument(int n, StoredFieldVisitor visitor) throws CorruptIndexException, IOException {+ public void visitDocument(int n, StoredFieldVisitor visitor) throws IOException {in.seek(offsets.get(n));readLine();assert StringHelper.startsWith(scratch, NUM);@@ -181,7 +180,7 @@ public class SimpleTextStoredFieldsReader extends StoredFieldsReader {SimpleTextUtil.readLine(in, scratch);}- private int parseIntAt(int offset) throws IOException {+ private int parseIntAt(int offset) {UnicodeUtil.UTF8toUTF16(scratch.bytes, scratch.offset+offset, scratch.length-offset, scratchUTF16);return ArrayUtil.parseInt(scratchUTF16.chars, 0, scratchUTF16.length);}diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextTermVectorsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextTermVectorsReader.javaindex cccb7125f56..5fc92d6662f 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextTermVectorsReader.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextTermVectorsReader.java@@ -204,7 +204,7 @@ public class SimpleTextTermVectorsReader extends TermVectorsReader {SimpleTextUtil.readLine(in, scratch);}- private int parseIntAt(int offset) throws IOException {+ private int parseIntAt(int offset) {UnicodeUtil.UTF8toUTF16(scratch.bytes, scratch.offset+offset, scratch.length-offset, scratchUTF16);return ArrayUtil.parseInt(scratchUTF16.chars, 0, scratchUTF16.length);}@@ -217,7 +217,7 @@ public class SimpleTextTermVectorsReader extends TermVectorsReader {private class SimpleTVFields extends Fields {private final SortedMap<String,SimpleTVTerms> fields;- SimpleTVFields(SortedMap<String,SimpleTVTerms> fields) throws IOException {+ SimpleTVFields(SortedMap<String,SimpleTVTerms> fields) {this.fields = fields;}@@ -228,7 +228,7 @@ public class SimpleTextTermVectorsReader extends TermVectorsReader {private Map.Entry<String,SimpleTVTerms> current = null;@Override- public String next() throws IOException {+ public String next() {if (!iterator.hasNext()) {return null;} else {@@ -238,7 +238,7 @@ public class SimpleTextTermVectorsReader extends TermVectorsReader {}@Override- public Terms terms() throws IOException {+ public Terms terms() {return current.getValue();}};diff --git a/lucene/core/src/java/org/apache/lucene/document/Field.java b/lucene/core/src/java/org/apache/lucene/document/Field.javaindex 38300849440..47cd3e44f27 100644--- a/lucene/core/src/java/org/apache/lucene/document/Field.java+++ b/lucene/core/src/java/org/apache/lucene/document/Field.java@@ -469,7 +469,7 @@ public class Field implements IndexableField {boolean used;@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (used) {return false;}@@ -480,7 +480,7 @@ public class Field implements IndexableField {}@Override- public void reset() throws IOException {+ public void reset() {used = false;}};diff --git a/lucene/core/src/java/org/apache/lucene/index/AutomatonTermsEnum.java b/lucene/core/src/java/org/apache/lucene/index/AutomatonTermsEnum.javaindex beb74b4319f..980fce8139a 100644--- a/lucene/core/src/java/org/apache/lucene/index/AutomatonTermsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/index/AutomatonTermsEnum.java@@ -75,7 +75,7 @@ class AutomatonTermsEnum extends FilteredTermsEnum {* <p>* @param compiled CompiledAutomaton*/- public AutomatonTermsEnum(TermsEnum tenum, CompiledAutomaton compiled) throws IOException {+ public AutomatonTermsEnum(TermsEnum tenum, CompiledAutomaton compiled) {super(tenum);this.finite = compiled.finite;this.runAutomaton = compiled.runAutomaton;diff --git a/lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java b/lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.javaindex 4b54c829cb4..ddd07815a7f 100644--- a/lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java@@ -67,7 +67,7 @@ public abstract class BaseCompositeReader<R extends IndexReader> extends Composi* cloned and not protected for modification, the subclass is responsible* to do this.*/- protected BaseCompositeReader(R[] subReaders) throws IOException {+ protected BaseCompositeReader(R[] subReaders) {this.subReaders = subReaders;this.subReadersList = Collections.unmodifiableList(Arrays.asList(subReaders));starts = new int[subReaders.length + 1]; // build starts array@@ -112,7 +112,7 @@ public abstract class BaseCompositeReader<R extends IndexReader> extends Composi}@Override- public final void document(int docID, StoredFieldVisitor visitor) throws CorruptIndexException, IOException {+ public final void document(int docID, StoredFieldVisitor visitor) throws IOException {ensureOpen();final int i = readerIndex(docID); // find subreader numsubReaders[i].document(docID - starts[i], visitor); // dispatch to subreaderdiff --git a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.javaindex d97e9cd0649..05aa9b4d6bd 100644--- a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java+++ b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java@@ -398,7 +398,7 @@ public class ConcurrentMergeScheduler extends MergeScheduler {MergePolicy.OneMerge runningMerge;private volatile boolean done;- public MergeThread(IndexWriter writer, MergePolicy.OneMerge startMerge) throws IOException {+ public MergeThread(IndexWriter writer, MergePolicy.OneMerge startMerge) {this.tWriter = writer;this.startMerge = startMerge;}diff --git a/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.javaindex 2a15ac3e6d1..328ee47e375 100644--- a/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java@@ -56,10 +56,9 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>/** Returns a IndexReader reading the index in the given* Directory* @param directory the index directory- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public static DirectoryReader open(final Directory directory) throws CorruptIndexException, IOException {+ public static DirectoryReader open(final Directory directory) throws IOException {return StandardDirectoryReader.open(directory, null, DEFAULT_TERMS_INDEX_DIVISOR);}@@ -76,10 +75,9 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>* memory usage, at the expense of higher latency when* loading a TermInfo. The default value is 1. Set this* to -1 to skip loading the terms index entirely.- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public static DirectoryReader open(final Directory directory, int termInfosIndexDivisor) throws CorruptIndexException, IOException {+ public static DirectoryReader open(final Directory directory, int termInfosIndexDivisor) throws IOException {return StandardDirectoryReader.open(directory, null, termInfosIndexDivisor);}@@ -102,17 +100,16 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>** @lucene.experimental*/- public static DirectoryReader open(final IndexWriter writer, boolean applyAllDeletes) throws CorruptIndexException, IOException {+ public static DirectoryReader open(final IndexWriter writer, boolean applyAllDeletes) throws IOException {return writer.getReader(applyAllDeletes);}/** Expert: returns an IndexReader reading the index in the given* {@link IndexCommit}.* @param commit the commit point to open- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public static DirectoryReader open(final IndexCommit commit) throws CorruptIndexException, IOException {+ public static DirectoryReader open(final IndexCommit commit) throws IOException {return StandardDirectoryReader.open(commit.getDirectory(), commit, DEFAULT_TERMS_INDEX_DIVISOR);}@@ -129,10 +126,9 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>* memory usage, at the expense of higher latency when* loading a TermInfo. The default value is 1. Set this* to -1 to skip loading the terms index entirely.- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public static DirectoryReader open(final IndexCommit commit, int termInfosIndexDivisor) throws CorruptIndexException, IOException {+ public static DirectoryReader open(final IndexCommit commit, int termInfosIndexDivisor) throws IOException {return StandardDirectoryReader.open(commit.getDirectory(), commit, termInfosIndexDivisor);}@@ -311,9 +307,8 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>* Returns <code>true</code> if an index exists at the specified directory.* @param directory the directory to check for an index* @return <code>true</code> if an index exists; <code>false</code> otherwise- * @throws IOException if there is a problem with accessing the index*/- public static boolean indexExists(Directory directory) throws IOException {+ public static boolean indexExists(Directory directory) {try {new SegmentInfos().read(directory);return true;@@ -331,7 +326,7 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>* Subclasses of {@code DirectoryReader} should take care to not allow* modification of this internal array, e.g. {@link #doOpenIfChanged()}.*/- protected DirectoryReader(Directory directory, AtomicReader[] segmentReaders) throws CorruptIndexException, IOException {+ protected DirectoryReader(Directory directory, AtomicReader[] segmentReaders) {super(segmentReaders);this.directory = directory;}@@ -348,32 +343,29 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>* If this reader does not support reopen, return {@code null}, so* client code is happy. This should be consistent with {@link #isCurrent}* (should always return {@code true}) if reopen is not supported.- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error* @return null if there are no changes; else, a new* DirectoryReader instance.*/- protected abstract DirectoryReader doOpenIfChanged() throws CorruptIndexException, IOException;+ protected abstract DirectoryReader doOpenIfChanged() throws IOException;/** Implement this method to support {@link #openIfChanged(DirectoryReader,IndexCommit)}.* If this reader does not support reopen from a specific {@link IndexCommit},* throw {@link UnsupportedOperationException}.- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error* @return null if there are no changes; else, a new* DirectoryReader instance.*/- protected abstract DirectoryReader doOpenIfChanged(final IndexCommit commit) throws CorruptIndexException, IOException;+ protected abstract DirectoryReader doOpenIfChanged(final IndexCommit commit) throws IOException;/** Implement this method to support {@link #openIfChanged(DirectoryReader,IndexWriter,boolean)}.* If this reader does not support reopen from {@link IndexWriter},* throw {@link UnsupportedOperationException}.- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error* @return null if there are no changes; else, a new* DirectoryReader instance.*/- protected abstract DirectoryReader doOpenIfChanged(IndexWriter writer, boolean applyAllDeletes) throws CorruptIndexException, IOException;+ protected abstract DirectoryReader doOpenIfChanged(IndexWriter writer, boolean applyAllDeletes) throws IOException;/*** Version number when this IndexReader was opened.@@ -407,16 +399,15 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>* {@link #openIfChanged} to get a new reader that sees the* changes.</p>*- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public abstract boolean isCurrent() throws CorruptIndexException, IOException;+ public abstract boolean isCurrent() throws IOException;/*** Expert: return the IndexCommit that this reader has opened.* <p/>* @lucene.experimental*/- public abstract IndexCommit getIndexCommit() throws CorruptIndexException, IOException;+ public abstract IndexCommit getIndexCommit() throws IOException;}diff --git a/lucene/core/src/java/org/apache/lucene/index/DocTermOrds.java b/lucene/core/src/java/org/apache/lucene/index/DocTermOrds.javaindex ddd281e7095..b84a95f6705 100644--- a/lucene/core/src/java/org/apache/lucene/index/DocTermOrds.java+++ b/lucene/core/src/java/org/apache/lucene/index/DocTermOrds.java@@ -175,7 +175,7 @@ public class DocTermOrds {/** Subclass inits w/ this, but be sure you then call* uninvert, only once */- protected DocTermOrds(String field, int maxTermDocFreq, int indexIntervalBits) throws IOException {+ protected DocTermOrds(String field, int maxTermDocFreq, int indexIntervalBits) {//System.out.println("DTO init field=" + field + " maxTDFreq=" + maxTermDocFreq);this.field = field;this.maxTermDocFreq = maxTermDocFreq;@@ -703,7 +703,7 @@ public class DocTermOrds {}@Override- public long ord() throws IOException {+ public long ord() {return ordBase + ord;}diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.javaindex 1eec53c3a2d..b66e088a039 100644--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java@@ -134,7 +134,7 @@ final class DocumentsWriter {final Codec codec;DocumentsWriter(Codec codec, LiveIndexWriterConfig config, Directory directory, IndexWriter writer, FieldNumbers globalFieldNumbers,- BufferedDeletesStream bufferedDeletesStream) throws IOException {+ BufferedDeletesStream bufferedDeletesStream) {this.codec = codec;this.directory = directory;this.indexWriter = writer;@@ -200,7 +200,7 @@ final class DocumentsWriter {* updating the index files) and must discard all* currently buffered docs. This resets our state,* discarding any docs added since last flush. */- synchronized void abort() throws IOException {+ synchronized void abort() {boolean success = false;synchronized (this) {deleteQueue.clear();@@ -219,8 +219,6 @@ final class DocumentsWriter {if (perThread.isActive()) { // we might be closedtry {perThread.dwpt.abort();- } catch (IOException ex) {- // continue} finally {perThread.dwpt.checkAndResetHasAborted();flushControl.doOnAbort(perThread);@@ -276,7 +274,7 @@ final class DocumentsWriter {flushControl.setClosed();}- private boolean preUpdate() throws CorruptIndexException, IOException {+ private boolean preUpdate() throws IOException {ensureOpen();boolean maybeMerge = false;if (flushControl.anyStalledThreads() || flushControl.numQueuedFlushes() > 0) {@@ -325,7 +323,7 @@ final class DocumentsWriter {}boolean updateDocuments(final Iterable<? extends Iterable<? extends IndexableField>> docs, final Analyzer analyzer,- final Term delTerm) throws CorruptIndexException, IOException {+ final Term delTerm) throws IOException {boolean maybeMerge = preUpdate();final ThreadState perThread = flushControl.obtainAndLock();@@ -356,7 +354,7 @@ final class DocumentsWriter {}boolean updateDocument(final Iterable<? extends IndexableField> doc, final Analyzer analyzer,- final Term delTerm) throws CorruptIndexException, IOException {+ final Term delTerm) throws IOException {boolean maybeMerge = preUpdate();diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.javaindex a7c16779a54..00053403588 100644--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java@@ -16,7 +16,7 @@ package org.apache.lucene.index;* See the License for the specific language governing permissions and* limitations under the License.*/-import java.io.IOException;+import java.util.ArrayList;import java.util.IdentityHashMap;import java.util.List;@@ -570,21 +570,13 @@ final class DocumentsWriterFlushControl {try {for (DocumentsWriterPerThread dwpt : flushQueue) {doAfterFlush(dwpt);- try {- dwpt.abort();- } catch (IOException ex) {- // continue- }+ dwpt.abort();}for (BlockedFlush blockedFlush : blockedFlushes) {flushingWriters.put(blockedFlush.dwpt, Long.valueOf(blockedFlush.bytes));doAfterFlush(blockedFlush.dwpt);- try {- blockedFlush.dwpt.abort();- } catch (IOException ex) {- // continue- }+ blockedFlush.dwpt.abort();}} finally {fullFlush = false;diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.javaindex ac0eedd8574..ec393366a22 100644--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java@@ -135,7 +135,7 @@ class DocumentsWriterPerThread {* updating the index files) and must discard all* currently buffered docs. This resets our state,* discarding any docs added since last flush. */- void abort() throws IOException {+ void abort() {hasAborted = aborting = true;try {if (infoStream.isEnabled("DWPT")) {@@ -352,7 +352,7 @@ class DocumentsWriterPerThread {return docCount;}- private void finishDocument(Term delTerm) throws IOException {+ private void finishDocument(Term delTerm) {/** here we actually finish the document in two steps 1. push the delete into* the queue and update our slice. 2. increment the DWPT private document@@ -412,7 +412,7 @@ class DocumentsWriterPerThread {}/** Reset after a flush */- private void doAfterFlush() throws IOException {+ private void doAfterFlush() {segmentInfo = null;consumer.doAfterFlush();directory.getCreatedFiles().clear();diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterAtomicReader.java b/lucene/core/src/java/org/apache/lucene/index/FilterAtomicReader.javaindex e569575732d..866a00755ee 100644--- a/lucene/core/src/java/org/apache/lucene/index/FilterAtomicReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/FilterAtomicReader.java@@ -348,7 +348,7 @@ public class FilterAtomicReader extends AtomicReader {}@Override- public void document(int docID, StoredFieldVisitor visitor) throws CorruptIndexException, IOException {+ public void document(int docID, StoredFieldVisitor visitor) throws IOException {ensureOpen();in.document(docID, visitor);}diff --git a/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java b/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.javaindex 836fbbec220..13532bc96b2 100644--- a/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java@@ -82,7 +82,7 @@ public abstract class FilteredTermsEnum extends TermsEnum {* <P>You can only use this method, if you keep the default* implementation of {@link #nextSeekTerm}.*/- protected final void setInitialSeekTerm(BytesRef term) throws IOException {+ protected final void setInitialSeekTerm(BytesRef term) {this.initialSeekTerm = term;}diff --git a/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriter.java b/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriter.javaindex ad5e5c489cb..75eeaedbf1c 100644--- a/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriter.java+++ b/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriter.java@@ -114,10 +114,10 @@ final class FreqProxTermsWriter extends TermsHashConsumer {}@Override- void finishDocument(TermsHash termsHash) throws IOException {+ void finishDocument(TermsHash termsHash) {}@Override- void startDocument() throws IOException {+ void startDocument() {}}diff --git a/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java b/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.javaindex f6ce4beec81..425f158afce 100644--- a/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java+++ b/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java@@ -76,7 +76,7 @@ final class FreqProxTermsWriterPerField extends TermsHashConsumerPerField implemboolean hasPayloads;@Override- void skippingLongTerm() throws IOException {}+ void skippingLongTerm() {}public int compareTo(FreqProxTermsWriterPerField other) {return fieldInfo.name.compareTo(other.fieldInfo.name);@@ -326,7 +326,7 @@ final class FreqProxTermsWriterPerField extends TermsHashConsumerPerField implem* instances) found in this field and serialize them* into a single RAM segment. */void flush(String fieldName, FieldsConsumer consumer, final SegmentWriteState state)- throws CorruptIndexException, IOException {+ throws IOException {if (!fieldInfo.isIndexed()) {return; // nothing to flush, don't bother the codec with the unindexed fielddiff --git a/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java b/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.javaindex 79fe279c678..4447472779c 100644--- a/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java+++ b/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java@@ -118,11 +118,10 @@ final class IndexFileDeleter {* the Directory, incref the files they reference, call* the policy to let it delete commits. This will remove* any files not referenced by any of the commits.- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/public IndexFileDeleter(Directory directory, IndexDeletionPolicy policy, SegmentInfos segmentInfos,- InfoStream infoStream, IndexWriter writer) throws CorruptIndexException, IOException {+ InfoStream infoStream, IndexWriter writer) throws IOException {this.infoStream = infoStream;this.writer = writer;@@ -469,14 +468,14 @@ final class IndexFileDeleter {}}- void incRef(Collection<String> files) throws IOException {+ void incRef(Collection<String> files) {assert locked();for(final String file : files) {incRef(file);}}- void incRef(String fileName) throws IOException {+ void incRef(String fileName) {assert locked();RefCount rc = getRefCount(fileName);if (infoStream.isEnabled("IFD")) {@@ -661,7 +660,7 @@ final class IndexFileDeleter {}@Override- public Collection<String> getFileNames() throws IOException {+ public Collection<String> getFileNames() {return files;}diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexReader.java b/lucene/core/src/java/org/apache/lucene/index/IndexReader.javaindex 13b5f4c2462..21888482816 100644--- a/lucene/core/src/java/org/apache/lucene/index/IndexReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/IndexReader.java@@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicInteger;import org.apache.lucene.document.Document;import org.apache.lucene.document.DocumentStoredFieldVisitor;import org.apache.lucene.search.SearcherManager; // javadocs-import org.apache.lucene.store.*;+import org.apache.lucene.store.AlreadyClosedException;import org.apache.lucene.util.Bits;import org.apache.lucene.util.BytesRef;@@ -316,7 +316,7 @@ public abstract class IndexReader implements Closeable {* simply want to load all fields, use {@link* #document(int)}. If you want to load a subset, use* {@link DocumentStoredFieldVisitor}. */- public abstract void document(int docID, StoredFieldVisitor visitor) throws CorruptIndexException, IOException;+ public abstract void document(int docID, StoredFieldVisitor visitor) throws IOException;/*** Returns the stored fields of the <code>n</code><sup>th</sup>@@ -340,7 +340,7 @@ public abstract class IndexReader implements Closeable {// TODO: we need a separate StoredField, so that the// Document returned here contains that class not// IndexableField- public final Document document(int docID) throws CorruptIndexException, IOException {+ public final Document document(int docID) throws IOException {final DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor();document(docID, visitor);return visitor.getDocument();@@ -351,7 +351,7 @@ public abstract class IndexReader implements Closeable {* fields. Note that this is simply sugar for {@link* DocumentStoredFieldVisitor#DocumentStoredFieldVisitor(Set)}.*/- public final Document document(int docID, Set<String> fieldsToLoad) throws CorruptIndexException, IOException {+ public final Document document(int docID, Set<String> fieldsToLoad) throws IOException {final DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor(fieldsToLoad);document(docID, visitor);return visitor.getDocument();diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.javaindex 30e8598a18b..90c35b3d084 100644--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java@@ -498,7 +498,6 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* Obtain a ReadersAndLiveDocs instance from the* readerPool. If create is true, you must later call* {@link #release(ReadersAndLiveDocs)}.- * @throws IOException*/public synchronized ReadersAndLiveDocs get(SegmentInfoPerCommit info, boolean create) {@@ -530,7 +529,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* If the reader isn't being pooled, the segmentInfo's* delCount is returned.*/- public int numDeletedDocs(SegmentInfoPerCommit info) throws IOException {+ public int numDeletedDocs(SegmentInfoPerCommit info) {ensureOpen(false);int delCount = info.getDelCount();@@ -572,19 +571,13 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @param conf* the configuration settings according to which IndexWriter should* be initialized.- * @throws CorruptIndexException- * if the index is corrupt- * @throws LockObtainFailedException- * if another writer has this index open (<code>write.lock</code>- * could not be obtained)* @throws IOException* if the directory cannot be read/written to, or if it does not* exist and <code>conf.getOpenMode()</code> is* <code>OpenMode.APPEND</code> or if there is any other low-level* IO error*/- public IndexWriter(Directory d, IndexWriterConfig conf)- throws CorruptIndexException, LockObtainFailedException, IOException {+ public IndexWriter(Directory d, IndexWriterConfig conf) throws IOException {config = new LiveIndexWriterConfig(conf.clone());directory = d;analyzer = config.getAnalyzer();@@ -760,7 +753,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {return config;}- private void messageState() throws IOException {+ private void messageState() {if (infoStream.isEnabled("IW")) {infoStream.message("IW", "\ndir=" + directory + "\n" +"index=" + segString() + "\n" +@@ -808,10 +801,9 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* you should immediately close the writer, again. See <a* href="#OOME">above</a> for details.</p>*- * @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void close() throws CorruptIndexException, IOException {+ public void close() throws IOException {close(true);}@@ -838,7 +830,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* finished (which should be at most a few seconds), and* then return.*/- public void close(boolean waitForMerges) throws CorruptIndexException, IOException {+ public void close(boolean waitForMerges) throws IOException {// Ensure that only one thread actually gets to do the// closing, and make sure no commit is also in progress:@@ -877,7 +869,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {}}- private void closeInternal(boolean waitForMerges, boolean doFlush) throws CorruptIndexException, IOException {+ private void closeInternal(boolean waitForMerges, boolean doFlush) throws IOException {try {@@ -987,7 +979,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* are not counted. If you really need these to be* counted you should call {@link #commit()} first.* @see #numDocs */- public synchronized int numDocs() throws IOException {+ public synchronized int numDocs() {ensureOpen();int count;if (docWriter != null)@@ -1001,7 +993,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {return count;}- public synchronized boolean hasDeletions() throws IOException {+ public synchronized boolean hasDeletions() {ensureOpen();if (bufferedDeletesStream.any()) {return true;@@ -1059,7 +1051,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void addDocument(Iterable<? extends IndexableField> doc) throws CorruptIndexException, IOException {+ public void addDocument(Iterable<? extends IndexableField> doc) throws IOException {addDocument(doc, analyzer);}@@ -1078,7 +1070,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void addDocument(Iterable<? extends IndexableField> doc, Analyzer analyzer) throws CorruptIndexException, IOException {+ public void addDocument(Iterable<? extends IndexableField> doc, Analyzer analyzer) throws IOException {updateDocument(null, doc, analyzer);}@@ -1123,7 +1115,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {** @lucene.experimental*/- public void addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs) throws CorruptIndexException, IOException {+ public void addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException {addDocuments(docs, analyzer);}@@ -1138,7 +1130,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {** @lucene.experimental*/- public void addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer analyzer) throws CorruptIndexException, IOException {+ public void addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer analyzer) throws IOException {updateDocuments(null, docs, analyzer);}@@ -1155,7 +1147,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {** @lucene.experimental*/- public void updateDocuments(Term delTerm, Iterable<? extends Iterable<? extends IndexableField>> docs) throws CorruptIndexException, IOException {+ public void updateDocuments(Term delTerm, Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException {updateDocuments(delTerm, docs, analyzer);}@@ -1173,7 +1165,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {** @lucene.experimental*/- public void updateDocuments(Term delTerm, Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer analyzer) throws CorruptIndexException, IOException {+ public void updateDocuments(Term delTerm, Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer analyzer) throws IOException {ensureOpen();try {boolean success = false;@@ -1207,7 +1199,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void deleteDocuments(Term term) throws CorruptIndexException, IOException {+ public void deleteDocuments(Term term) throws IOException {ensureOpen();try {docWriter.deleteTerms(term);@@ -1230,7 +1222,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void deleteDocuments(Term... terms) throws CorruptIndexException, IOException {+ public void deleteDocuments(Term... terms) throws IOException {ensureOpen();try {docWriter.deleteTerms(terms);@@ -1250,7 +1242,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void deleteDocuments(Query query) throws CorruptIndexException, IOException {+ public void deleteDocuments(Query query) throws IOException {ensureOpen();try {docWriter.deleteQueries(query);@@ -1272,7 +1264,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void deleteDocuments(Query... queries) throws CorruptIndexException, IOException {+ public void deleteDocuments(Query... queries) throws IOException {ensureOpen();try {docWriter.deleteQueries(queries);@@ -1298,7 +1290,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void updateDocument(Term term, Iterable<? extends IndexableField> doc) throws CorruptIndexException, IOException {+ public void updateDocument(Term term, Iterable<? extends IndexableField> doc) throws IOException {ensureOpen();updateDocument(term, doc, getAnalyzer());}@@ -1322,7 +1314,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws IOException if there is a low-level IO error*/public void updateDocument(Term term, Iterable<? extends IndexableField> doc, Analyzer analyzer)- throws CorruptIndexException, IOException {+ throws IOException {ensureOpen();try {boolean success = false;@@ -1463,7 +1455,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @param maxNumSegments maximum number of segments left* in the index after merging finishes*/- public void forceMerge(int maxNumSegments) throws CorruptIndexException, IOException {+ public void forceMerge(int maxNumSegments) throws IOException {forceMerge(maxNumSegments, true);}@@ -1477,7 +1469,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* you should immediately close the writer. See <a* href="#OOME">above</a> for details.</p>*/- public void forceMerge(int maxNumSegments, boolean doWait) throws CorruptIndexException, IOException {+ public void forceMerge(int maxNumSegments, boolean doWait) throws IOException {ensureOpen();if (maxNumSegments < 1)@@ -1588,7 +1580,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* {@link MergePolicy.MergeAbortedException}.*/public void forceMergeDeletes(boolean doWait)- throws CorruptIndexException, IOException {+ throws IOException {ensureOpen();flush(true, true);@@ -1673,7 +1665,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* you should immediately close the writer. See <a* href="#OOME">above</a> for details.</p>*/- public void forceMergeDeletes() throws CorruptIndexException, IOException {+ public void forceMergeDeletes() throws IOException {forceMergeDeletes(true);}@@ -1691,18 +1683,18 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* you should immediately close the writer. See <a* href="#OOME">above</a> for details.</p>*/- public final void maybeMerge() throws CorruptIndexException, IOException {+ public final void maybeMerge() throws IOException {maybeMerge(-1);}- private final void maybeMerge(int maxNumSegments) throws CorruptIndexException, IOException {+ private final void maybeMerge(int maxNumSegments) throws IOException {ensureOpen(false);updatePendingMerges(maxNumSegments);mergeScheduler.merge(this);}private synchronized void updatePendingMerges(int maxNumSegments)- throws CorruptIndexException, IOException {+ throws IOException {assert maxNumSegments == -1 || maxNumSegments > 0;if (stopMerges) {@@ -1920,7 +1912,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {}}- private synchronized void finishMerges(boolean waitForMerges) throws IOException {+ private synchronized void finishMerges(boolean waitForMerges) {if (!waitForMerges) {stopMerges = true;@@ -2086,7 +2078,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {return newSegment;}- synchronized void publishFrozenDeletes(FrozenBufferedDeletes packet) throws IOException {+ synchronized void publishFrozenDeletes(FrozenBufferedDeletes packet) {assert packet != null && packet.any();synchronized (bufferedDeletesStream) {bufferedDeletesStream.push(packet);@@ -2195,7 +2187,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public void addIndexes(Directory... dirs) throws CorruptIndexException, IOException {+ public void addIndexes(Directory... dirs) throws IOException {ensureOpen();noDupDirs(dirs);@@ -2279,7 +2271,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @throws IOException* if there is a low-level IO error*/- public void addIndexes(IndexReader... readers) throws CorruptIndexException, IOException {+ public void addIndexes(IndexReader... readers) throws IOException {ensureOpen();int numDocs = 0;@@ -2467,7 +2459,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* href="#OOME">above</a> for details.</p>** @see #prepareCommit(Map) */- public final void prepareCommit() throws CorruptIndexException, IOException {+ public final void prepareCommit() throws IOException {ensureOpen();prepareCommit(null);}@@ -2502,7 +2494,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* only "stick" if there are actually changes in the* index to commit.*/- public final void prepareCommit(Map<String,String> commitUserData) throws CorruptIndexException, IOException {+ public final void prepareCommit(Map<String,String> commitUserData) throws IOException {ensureOpen(false);synchronized(commitLock) {@@ -2633,7 +2625,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* @see #prepareCommit* @see #commit(Map)*/- public final void commit() throws CorruptIndexException, IOException {+ public final void commit() throws IOException {commit(null);}@@ -2646,14 +2638,14 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* you should immediately close the writer. See <a* href="#OOME">above</a> for details.</p>*/- public final void commit(Map<String,String> commitUserData) throws CorruptIndexException, IOException {+ public final void commit(Map<String,String> commitUserData) throws IOException {ensureOpen();commitInternal(commitUserData);}- private final void commitInternal(Map<String,String> commitUserData) throws CorruptIndexException, IOException {+ private final void commitInternal(Map<String,String> commitUserData) throws IOException {if (infoStream.isEnabled("IW")) {infoStream.message("IW", "commit: start");@@ -2681,7 +2673,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {}}- private synchronized final void finishCommit() throws CorruptIndexException, IOException {+ private synchronized final void finishCommit() throws IOException {if (pendingCommit != null) {try {@@ -2727,7 +2719,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* deletes or docs were flushed) if necessary* @param applyAllDeletes whether pending deletes should also*/- protected final void flush(boolean triggerMerge, boolean applyAllDeletes) throws CorruptIndexException, IOException {+ protected final void flush(boolean triggerMerge, boolean applyAllDeletes) throws IOException {// NOTE: this method cannot be sync'd because// maybeMerge() in turn calls mergeScheduler.merge which@@ -2743,7 +2735,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {}}- private boolean doFlush(boolean applyAllDeletes) throws CorruptIndexException, IOException {+ private boolean doFlush(boolean applyAllDeletes) throws IOException {if (hitOOM) {throw new IllegalStateException("this writer hit an OutOfMemoryError; cannot flush");}@@ -2850,7 +2842,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {return docWriter.getNumDocs();}- private synchronized void ensureValidMerge(MergePolicy.OneMerge merge) throws IOException {+ private synchronized void ensureValidMerge(MergePolicy.OneMerge merge) {for(SegmentInfoPerCommit info : merge.segments) {if (!segmentInfos.contains(info)) {throw new MergePolicy.MergeException("MergePolicy selected a segment (" + info.info.name + ") that is not in the current index " + segString(), directory);@@ -3110,8 +3102,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {** @lucene.experimental*/- public void merge(MergePolicy.OneMerge merge)- throws CorruptIndexException, IOException {+ public void merge(MergePolicy.OneMerge merge) throws IOException {boolean success = false;@@ -3173,7 +3164,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {* are now participating in a merge, and true is* returned. Else (the merge conflicts) false is* returned. */- final synchronized boolean registerMerge(MergePolicy.OneMerge merge) throws MergePolicy.MergeAbortedException, IOException {+ final synchronized boolean registerMerge(MergePolicy.OneMerge merge) throws IOException {if (merge.registerDone) {return true;@@ -3356,7 +3347,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {/** Does fininishing for a merge, which is fast but holds* the synchronized lock on IndexWriter instance. */- final synchronized void mergeFinish(MergePolicy.OneMerge merge) throws IOException {+ final synchronized void mergeFinish(MergePolicy.OneMerge merge) {// forceMerge, addIndexes or finishMerges may be waiting// on merges to finish.@@ -3417,8 +3408,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {/** Does the actual (time-consuming) work of the merge,* but without holding synchronized lock on IndexWriter* instance */- private int mergeMiddle(MergePolicy.OneMerge merge)- throws CorruptIndexException, IOException {+ private int mergeMiddle(MergePolicy.OneMerge merge) throws IOException {merge.checkAborted(directory);@@ -3660,12 +3650,12 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {}/** @lucene.internal */- public synchronized String segString() throws IOException {+ public synchronized String segString() {return segString(segmentInfos);}/** @lucene.internal */- public synchronized String segString(Iterable<SegmentInfoPerCommit> infos) throws IOException {+ public synchronized String segString(Iterable<SegmentInfoPerCommit> infos) {final StringBuilder buffer = new StringBuilder();for(final SegmentInfoPerCommit info : infos) {if (buffer.length() > 0) {@@ -3677,7 +3667,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {}/** @lucene.internal */- public synchronized String segString(SegmentInfoPerCommit info) throws IOException {+ public synchronized String segString(SegmentInfoPerCommit info) {return info.toString(info.info.dir, numDeletedDocs(info) - info.getDelCount());}diff --git a/lucene/core/src/java/org/apache/lucene/index/LogMergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/LogMergePolicy.javaindex 31ec8c8eec2..53e27673886 100644--- a/lucene/core/src/java/org/apache/lucene/index/LogMergePolicy.java+++ b/lucene/core/src/java/org/apache/lucene/index/LogMergePolicy.java@@ -420,7 +420,7 @@ public abstract class LogMergePolicy extends MergePolicy {*/@Overridepublic MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos)- throws CorruptIndexException, IOException {+ throws IOException {final List<SegmentInfoPerCommit> segments = segmentInfos.asList();final int numSegments = segments.size();diff --git a/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/MergePolicy.javaindex dfff8b6586d..8b1dd96d6eb 100644--- a/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java+++ b/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java@@ -299,7 +299,7 @@ public abstract class MergePolicy implements java.io.Closeable, Cloneable {* the total set of segments in the index*/public abstract MergeSpecification findMerges(SegmentInfos segmentInfos)- throws CorruptIndexException, IOException;+ throws IOException;/*** Determine what set of merge operations is necessary in@@ -324,7 +324,7 @@ public abstract class MergePolicy implements java.io.Closeable, Cloneable {*/public abstract MergeSpecification findForcedMerges(SegmentInfos segmentInfos, int maxSegmentCount, Map<SegmentInfoPerCommit,Boolean> segmentsToMerge)- throws CorruptIndexException, IOException;+ throws IOException;/*** Determine what set of merge operations is necessary in order to expunge all@@ -334,7 +334,7 @@ public abstract class MergePolicy implements java.io.Closeable, Cloneable {* the total set of segments in the index*/public abstract MergeSpecification findForcedDeletesMerges(- SegmentInfos segmentInfos) throws CorruptIndexException, IOException;+ SegmentInfos segmentInfos) throws IOException;/*** Release all resources for the policy.diff --git a/lucene/core/src/java/org/apache/lucene/index/MergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/MergeScheduler.javaindex 02163c1bb59..7be73ff28f0 100644--- a/lucene/core/src/java/org/apache/lucene/index/MergeScheduler.java+++ b/lucene/core/src/java/org/apache/lucene/index/MergeScheduler.java@@ -29,10 +29,8 @@ import java.io.IOException;public abstract class MergeScheduler {/** Run the merges provided by {@link IndexWriter#getNextMerge()}. */- public abstract void merge(IndexWriter writer)- throws CorruptIndexException, IOException;+ public abstract void merge(IndexWriter writer) throws IOException;/** Close this MergeScheduler. */- public abstract void close()- throws CorruptIndexException, IOException;+ public abstract void close() throws IOException;}diff --git a/lucene/core/src/java/org/apache/lucene/index/MergeState.java b/lucene/core/src/java/org/apache/lucene/index/MergeState.javaindex 96a88a4ed91..7ce6dda2364 100644--- a/lucene/core/src/java/org/apache/lucene/index/MergeState.java+++ b/lucene/core/src/java/org/apache/lucene/index/MergeState.java@@ -247,7 +247,7 @@ public class MergeState {* @lucene.internal */static final MergeState.CheckAbort NONE = new MergeState.CheckAbort(null, null) {@Override- public void work(double units) throws MergePolicy.MergeAbortedException {+ public void work(double units) {// do nothing}};diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.javaindex 62074f5b492..746885b95db 100644--- a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java+++ b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java@@ -51,7 +51,7 @@ public class MultiDocValues extends DocValues {return reader.normValues(field);}- public boolean stopLoadingOnNull(AtomicReader reader, String field) throws IOException {+ public boolean stopLoadingOnNull(AtomicReader reader, String field) {// for norms we drop all norms if one leaf reader has no norms and the field is presentFieldInfos fieldInfos = reader.getFieldInfos();FieldInfo fieldInfo = fieldInfos.fieldInfo(field);@@ -79,7 +79,7 @@ public class MultiDocValues extends DocValues {return reader.docValues(field);}- public boolean stopLoadingOnNull(AtomicReader reader, String field) throws IOException {+ public boolean stopLoadingOnNull(AtomicReader reader, String field) {return false;}}@@ -437,7 +437,7 @@ public class MultiDocValues extends DocValues {ordToOffset = type == Type.BYTES_VAR_SORTED ? new long[2] : null;}@Override- public void consume(BytesRef ref, int ord, long offset) throws IOException {+ public void consume(BytesRef ref, int ord, long offset) {pagedBytes.copy(ref);if (ordToOffset != null) {if (ord+1 >= ordToOffset.length) {diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiDocsAndPositionsEnum.java b/lucene/core/src/java/org/apache/lucene/index/MultiDocsAndPositionsEnum.javaindex 47f4d37eeda..777ca0ae46b 100644--- a/lucene/core/src/java/org/apache/lucene/index/MultiDocsAndPositionsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/index/MultiDocsAndPositionsEnum.java@@ -46,7 +46,7 @@ public final class MultiDocsAndPositionsEnum extends DocsAndPositionsEnum {return this.parent == parent;}- public MultiDocsAndPositionsEnum reset(final EnumWithSlice[] subs, final int numSubs) throws IOException {+ public MultiDocsAndPositionsEnum reset(final EnumWithSlice[] subs, final int numSubs) {this.numSubs = numSubs;this.subs = new EnumWithSlice[subs.length];for(int i=0;i<subs.length;i++) {diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiDocsEnum.java b/lucene/core/src/java/org/apache/lucene/index/MultiDocsEnum.javaindex d112afa0878..1e09ef7dba6 100644--- a/lucene/core/src/java/org/apache/lucene/index/MultiDocsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/index/MultiDocsEnum.java@@ -42,7 +42,7 @@ public final class MultiDocsEnum extends DocsEnum {subDocsEnum = new DocsEnum[subReaderCount];}- MultiDocsEnum reset(final EnumWithSlice[] subs, final int numSubs) throws IOException {+ MultiDocsEnum reset(final EnumWithSlice[] subs, final int numSubs) {this.numSubs = numSubs;this.subs = new EnumWithSlice[subs.length];diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiFieldsEnum.java b/lucene/core/src/java/org/apache/lucene/index/MultiFieldsEnum.javaindex 7009c954c37..2e75c477486 100644--- a/lucene/core/src/java/org/apache/lucene/index/MultiFieldsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/index/MultiFieldsEnum.java@@ -110,7 +110,7 @@ public final class MultiFieldsEnum extends FieldsEnum {final int index;String current;- public FieldsEnumWithSlice(FieldsEnum fields, ReaderSlice slice, int index) throws IOException {+ public FieldsEnumWithSlice(FieldsEnum fields, ReaderSlice slice, int index) {this.slice = slice;this.index = index;assert slice.length >= 0: "length=" + slice.length;diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiReader.java b/lucene/core/src/java/org/apache/lucene/index/MultiReader.javaindex 19aaa905a18..46102038749 100644--- a/lucene/core/src/java/org/apache/lucene/index/MultiReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/MultiReader.java@@ -45,7 +45,7 @@ public class MultiReader extends BaseCompositeReader<IndexReader> {* <p>Note that all subreaders are closed if this Multireader is closed.</p>* @param subReaders set of (sub)readers*/- public MultiReader(IndexReader... subReaders) throws IOException {+ public MultiReader(IndexReader... subReaders) {this(subReaders, true);}@@ -55,7 +55,7 @@ public class MultiReader extends BaseCompositeReader<IndexReader> {* @param closeSubReaders indicates whether the subreaders should be closed* when this MultiReader is closed*/- public MultiReader(IndexReader[] subReaders, boolean closeSubReaders) throws IOException {+ public MultiReader(IndexReader[] subReaders, boolean closeSubReaders) {super(subReaders.clone());this.closeSubReaders = closeSubReaders;if (!closeSubReaders) {diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiTerms.java b/lucene/core/src/java/org/apache/lucene/index/MultiTerms.javaindex 5edf8033c04..8b8c3aa2379 100644--- a/lucene/core/src/java/org/apache/lucene/index/MultiTerms.java+++ b/lucene/core/src/java/org/apache/lucene/index/MultiTerms.java@@ -95,7 +95,7 @@ public final class MultiTerms extends Terms {}@Override- public long size() throws IOException {+ public long size() {return -1;}diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiTermsEnum.java b/lucene/core/src/java/org/apache/lucene/index/MultiTermsEnum.javaindex c368601b7e1..8a8f97d6aab 100644--- a/lucene/core/src/java/org/apache/lucene/index/MultiTermsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/index/MultiTermsEnum.java@@ -258,12 +258,12 @@ public final class MultiTermsEnum extends TermsEnum {}@Override- public void seekExact(long ord) throws IOException {+ public void seekExact(long ord) {throw new UnsupportedOperationException();}@Override- public long ord() throws IOException {+ public long ord() {throw new UnsupportedOperationException();}diff --git a/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java b/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.javaindex a50bbfa55eb..9ea0501b82e 100644--- a/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java+++ b/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java@@ -17,7 +17,6 @@ package org.apache.lucene.index;* limitations under the License.*/-import java.io.IOException;import java.util.List;/**@@ -34,8 +33,8 @@ public final class NoDeletionPolicy implements IndexDeletionPolicy {// keep private to avoid instantiation}- public void onCommit(List<? extends IndexCommit> commits) throws IOException {}+ public void onCommit(List<? extends IndexCommit> commits) {}- public void onInit(List<? extends IndexCommit> commits) throws IOException {}+ public void onInit(List<? extends IndexCommit> commits) {}}diff --git a/lucene/core/src/java/org/apache/lucene/index/NoMergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/NoMergePolicy.javaindex 7484b670d9e..9d83e3587bc 100644--- a/lucene/core/src/java/org/apache/lucene/index/NoMergePolicy.java+++ b/lucene/core/src/java/org/apache/lucene/index/NoMergePolicy.java@@ -17,7 +17,6 @@ package org.apache.lucene.index;* limitations under the License.*/-import java.io.IOException;import java.util.Map;/**@@ -54,17 +53,14 @@ public final class NoMergePolicy extends MergePolicy {public void close() {}@Override- public MergeSpecification findMerges(SegmentInfos segmentInfos)- throws CorruptIndexException, IOException { return null; }+ public MergeSpecification findMerges(SegmentInfos segmentInfos) { return null; }@Overridepublic MergeSpecification findForcedMerges(SegmentInfos segmentInfos,- int maxSegmentCount, Map<SegmentInfoPerCommit,Boolean> segmentsToMerge)- throws CorruptIndexException, IOException { return null; }+ int maxSegmentCount, Map<SegmentInfoPerCommit,Boolean> segmentsToMerge) { return null; }@Override- public MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos)- throws CorruptIndexException, IOException { return null; }+ public MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos) { return null; }@Overridepublic boolean useCompoundFile(SegmentInfos segments, SegmentInfoPerCommit newSegment) { return useCompoundFile; }diff --git a/lucene/core/src/java/org/apache/lucene/index/NoMergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/NoMergeScheduler.javaindex c131c446f45..e3aba03c20b 100644--- a/lucene/core/src/java/org/apache/lucene/index/NoMergeScheduler.java+++ b/lucene/core/src/java/org/apache/lucene/index/NoMergeScheduler.java@@ -17,8 +17,6 @@ package org.apache.lucene.index;* limitations under the License.*/-import java.io.IOException;-/*** A {@link MergeScheduler} which never executes any merges. It is also a* singleton and can be accessed through {@link NoMergeScheduler#INSTANCE}. Use@@ -42,5 +40,5 @@ public final class NoMergeScheduler extends MergeScheduler {public void close() {}@Override- public void merge(IndexWriter writer) throws CorruptIndexException, IOException {}+ public void merge(IndexWriter writer) {}}diff --git a/lucene/core/src/java/org/apache/lucene/index/NormsConsumer.java b/lucene/core/src/java/org/apache/lucene/index/NormsConsumer.javaindex ac9bed3f10c..25f69320097 100644--- a/lucene/core/src/java/org/apache/lucene/index/NormsConsumer.java+++ b/lucene/core/src/java/org/apache/lucene/index/NormsConsumer.java@@ -87,10 +87,10 @@ final class NormsConsumer extends InvertedDocEndConsumer {}@Override- void finishDocument() throws IOException {}+ void finishDocument() {}@Override- void startDocument() throws IOException {}+ void startDocument() {}@OverrideInvertedDocEndConsumerPerField addField(DocInverterPerField docInverterPerField,diff --git a/lucene/core/src/java/org/apache/lucene/index/ParallelAtomicReader.java b/lucene/core/src/java/org/apache/lucene/index/ParallelAtomicReader.javaindex 3b5c9474a0a..10c8dd64a37 100644--- a/lucene/core/src/java/org/apache/lucene/index/ParallelAtomicReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/ParallelAtomicReader.java@@ -162,7 +162,7 @@ public final class ParallelAtomicReader extends AtomicReader {}@Override- public String next() throws IOException {+ public String next() {if (keys.hasNext()) {currentField = keys.next();} else {@@ -172,7 +172,7 @@ public final class ParallelAtomicReader extends AtomicReader {}@Override- public Terms terms() throws IOException {+ public Terms terms() {return fields.terms(currentField);}@@ -185,22 +185,22 @@ public final class ParallelAtomicReader extends AtomicReader {ParallelFields() {}- void addField(String fieldName, Terms terms) throws IOException {+ void addField(String fieldName, Terms terms) {fields.put(fieldName, terms);}@Override- public FieldsEnum iterator() throws IOException {+ public FieldsEnum iterator() {return new ParallelFieldsEnum(this);}@Override- public Terms terms(String field) throws IOException {+ public Terms terms(String field) {return fields.get(field);}@Override- public int size() throws IOException {+ public int size() {return fields.size();}}@@ -249,7 +249,7 @@ public final class ParallelAtomicReader extends AtomicReader {}@Override- public void document(int docID, StoredFieldVisitor visitor) throws CorruptIndexException, IOException {+ public void document(int docID, StoredFieldVisitor visitor) throws IOException {ensureOpen();for (final AtomicReader reader: storedFieldsReaders) {reader.document(docID, visitor);diff --git a/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java b/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.javaindex ecf58381d3a..ebae93a549b 100644--- a/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java+++ b/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java@@ -28,7 +28,6 @@ import org.apache.lucene.document.Field;import org.apache.lucene.document.FieldType;import org.apache.lucene.index.IndexWriterConfig.OpenMode;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.Version;/**@@ -106,8 +105,7 @@ public class PersistentSnapshotDeletionPolicy extends SnapshotDeletionPolicy {* IndexWriter.*/public PersistentSnapshotDeletionPolicy(IndexDeletionPolicy primary,- Directory dir, OpenMode mode, Version matchVersion)- throws CorruptIndexException, LockObtainFailedException, IOException {+ Directory dir, OpenMode mode, Version matchVersion) throws IOException {super(primary, null);// Initialize the index writer over the snapshot directory.@@ -175,7 +173,7 @@ public class PersistentSnapshotDeletionPolicy extends SnapshotDeletionPolicy {}/** Closes the index which writes the snapshots to the directory. */- public void close() throws CorruptIndexException, IOException {+ public void close() throws IOException {writer.close();}diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java b/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.javaindex 458df72d84c..e6f2b0ebdc1 100644--- a/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java+++ b/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java@@ -157,7 +157,7 @@ public final class SegmentInfo {* modify it.*/- public Set<String> files() throws IOException {+ public Set<String> files() {if (setFiles == null) {throw new IllegalStateException("files were not computed yet");}diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java b/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.javaindex 8242bdd7c31..b92d31a1b65 100644--- a/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java+++ b/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java@@ -43,7 +43,6 @@ import org.apache.lucene.store.IndexInput;import org.apache.lucene.store.IndexOutput;import org.apache.lucene.store.NoSuchDirectoryException;import org.apache.lucene.util.IOUtils;-import org.apache.lucene.util.StringHelper;import org.apache.lucene.util.ThreadInterruptedException;/**@@ -191,7 +190,7 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerCom* @param files -- array of file names to check*/- public static String getLastCommitSegmentsFileName(String[] files) throws IOException {+ public static String getLastCommitSegmentsFileName(String[] files) {return IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,"",getLastCommitGeneration(files));@@ -259,7 +258,7 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerCom* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- public final void read(Directory directory, String segmentFileName) throws CorruptIndexException, IOException {+ public final void read(Directory directory, String segmentFileName) throws IOException {boolean success = false;// Clear any previous segments:@@ -314,13 +313,13 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerCom}}- public final void read(Directory directory) throws CorruptIndexException, IOException {+ public final void read(Directory directory) throws IOException {generation = lastGeneration = -1;new FindSegmentsFile(directory) {@Override- protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {+ protected Object doBody(String segmentFileName) throws IOException {read(directory, segmentFileName);return null;}@@ -483,11 +482,11 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerComthis.directory = directory;}- public Object run() throws CorruptIndexException, IOException {+ public Object run() throws IOException {return run(null);}- public Object run(IndexCommit commit) throws CorruptIndexException, IOException {+ public Object run(IndexCommit commit) throws IOException {if (commit != null) {if (directory != commit.getDirectory())throw new IOException("the specified commit does not match the specified Directory");@@ -693,7 +692,7 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerCom* during the processing that could have been caused by* a writer committing.*/- protected abstract Object doBody(String segmentFileName) throws CorruptIndexException, IOException;+ protected abstract Object doBody(String segmentFileName) throws IOException;}// Carry over generation numbers from another SegmentInfos@@ -702,7 +701,7 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerComgeneration = other.generation;}- final void rollbackCommit(Directory dir) throws IOException {+ final void rollbackCommit(Directory dir) {if (pendingSegnOutput != null) {try {pendingSegnOutput.close();diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java b/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.javaindex fdc7d18acca..2468c2b982e 100644--- a/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java+++ b/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java@@ -91,7 +91,7 @@ final class SegmentMerger {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- final MergeState merge() throws CorruptIndexException, IOException {+ final MergeState merge() throws IOException {// NOTE: it's important to add calls to// checkAbort.work(...) if you make any changes to this// method that will spend alot of time. The frequency@@ -244,7 +244,7 @@ final class SegmentMerger {* @throws CorruptIndexException if the index is corrupt* @throws IOException if there is a low-level IO error*/- private int mergeFields() throws CorruptIndexException, IOException {+ private int mergeFields() throws IOException {final StoredFieldsWriter fieldsWriter = codec.storedFieldsFormat().fieldsWriter(directory, mergeState.segmentInfo, context);try {@@ -300,7 +300,7 @@ final class SegmentMerger {return docBase;}- private final void mergeTerms(SegmentWriteState segmentWriteState) throws CorruptIndexException, IOException {+ private final void mergeTerms(SegmentWriteState segmentWriteState) throws IOException {final List<Fields> fields = new ArrayList<Fields>();final List<ReaderSlice> slices = new ArrayList<ReaderSlice>();diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java b/lucene/core/src/java/org/apache/lucene/index/SegmentReader.javaindex d36fb09c4b9..a6076ca1f01 100644--- a/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java@@ -89,7 +89,7 @@ public final class SegmentReader extends AtomicReader {// SegmentReader and using the provided in-memory// liveDocs. Used by IndexWriter to provide a new NRT// reader:- SegmentReader(SegmentInfoPerCommit si, SegmentCoreReaders core, Bits liveDocs, int numDocs) throws IOException {+ SegmentReader(SegmentInfoPerCommit si, SegmentCoreReaders core, Bits liveDocs, int numDocs) {this.si = si;this.core = core;core.incRef();@@ -131,7 +131,7 @@ public final class SegmentReader extends AtomicReader {}@Override- public void document(int docID, StoredFieldVisitor visitor) throws CorruptIndexException, IOException {+ public void document(int docID, StoredFieldVisitor visitor) throws IOException {if (docID < 0 || docID >= maxDoc()) {throw new IllegalArgumentException("docID must be >= 0 and < maxDoc=" + maxDoc() + " (got docID=" + docID + ")");}@@ -139,7 +139,7 @@ public final class SegmentReader extends AtomicReader {}@Override- public Fields fields() throws IOException {+ public Fields fields() {ensureOpen();return core.fields;}diff --git a/lucene/core/src/java/org/apache/lucene/index/SerialMergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/SerialMergeScheduler.javaindex afbfd6a53e2..203544189bf 100644--- a/lucene/core/src/java/org/apache/lucene/index/SerialMergeScheduler.java+++ b/lucene/core/src/java/org/apache/lucene/index/SerialMergeScheduler.java@@ -27,8 +27,7 @@ public class SerialMergeScheduler extends MergeScheduler {* "synchronized" so that even if the application is using* multiple threads, only one merge may run at a time. */@Override- synchronized public void merge(IndexWriter writer)- throws CorruptIndexException, IOException {+ synchronized public void merge(IndexWriter writer) throws IOException {while(true) {MergePolicy.OneMerge merge = writer.getNextMerge();diff --git a/lucene/core/src/java/org/apache/lucene/index/SingleTermsEnum.java b/lucene/core/src/java/org/apache/lucene/index/SingleTermsEnum.javaindex 93556e027c1..e33c10d7e7d 100644--- a/lucene/core/src/java/org/apache/lucene/index/SingleTermsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/index/SingleTermsEnum.java@@ -17,8 +17,6 @@ package org.apache.lucene.index;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.search.MultiTermQuery; // javadocsimport org.apache.lucene.util.BytesRef;@@ -39,7 +37,7 @@ public final class SingleTermsEnum extends FilteredTermsEnum {* After calling the constructor the enumeration is already pointing to the term,* if it exists.*/- public SingleTermsEnum(TermsEnum tenum, BytesRef termText) throws IOException {+ public SingleTermsEnum(TermsEnum tenum, BytesRef termText) {super(tenum);singleRef = termText;setInitialSeekTerm(termText);diff --git a/lucene/core/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java b/lucene/core/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.javaindex e0824b31374..a616661f34d 100644--- a/lucene/core/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java+++ b/lucene/core/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java@@ -75,7 +75,7 @@ public final class SlowCompositeReaderWrapper extends AtomicReader {}@Override- public Fields fields() throws IOException {+ public Fields fields() {ensureOpen();return fields;}@@ -117,7 +117,7 @@ public final class SlowCompositeReaderWrapper extends AtomicReader {}@Override- public void document(int docID, StoredFieldVisitor visitor) throws CorruptIndexException, IOException {+ public void document(int docID, StoredFieldVisitor visitor) throws IOException {ensureOpen();in.document(docID, visitor);}diff --git a/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java b/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.javaindex 2a93ea0e153..023af1343f2 100644--- a/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java+++ b/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java@@ -218,7 +218,7 @@ public final class SortedBytesMergeUtils {current = top[0].current;}- private void pushTop() throws IOException {+ private void pushTop() {// call next() on each top, and put back into queuefor (int i = 0; i < numTop; i++) {top[i].current = top[i].next();diff --git a/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.javaindex a8cd8d0eedc..fc02117e5ab 100644--- a/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java@@ -38,7 +38,7 @@ final class StandardDirectoryReader extends DirectoryReader {/** called only from static open() methods */StandardDirectoryReader(Directory directory, AtomicReader[] readers, IndexWriter writer,- SegmentInfos sis, int termInfosIndexDivisor, boolean applyAllDeletes) throws IOException {+ SegmentInfos sis, int termInfosIndexDivisor, boolean applyAllDeletes) {super(directory, readers);this.writer = writer;this.segmentInfos = sis;@@ -48,10 +48,10 @@ final class StandardDirectoryReader extends DirectoryReader {/** called from DirectoryReader.open(...) methods */static DirectoryReader open(final Directory directory, final IndexCommit commit,- final int termInfosIndexDivisor) throws CorruptIndexException, IOException {+ final int termInfosIndexDivisor) throws IOException {return (DirectoryReader) new SegmentInfos.FindSegmentsFile(directory) {@Override- protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {+ protected Object doBody(String segmentFileName) throws IOException {SegmentInfos sis = new SegmentInfos();sis.read(directory, segmentFileName);final SegmentReader[] readers = new SegmentReader[sis.size()];@@ -226,12 +226,12 @@ final class StandardDirectoryReader extends DirectoryReader {}@Override- protected DirectoryReader doOpenIfChanged() throws CorruptIndexException, IOException {+ protected DirectoryReader doOpenIfChanged() throws IOException {return doOpenIfChanged(null);}@Override- protected DirectoryReader doOpenIfChanged(final IndexCommit commit) throws CorruptIndexException, IOException {+ protected DirectoryReader doOpenIfChanged(final IndexCommit commit) throws IOException {ensureOpen();// If we were obtained by writer.getReader(), re-ask the@@ -244,7 +244,7 @@ final class StandardDirectoryReader extends DirectoryReader {}@Override- protected DirectoryReader doOpenIfChanged(IndexWriter writer, boolean applyAllDeletes) throws CorruptIndexException, IOException {+ protected DirectoryReader doOpenIfChanged(IndexWriter writer, boolean applyAllDeletes) throws IOException {ensureOpen();if (writer == this.writer && applyAllDeletes == this.applyAllDeletes) {return doOpenFromWriter(null);@@ -253,7 +253,7 @@ final class StandardDirectoryReader extends DirectoryReader {}}- private DirectoryReader doOpenFromWriter(IndexCommit commit) throws CorruptIndexException, IOException {+ private DirectoryReader doOpenFromWriter(IndexCommit commit) throws IOException {if (commit != null) {throw new IllegalArgumentException("a reader obtained from IndexWriter.getReader() cannot currently accept a commit");}@@ -273,7 +273,7 @@ final class StandardDirectoryReader extends DirectoryReader {return reader;}- private synchronized DirectoryReader doOpenNoWriter(IndexCommit commit) throws CorruptIndexException, IOException {+ private synchronized DirectoryReader doOpenNoWriter(IndexCommit commit) throws IOException {if (commit == null) {if (isCurrent()) {@@ -290,7 +290,7 @@ final class StandardDirectoryReader extends DirectoryReader {return (DirectoryReader) new SegmentInfos.FindSegmentsFile(directory) {@Override- protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {+ protected Object doBody(String segmentFileName) throws IOException {final SegmentInfos infos = new SegmentInfos();infos.read(directory, segmentFileName);return doOpenIfChanged(infos, null);@@ -298,7 +298,7 @@ final class StandardDirectoryReader extends DirectoryReader {}.run(commit);}- synchronized DirectoryReader doOpenIfChanged(SegmentInfos infos, IndexWriter writer) throws CorruptIndexException, IOException {+ synchronized DirectoryReader doOpenIfChanged(SegmentInfos infos, IndexWriter writer) throws IOException {return StandardDirectoryReader.open(directory, writer, infos, getSequentialSubReaders(), termInfosIndexDivisor);}@@ -309,7 +309,7 @@ final class StandardDirectoryReader extends DirectoryReader {}@Override- public boolean isCurrent() throws CorruptIndexException, IOException {+ public boolean isCurrent() throws IOException {ensureOpen();if (writer == null || writer.isClosed()) {// Fully read the segments file: this ensures that it'sdiff --git a/lucene/core/src/java/org/apache/lucene/index/StoredFieldsConsumer.java b/lucene/core/src/java/org/apache/lucene/index/StoredFieldsConsumer.javaindex db2a725c51b..3241d38358a 100644--- a/lucene/core/src/java/org/apache/lucene/index/StoredFieldsConsumer.java+++ b/lucene/core/src/java/org/apache/lucene/index/StoredFieldsConsumer.java@@ -126,7 +126,7 @@ final class StoredFieldsConsumer {assert docWriter.writer.testPoint("StoredFieldsWriter.finishDocument end");}- public void addField(IndexableField field, FieldInfo fieldInfo) throws IOException {+ public void addField(IndexableField field, FieldInfo fieldInfo) {if (numStoredFields == storedFields.length) {int newSize = ArrayUtil.oversize(numStoredFields + 1, RamUsageEstimator.NUM_BYTES_OBJECT_REF);IndexableField[] newArray = new IndexableField[newSize];diff --git a/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumer.java b/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumer.javaindex debf6f7dcd0..40756e1fa25 100644--- a/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumer.java+++ b/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumer.java@@ -158,7 +158,7 @@ final class TermVectorsConsumer extends TermsHashConsumer {}@Override- void startDocument() throws IOException {+ void startDocument() {assert clearLastVectorFieldName();reset();}diff --git a/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java b/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.javaindex 44bb0e4d9a6..e1338402e06 100644--- a/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java+++ b/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java@@ -90,7 +90,7 @@ final class TermVectorsConsumerPerField extends TermsHashConsumerPerField {* are enabled, to write the vectors to* RAMOutputStream, which is then quickly flushed to* the real term vectors files in the Directory. */ @Override- void finish() throws IOException {+ void finish() {if (!doVectors || termsHashPerField.bytesHash.size() == 0) {return;}diff --git a/lucene/core/src/java/org/apache/lucene/index/TermsEnum.java b/lucene/core/src/java/org/apache/lucene/index/TermsEnum.javaindex 2248afcf6d1..7d0a580f62f 100644--- a/lucene/core/src/java/org/apache/lucene/index/TermsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/index/TermsEnum.java@@ -240,12 +240,12 @@ public abstract class TermsEnum implements BytesRefIterator {}@Override- public TermState termState() throws IOException {+ public TermState termState() {throw new IllegalStateException("this method should never be called");}@Override- public void seekExact(BytesRef term, TermState state) throws IOException {+ public void seekExact(BytesRef term, TermState state) {throw new IllegalStateException("this method should never be called");}};diff --git a/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.javaindex ce574973d5a..f181160dc17 100644--- a/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java+++ b/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java@@ -553,8 +553,7 @@ public class TieredMergePolicy extends MergePolicy {}@Override- public MergeSpecification findForcedDeletesMerges(SegmentInfos infos)- throws CorruptIndexException, IOException {+ public MergeSpecification findForcedDeletesMerges(SegmentInfos infos) throws IOException {if (verbose()) {message("findForcedDeletesMerges infos=" + writer.get().segString(infos) + " forceMergeDeletesPctAllowed=" + forceMergeDeletesPctAllowed);}@@ -623,8 +622,7 @@ public class TieredMergePolicy extends MergePolicy {public void close() {}- private boolean isMerged(SegmentInfoPerCommit info)- throws IOException {+ private boolean isMerged(SegmentInfoPerCommit info) {IndexWriter w = writer.get();assert w != null;boolean hasDeletions = w.numDeletedDocs(info) > 0;diff --git a/lucene/core/src/java/org/apache/lucene/index/UpgradeIndexMergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/UpgradeIndexMergePolicy.javaindex 82abfed6c53..e4d4fc2448d 100644--- a/lucene/core/src/java/org/apache/lucene/index/UpgradeIndexMergePolicy.java+++ b/lucene/core/src/java/org/apache/lucene/index/UpgradeIndexMergePolicy.java@@ -74,12 +74,12 @@ public class UpgradeIndexMergePolicy extends MergePolicy {}@Override- public MergeSpecification findMerges(SegmentInfos segmentInfos) throws CorruptIndexException, IOException {+ public MergeSpecification findMerges(SegmentInfos segmentInfos) throws IOException {return base.findMerges(segmentInfos);}@Override- public MergeSpecification findForcedMerges(SegmentInfos segmentInfos, int maxSegmentCount, Map<SegmentInfoPerCommit,Boolean> segmentsToMerge) throws CorruptIndexException, IOException {+ public MergeSpecification findForcedMerges(SegmentInfos segmentInfos, int maxSegmentCount, Map<SegmentInfoPerCommit,Boolean> segmentsToMerge) throws IOException {// first find all old segmentsfinal Map<SegmentInfoPerCommit,Boolean> oldSegments = new HashMap<SegmentInfoPerCommit,Boolean>();for (final SegmentInfoPerCommit si : segmentInfos) {@@ -129,7 +129,7 @@ public class UpgradeIndexMergePolicy extends MergePolicy {}@Override- public MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos) throws CorruptIndexException, IOException {+ public MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos) throws IOException {return base.findForcedDeletesMerges(segmentInfos);}diff --git a/lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java b/lucene/core/src/java/org/apache/lucene/search/BooleanScorer.javaindex f291175fb3a..94796f66427 100644--- a/lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java+++ b/lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java@@ -98,7 +98,7 @@ final class BooleanScorer extends Scorer {}@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@@ -122,7 +122,7 @@ final class BooleanScorer extends Scorer {public BucketScorer(Weight weight) { super(weight); }@Override- public int advance(int target) throws IOException { return NO_MORE_DOCS; }+ public int advance(int target) { return NO_MORE_DOCS; }@Overridepublic int docID() { return doc; }@@ -131,10 +131,10 @@ final class BooleanScorer extends Scorer {public float freq() { return freq; }@Override- public int nextDoc() throws IOException { return NO_MORE_DOCS; }+ public int nextDoc() { return NO_MORE_DOCS; }@Override- public float score() throws IOException { return score; }+ public float score() { return score; }}@@ -181,8 +181,7 @@ final class BooleanScorer extends Scorer {public SubScorer next;public SubScorer(Scorer scorer, boolean required, boolean prohibited,- Collector collector, SubScorer next)- throws IOException {+ Collector collector, SubScorer next) {if (required) {throw new IllegalArgumentException("this scorer cannot handle required=true");}@@ -299,7 +298,7 @@ final class BooleanScorer extends Scorer {}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {throw new UnsupportedOperationException();}@@ -309,7 +308,7 @@ final class BooleanScorer extends Scorer {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {throw new UnsupportedOperationException();}diff --git a/lucene/core/src/java/org/apache/lucene/search/CachingCollector.java b/lucene/core/src/java/org/apache/lucene/search/CachingCollector.javaindex c24baed6bcd..19996a3f02b 100644--- a/lucene/core/src/java/org/apache/lucene/search/CachingCollector.java+++ b/lucene/core/src/java/org/apache/lucene/search/CachingCollector.java@@ -338,13 +338,13 @@ public abstract class CachingCollector extends Collector {}@Override- public void setScorer(Scorer scorer) throws IOException {}+ public void setScorer(Scorer scorer) {}@Override- public void collect(int doc) throws IOException {}+ public void collect(int doc) {}@Override- public void setNextReader(AtomicReaderContext context) throws IOException {}+ public void setNextReader(AtomicReaderContext context) {}};return create(other, cacheScores, maxRAMMB);diff --git a/lucene/core/src/java/org/apache/lucene/search/ConjunctionTermScorer.java b/lucene/core/src/java/org/apache/lucene/search/ConjunctionTermScorer.javaindex d20d12f34b1..3832661d696 100644--- a/lucene/core/src/java/org/apache/lucene/search/ConjunctionTermScorer.java+++ b/lucene/core/src/java/org/apache/lucene/search/ConjunctionTermScorer.java@@ -32,7 +32,7 @@ class ConjunctionTermScorer extends Scorer {private final DocsAndFreqs lead;ConjunctionTermScorer(Weight weight, float coord,- DocsAndFreqs[] docsAndFreqs) throws IOException {+ DocsAndFreqs[] docsAndFreqs) {super(weight);this.coord = coord;this.docsAndFreqs = docsAndFreqs;diff --git a/lucene/core/src/java/org/apache/lucene/search/ConstantScoreAutoRewrite.java b/lucene/core/src/java/org/apache/lucene/search/ConstantScoreAutoRewrite.javaindex ce3acc13b0b..d36b1a37c9c 100644--- a/lucene/core/src/java/org/apache/lucene/search/ConstantScoreAutoRewrite.java+++ b/lucene/core/src/java/org/apache/lucene/search/ConstantScoreAutoRewrite.java@@ -122,7 +122,7 @@ class ConstantScoreAutoRewrite extends TermCollectingRewrite<BooleanQuery> {}@Override- public void setNextEnum(TermsEnum termsEnum) throws IOException {+ public void setNextEnum(TermsEnum termsEnum) {this.termsEnum = termsEnum;}diff --git a/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java b/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.javaindex fdd30e46f83..31be3523f3c 100644--- a/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java+++ b/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java@@ -172,7 +172,7 @@ public class ConstantScoreQuery extends Query {final DocIdSetIterator docIdSetIterator;final float theScore;- public ConstantScorer(DocIdSetIterator docIdSetIterator, Weight w, float theScore) throws IOException {+ public ConstantScorer(DocIdSetIterator docIdSetIterator, Weight w, float theScore) {super(w);this.theScore = theScore;this.docIdSetIterator = docIdSetIterator;diff --git a/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java b/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxScorer.javaindex 6e87343cdc9..88eec00dc27 100644--- a/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java+++ b/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java@@ -55,7 +55,7 @@ class DisjunctionMaxScorer extends Scorer {* length may be larger than the actual number of scorers.*/public DisjunctionMaxScorer(Weight weight, float tieBreakerMultiplier,- Scorer[] subScorers, int numScorers) throws IOException {+ Scorer[] subScorers, int numScorers) {super(weight);this.tieBreakerMultiplier = tieBreakerMultiplier;// The passed subScorers array includes only scorers which have documentsdiff --git a/lucene/core/src/java/org/apache/lucene/search/DocIdSet.java b/lucene/core/src/java/org/apache/lucene/search/DocIdSet.javaindex 3104fc60b93..6345e6aaf36 100644--- a/lucene/core/src/java/org/apache/lucene/search/DocIdSet.java+++ b/lucene/core/src/java/org/apache/lucene/search/DocIdSet.java@@ -31,11 +31,11 @@ public abstract class DocIdSet {private final DocIdSetIterator iterator = new DocIdSetIterator() {@Override- public int advance(int target) throws IOException { return NO_MORE_DOCS; }+ public int advance(int target) { return NO_MORE_DOCS; }@Overridepublic int docID() { return NO_MORE_DOCS; }@Override- public int nextDoc() throws IOException { return NO_MORE_DOCS; }+ public int nextDoc() { return NO_MORE_DOCS; }};@Override@@ -50,7 +50,7 @@ public abstract class DocIdSet {// we explicitely provide no random access, as this filter is 100% sparse and iterator exits faster@Override- public Bits bits() throws IOException {+ public Bits bits() {return null;}};diff --git a/lucene/core/src/java/org/apache/lucene/search/ExactPhraseScorer.java b/lucene/core/src/java/org/apache/lucene/search/ExactPhraseScorer.javaindex 24868706ad3..da4afd51ab9 100644--- a/lucene/core/src/java/org/apache/lucene/search/ExactPhraseScorer.java+++ b/lucene/core/src/java/org/apache/lucene/search/ExactPhraseScorer.java@@ -194,7 +194,7 @@ final class ExactPhraseScorer extends Scorer {}@Override- public float score() throws IOException {+ public float score() {return docScorer.score(docID, freq);}diff --git a/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java b/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.javaindex 6bc9161717a..673f01107c0 100644--- a/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java@@ -337,8 +337,7 @@ public class FuzzyTermsEnum extends TermsEnum {private final BoostAttribute boostAtt =attributes().addAttribute(BoostAttribute.class);- public AutomatonFuzzyTermsEnum(TermsEnum tenum, CompiledAutomaton compiled[])- throws IOException {+ public AutomatonFuzzyTermsEnum(TermsEnum tenum, CompiledAutomaton compiled[]) {super(tenum, false);this.matchers = new ByteRunAutomaton[compiled.length];for (int i = 0; i < compiled.length; i++)diff --git a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.javaindex ccca4ec1be1..9ca8548ee5b 100644--- a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java+++ b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java@@ -34,7 +34,6 @@ import java.util.concurrent.locks.ReentrantLock;import org.apache.lucene.document.Document;import org.apache.lucene.index.AtomicReaderContext;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader; // javadocsimport org.apache.lucene.index.IndexReader;import org.apache.lucene.index.MultiFields;@@ -182,17 +181,17 @@ public class IndexSearcher {}/** Sugar for <code>.getIndexReader().document(docID)</code> */- public Document doc(int docID) throws CorruptIndexException, IOException {+ public Document doc(int docID) throws IOException {return reader.document(docID);}/** Sugar for <code>.getIndexReader().document(docID, fieldVisitor)</code> */- public void doc(int docID, StoredFieldVisitor fieldVisitor) throws CorruptIndexException, IOException {+ public void doc(int docID, StoredFieldVisitor fieldVisitor) throws IOException {reader.document(docID, fieldVisitor);}/** Sugar for <code>.getIndexReader().document(docID, fieldsToLoad)</code> */- public final Document document(int docID, Set<String> fieldsToLoad) throws CorruptIndexException, IOException {+ public final Document document(int docID, Set<String> fieldsToLoad) throws IOException {return reader.document(docID, fieldsToLoad);}diff --git a/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java b/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.javaindex 1aa411348b3..dc3dbd3b726 100644--- a/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java+++ b/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java@@ -38,7 +38,7 @@ public class MatchAllDocsQuery extends Query {private final int maxDoc;private final Bits liveDocs;- MatchAllScorer(IndexReader reader, Bits liveDocs, Weight w, float score) throws IOException {+ MatchAllScorer(IndexReader reader, Bits liveDocs, Weight w, float score) {super(w);this.liveDocs = liveDocs;this.score = score;diff --git a/lucene/core/src/java/org/apache/lucene/search/MatchOnlyConjunctionTermsScorer.java b/lucene/core/src/java/org/apache/lucene/search/MatchOnlyConjunctionTermsScorer.javaindex 1bb52a46967..a8336f26461 100644--- a/lucene/core/src/java/org/apache/lucene/search/MatchOnlyConjunctionTermsScorer.java+++ b/lucene/core/src/java/org/apache/lucene/search/MatchOnlyConjunctionTermsScorer.java@@ -17,17 +17,15 @@ package org.apache.lucene.search;* limitations under the License.*/-import java.io.IOException;-/** Scorer for conjunctions, sets of terms, all of which are required. */final class MatchOnlyConjunctionTermScorer extends ConjunctionTermScorer {MatchOnlyConjunctionTermScorer(Weight weight, float coord,- DocsAndFreqs[] docsAndFreqs) throws IOException {+ DocsAndFreqs[] docsAndFreqs) {super(weight, coord, docsAndFreqs);}@Override- public float score() throws IOException {+ public float score() {float sum = 0.0f;for (DocsAndFreqs docs : docsAndFreqs) {sum += docs.docScorer.score(lastDoc, 1);diff --git a/lucene/core/src/java/org/apache/lucene/search/MatchOnlyTermScorer.java b/lucene/core/src/java/org/apache/lucene/search/MatchOnlyTermScorer.javaindex 103d15228e0..faad389b775 100644--- a/lucene/core/src/java/org/apache/lucene/search/MatchOnlyTermScorer.java+++ b/lucene/core/src/java/org/apache/lucene/search/MatchOnlyTermScorer.java@@ -42,7 +42,7 @@ final class MatchOnlyTermScorer extends Scorer {* The </code>Similarity.ExactSimScorer</code> implementation* to be used for score computations.*/- MatchOnlyTermScorer(Weight weight, DocsEnum td, Similarity.ExactSimScorer docScorer) throws IOException {+ MatchOnlyTermScorer(Weight weight, DocsEnum td, Similarity.ExactSimScorer docScorer) {super(weight);this.docScorer = docScorer;this.docsEnum = td;diff --git a/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java b/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.javaindex 017c4f9d9e5..50dab036460 100644--- a/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java+++ b/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java@@ -568,7 +568,7 @@ class UnionDocsAndPositionsEnum extends DocsAndPositionsEnum {}@Override- public final int freq() throws IOException {+ public final int freq() {return _freq;}diff --git a/lucene/core/src/java/org/apache/lucene/search/NRTManager.java b/lucene/core/src/java/org/apache/lucene/search/NRTManager.javaindex edee56d6552..8f6719c708e 100644--- a/lucene/core/src/java/org/apache/lucene/search/NRTManager.java+++ b/lucene/core/src/java/org/apache/lucene/search/NRTManager.java@@ -26,7 +26,6 @@ import java.util.concurrent.locks.Condition;import java.util.concurrent.locks.ReentrantLock;import org.apache.lucene.analysis.Analyzer;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader; // javadocsimport org.apache.lucene.index.IndexWriter;@@ -232,13 +231,13 @@ public class NRTManager extends ReferenceManager<IndexSearcher> {return indexingGen.get();}- public long addIndexes(Directory... dirs) throws CorruptIndexException, IOException {+ public long addIndexes(Directory... dirs) throws IOException {writer.addIndexes(dirs);// Return gen as of when indexing finished:return indexingGen.get();}- public long addIndexes(IndexReader... readers) throws CorruptIndexException, IOException {+ public long addIndexes(IndexReader... readers) throws IOException {writer.addIndexes(readers);// Return gen as of when indexing finished:return indexingGen.get();diff --git a/lucene/core/src/java/org/apache/lucene/search/NumericRangeQuery.java b/lucene/core/src/java/org/apache/lucene/search/NumericRangeQuery.javaindex bef9511c967..24fa0fb36c1 100644--- a/lucene/core/src/java/org/apache/lucene/search/NumericRangeQuery.java+++ b/lucene/core/src/java/org/apache/lucene/search/NumericRangeQuery.java@@ -415,7 +415,7 @@ public final class NumericRangeQuery<T extends Number> extends MultiTermQuery {private final LinkedList<BytesRef> rangeBounds = new LinkedList<BytesRef>();private final Comparator<BytesRef> termComp;- NumericRangeTermsEnum(final TermsEnum tenum) throws IOException {+ NumericRangeTermsEnum(final TermsEnum tenum) {super(tenum);switch (dataType) {case LONG:@@ -517,7 +517,7 @@ public final class NumericRangeQuery<T extends Number> extends MultiTermQuery {}@Override- protected final BytesRef nextSeekTerm(BytesRef term) throws IOException {+ protected final BytesRef nextSeekTerm(BytesRef term) {while (rangeBounds.size() >= 2) {nextRange();diff --git a/lucene/core/src/java/org/apache/lucene/search/PrefixTermsEnum.java b/lucene/core/src/java/org/apache/lucene/search/PrefixTermsEnum.javaindex fcf28103e9f..96184b6611b 100644--- a/lucene/core/src/java/org/apache/lucene/search/PrefixTermsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/search/PrefixTermsEnum.java@@ -17,8 +17,6 @@ package org.apache.lucene.search;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.index.FilteredTermsEnum;import org.apache.lucene.index.TermsEnum;import org.apache.lucene.util.BytesRef;@@ -35,7 +33,7 @@ public class PrefixTermsEnum extends FilteredTermsEnum {private final BytesRef prefixRef;- public PrefixTermsEnum(TermsEnum tenum, BytesRef prefixText) throws IOException {+ public PrefixTermsEnum(TermsEnum tenum, BytesRef prefixText) {super(tenum);setInitialSeekTerm(this.prefixRef = prefixText);}diff --git a/lucene/core/src/java/org/apache/lucene/search/ReferenceManager.java b/lucene/core/src/java/org/apache/lucene/search/ReferenceManager.javaindex ba6721ec51a..a66391401fa 100755--- a/lucene/core/src/java/org/apache/lucene/search/ReferenceManager.java+++ b/lucene/core/src/java/org/apache/lucene/search/ReferenceManager.java@@ -186,7 +186,7 @@ public abstract class ReferenceManager<G> implements Closeable {* will return a refreshed instance. Otherwise, consider using the* non-blocking {@link #maybeRefresh()}.*/- public final void maybeRefreshBlocking() throws IOException, InterruptedException {+ public final void maybeRefreshBlocking() throws IOException {ensureOpen();// Ensure only 1 thread does refresh at oncediff --git a/lucene/core/src/java/org/apache/lucene/search/RegexpQuery.java b/lucene/core/src/java/org/apache/lucene/search/RegexpQuery.javaindex c13c9dd47f9..54d013529ab 100644--- a/lucene/core/src/java/org/apache/lucene/search/RegexpQuery.java+++ b/lucene/core/src/java/org/apache/lucene/search/RegexpQuery.java@@ -1,7 +1,5 @@package org.apache.lucene.search;-import java.io.IOException;-import org.apache.lucene.index.Term;import org.apache.lucene.util.ToStringUtils;@@ -53,7 +51,7 @@ public class RegexpQuery extends AutomatonQuery {* A provider that provides no named automata*/private static AutomatonProvider defaultProvider = new AutomatonProvider() {- public Automaton getAutomaton(String name) throws IOException {+ public Automaton getAutomaton(String name) {return null;}};diff --git a/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java b/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.javaindex dba6be2250c..53b5dc27f75 100644--- a/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java+++ b/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java@@ -126,7 +126,7 @@ public abstract class ScoringRewrite<Q extends Query> extends TermCollectingRewrprivate BoostAttribute boostAtt;@Override- public void setNextEnum(TermsEnum termsEnum) throws IOException {+ public void setNextEnum(TermsEnum termsEnum) {this.termsEnum = termsEnum;this.boostAtt = termsEnum.attributes().addAttribute(BoostAttribute.class);}diff --git a/lucene/core/src/java/org/apache/lucene/search/TermRangeTermsEnum.java b/lucene/core/src/java/org/apache/lucene/search/TermRangeTermsEnum.javaindex 96eff605f11..c6b0a202013 100644--- a/lucene/core/src/java/org/apache/lucene/search/TermRangeTermsEnum.java+++ b/lucene/core/src/java/org/apache/lucene/search/TermRangeTermsEnum.java@@ -58,11 +58,9 @@ public class TermRangeTermsEnum extends FilteredTermsEnum {* If true, the <code>lowerTerm</code> is included in the range.* @param includeUpper* If true, the <code>upperTerm</code> is included in the range.- *- * @throws IOException*/public TermRangeTermsEnum(TermsEnum tenum, BytesRef lowerTerm, BytesRef upperTerm,- boolean includeLower, boolean includeUpper) throws IOException {+ boolean includeLower, boolean includeUpper) {super(tenum);// do a little bit of normalization...diff --git a/lucene/core/src/java/org/apache/lucene/search/TermScorer.java b/lucene/core/src/java/org/apache/lucene/search/TermScorer.javaindex e6b51cf56dc..ebdee4b9600 100644--- a/lucene/core/src/java/org/apache/lucene/search/TermScorer.java+++ b/lucene/core/src/java/org/apache/lucene/search/TermScorer.java@@ -39,7 +39,7 @@ final class TermScorer extends Scorer {* The </code>Similarity.ExactSimScorer</code> implementation* to be used for score computations.*/- TermScorer(Weight weight, DocsEnum td, Similarity.ExactSimScorer docScorer) throws IOException {+ TermScorer(Weight weight, DocsEnum td, Similarity.ExactSimScorer docScorer) {super(weight);this.docScorer = docScorer;this.docsEnum = td;diff --git a/lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java b/lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.javaindex cae01474dc8..942c7234b90 100644--- a/lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java+++ b/lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java@@ -51,7 +51,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {final FieldValueHitQueue<Entry> queue;public OneComparatorNonScoringCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);this.queue = queue;comparator = queue.getComparators()[0];@@ -114,7 +114,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {OneComparatorNonScoringCollector {public OutOfOrderOneComparatorNonScoringCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);}@@ -161,7 +161,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {Scorer scorer;public OneComparatorScoringNoMaxScoreCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);}@@ -221,8 +221,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {OneComparatorScoringNoMaxScoreCollector {public OutOfOrderOneComparatorScoringNoMaxScoreCollector(- FieldValueHitQueue<Entry> queue, int numHits, boolean fillFields)- throws IOException {+ FieldValueHitQueue<Entry> queue, int numHits, boolean fillFields) {super(queue, numHits, fillFields);}@@ -275,7 +274,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {Scorer scorer;public OneComparatorScoringMaxScoreCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);// Must set maxScore to NEG_INF, or otherwise Math.max always returns NaN.maxScore = Float.NEGATIVE_INFINITY;@@ -335,7 +334,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {OneComparatorScoringMaxScoreCollector {public OutOfOrderOneComparatorScoringMaxScoreCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);}@@ -386,7 +385,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {final int[] reverseMul;final FieldValueHitQueue<Entry> queue;public MultiComparatorNonScoringCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);this.queue = queue;comparators = queue.getComparators();@@ -472,7 +471,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {MultiComparatorNonScoringCollector {public OutOfOrderMultiComparatorNonScoringCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);}@@ -541,7 +540,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {Scorer scorer;public MultiComparatorScoringMaxScoreCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);// Must set maxScore to NEG_INF, or otherwise Math.max always returns NaN.maxScore = Float.NEGATIVE_INFINITY;@@ -620,7 +619,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {extends MultiComparatorScoringMaxScoreCollector {public OutOfOrderMultiComparatorScoringMaxScoreCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);}@@ -693,7 +692,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {Scorer scorer;public MultiComparatorScoringNoMaxScoreCollector(FieldValueHitQueue<Entry> queue,- int numHits, boolean fillFields) throws IOException {+ int numHits, boolean fillFields) {super(queue, numHits, fillFields);}@@ -771,8 +770,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {extends MultiComparatorScoringNoMaxScoreCollector {public OutOfOrderMultiComparatorScoringNoMaxScoreCollector(- FieldValueHitQueue<Entry> queue, int numHits, boolean fillFields)- throws IOException {+ FieldValueHitQueue<Entry> queue, int numHits, boolean fillFields) {super(queue, numHits, fillFields);}@@ -860,8 +858,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {public PagingFieldCollector(FieldValueHitQueue<Entry> queue, FieldDoc after, int numHits, boolean fillFields,- boolean trackDocScores, boolean trackMaxScore)- throws IOException {+ boolean trackDocScores, boolean trackMaxScore) {super(queue, numHits, fillFields);this.queue = queue;this.trackDocScores = trackDocScores;@@ -981,7 +978,7 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {}@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;for (int i = 0; i < comparators.length; i++) {comparators[i].setScorer(scorer);diff --git a/lucene/core/src/java/org/apache/lucene/search/TopTermsRewrite.java b/lucene/core/src/java/org/apache/lucene/search/TopTermsRewrite.javaindex 38ae617f43f..15205ae6004 100644--- a/lucene/core/src/java/org/apache/lucene/search/TopTermsRewrite.java+++ b/lucene/core/src/java/org/apache/lucene/search/TopTermsRewrite.java@@ -75,7 +75,7 @@ public abstract class TopTermsRewrite<Q extends Query> extends TermCollectingRewprivate ScoreTerm st;@Override- public void setNextEnum(TermsEnum termsEnum) throws IOException {+ public void setNextEnum(TermsEnum termsEnum) {this.termsEnum = termsEnum;this.termComp = termsEnum.getComparator();@@ -89,7 +89,7 @@ public abstract class TopTermsRewrite<Q extends Query> extends TermCollectingRew// for assert:private BytesRef lastTerm;- private boolean compareToLastTerm(BytesRef t) throws IOException {+ private boolean compareToLastTerm(BytesRef t) {if (lastTerm == null && t != null) {lastTerm = BytesRef.deepCopyOf(t);} else if (t == null) {diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/NearSpansUnordered.java b/lucene/core/src/java/org/apache/lucene/search/spans/NearSpansUnordered.javaindex d19663eae24..f59e4c03396 100644--- a/lucene/core/src/java/org/apache/lucene/search/spans/NearSpansUnordered.java+++ b/lucene/core/src/java/org/apache/lucene/search/spans/NearSpansUnordered.java@@ -285,7 +285,7 @@ public class NearSpansUnordered extends Spans {}}- private void addToList(SpansCell cell) throws IOException {+ private void addToList(SpansCell cell) {if (last != null) { // add next to end of listlast.next = cell;} else@@ -301,7 +301,7 @@ public class NearSpansUnordered extends Spans {last.next = null;}- private void queueToList() throws IOException {+ private void queueToList() {last = first = null;while (queue.top() != null) {addToList(queue.pop());diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/TermSpans.java b/lucene/core/src/java/org/apache/lucene/search/spans/TermSpans.javaindex d0f965ad203..e109cbf31b2 100644--- a/lucene/core/src/java/org/apache/lucene/search/spans/TermSpans.java+++ b/lucene/core/src/java/org/apache/lucene/search/spans/TermSpans.java@@ -37,7 +37,7 @@ public class TermSpans extends Spans {protected int count;protected int position;- public TermSpans(DocsAndPositionsEnum postings, Term term) throws IOException {+ public TermSpans(DocsAndPositionsEnum postings, Term term) {this.postings = postings;this.term = term;doc = -1;diff --git a/lucene/core/src/java/org/apache/lucene/store/CompoundFileDirectory.java b/lucene/core/src/java/org/apache/lucene/store/CompoundFileDirectory.javaindex 5aa6b2e67d2..bc21cd2c0b6 100644--- a/lucene/core/src/java/org/apache/lucene/store/CompoundFileDirectory.java+++ b/lucene/core/src/java/org/apache/lucene/store/CompoundFileDirectory.java@@ -265,7 +265,7 @@ public final class CompoundFileDirectory extends Directory {}@Override- public void sync(Collection<String> names) throws IOException {+ public void sync(Collection<String> names) {throw new UnsupportedOperationException();}@@ -288,7 +288,7 @@ public final class CompoundFileDirectory extends Directory {}return new IndexInputSlicer() {@Override- public void close() throws IOException {+ public void close() {}@Overridediff --git a/lucene/core/src/java/org/apache/lucene/store/CompoundFileWriter.java b/lucene/core/src/java/org/apache/lucene/store/CompoundFileWriter.javaindex 72623a289e3..e5d32a51064 100644--- a/lucene/core/src/java/org/apache/lucene/store/CompoundFileWriter.java+++ b/lucene/core/src/java/org/apache/lucene/store/CompoundFileWriter.java@@ -31,7 +31,6 @@ import java.util.concurrent.atomic.AtomicBoolean;import org.apache.lucene.codecs.CodecUtil;import org.apache.lucene.index.IndexFileNames;-import org.apache.lucene.index.MergePolicy.MergeAbortedException;import org.apache.lucene.util.IOUtils;/**@@ -78,7 +77,7 @@ final class CompoundFileWriter implements Closeable{* @throws NullPointerException* if <code>dir</code> or <code>name</code> is null*/- CompoundFileWriter(Directory dir, String name) throws IOException {+ CompoundFileWriter(Directory dir, String name) {if (dir == null)throw new NullPointerException("directory cannot be null");if (name == null)@@ -174,7 +173,7 @@ final class CompoundFileWriter implements Closeable{* output stream.*/private final long copyFileEntry(IndexOutput dataOut, FileEntry fileEntry)- throws IOException, MergeAbortedException {+ throws IOException {final IndexInput is = fileEntry.dir.openInput(fileEntry.file, IOContext.READONCE);boolean success = false;try {diff --git a/lucene/core/src/java/org/apache/lucene/store/Directory.java b/lucene/core/src/java/org/apache/lucene/store/Directory.javaindex 763568d132b..622ebdd404d 100644--- a/lucene/core/src/java/org/apache/lucene/store/Directory.java+++ b/lucene/core/src/java/org/apache/lucene/store/Directory.java@@ -230,7 +230,7 @@ public abstract class Directory implements Closeable {base.close();}@Override- public IndexInput openFullSlice() throws IOException {+ public IndexInput openFullSlice() {return (IndexInput) base.clone();}};diff --git a/lucene/core/src/java/org/apache/lucene/store/Lock.java b/lucene/core/src/java/org/apache/lucene/store/Lock.javaindex 097fee6c328..e46089787c1 100644--- a/lucene/core/src/java/org/apache/lucene/store/Lock.java+++ b/lucene/core/src/java/org/apache/lucene/store/Lock.java@@ -67,7 +67,7 @@ public abstract class Lock {* out of bounds* @throws IOException if obtain() throws IOException*/- public boolean obtain(long lockWaitTimeout) throws LockObtainFailedException, IOException {+ public boolean obtain(long lockWaitTimeout) throws IOException {failureReason = null;boolean locked = obtain();if (lockWaitTimeout < 0 && lockWaitTimeout != LOCK_OBTAIN_WAIT_FOREVER)@@ -128,7 +128,7 @@ public abstract class Lock {* be obtained* @throws IOException if {@link Lock#obtain} throws IOException*/- public Object run() throws LockObtainFailedException, IOException {+ public Object run() throws IOException {boolean locked = false;try {locked = lock.obtain(lockWaitTimeout);diff --git a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.javaindex 964708db61c..5f483fc6ba6 100644--- a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java+++ b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java@@ -94,13 +94,13 @@ public class NIOFSDirectory extends FSDirectory {}@Override- public IndexInput openSlice(String sliceDescription, long offset, long length) throws IOException {+ public IndexInput openSlice(String sliceDescription, long offset, long length) {return new NIOFSIndexInput(sliceDescription, path, descriptor, descriptor.getChannel(), offset,length, BufferedIndexInput.bufferSize(context), getReadChunkSize());}@Override- public IndexInput openFullSlice() throws IOException {+ public IndexInput openFullSlice() {return openSlice("full-slice", 0, descriptor.length);}};@@ -117,7 +117,7 @@ public class NIOFSDirectory extends FSDirectory {channel = file.getChannel();}- public NIOFSIndexInput(String sliceDescription, File path, Descriptor file, FileChannel fc, long off, long length, int bufferSize, int chunkSize) throws IOException {+ public NIOFSIndexInput(String sliceDescription, File path, Descriptor file, FileChannel fc, long off, long length, int bufferSize, int chunkSize) {super("NIOFSIndexInput(" + sliceDescription + " in path=\"" + path + "\" slice=" + off + ":" + (off+length) + ")", file, off, length, bufferSize, chunkSize);channel = fc;isClone = true;diff --git a/lucene/core/src/java/org/apache/lucene/store/NativeFSLockFactory.java b/lucene/core/src/java/org/apache/lucene/store/NativeFSLockFactory.javaindex 0316081f05a..9d55ee8ece3 100755--- a/lucene/core/src/java/org/apache/lucene/store/NativeFSLockFactory.java+++ b/lucene/core/src/java/org/apache/lucene/store/NativeFSLockFactory.java@@ -63,7 +63,7 @@ public class NativeFSLockFactory extends FSLockFactory {* directory itself. Be sure to create one instance for each directory* your create!*/- public NativeFSLockFactory() throws IOException {+ public NativeFSLockFactory() {this((File) null);}@@ -73,7 +73,7 @@ public class NativeFSLockFactory extends FSLockFactory {** @param lockDirName where lock files are created.*/- public NativeFSLockFactory(String lockDirName) throws IOException {+ public NativeFSLockFactory(String lockDirName) {this(new File(lockDirName));}@@ -83,7 +83,7 @@ public class NativeFSLockFactory extends FSLockFactory {** @param lockDir where lock files are created.*/- public NativeFSLockFactory(File lockDir) throws IOException {+ public NativeFSLockFactory(File lockDir) {setLockDir(lockDir);}diff --git a/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.java b/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.javaindex 445f3f23869..c7eceaed843 100644--- a/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.java+++ b/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.java@@ -147,7 +147,7 @@ public class RAMOutputStream extends IndexOutput {}}- private final void switchCurrentBuffer() throws IOException {+ private final void switchCurrentBuffer() {if (currentBufferIndex == file.numBuffers()) {currentBuffer = file.addBuffer(BUFFER_SIZE);} else {diff --git a/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.javaindex d83c2885f52..e2deb92892a 100644--- a/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java+++ b/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java@@ -73,13 +73,13 @@ public class SimpleFSDirectory extends FSDirectory {}@Override- public IndexInput openSlice(String sliceDescription, long offset, long length) throws IOException {+ public IndexInput openSlice(String sliceDescription, long offset, long length) {return new SimpleFSIndexInput("SimpleFSIndexInput(" + sliceDescription + " in path=\"" + file.getPath() + "\" slice=" + offset + ":" + (offset+length) + ")", descriptor, offset,length, BufferedIndexInput.bufferSize(context), getReadChunkSize());}@Override- public IndexInput openFullSlice() throws IOException {+ public IndexInput openFullSlice() {return openSlice("full-slice", 0, descriptor.length);}};@@ -124,7 +124,7 @@ public class SimpleFSDirectory extends FSDirectory {this.end = file.length;}- public SimpleFSIndexInput(String resourceDesc, Descriptor file, long off, long length, int bufferSize, int chunkSize) throws IOException {+ public SimpleFSIndexInput(String resourceDesc, Descriptor file, long off, long length, int bufferSize, int chunkSize) {super(resourceDesc, bufferSize);this.file = file;this.chunkSize = chunkSize;diff --git a/lucene/core/src/java/org/apache/lucene/store/SimpleFSLockFactory.java b/lucene/core/src/java/org/apache/lucene/store/SimpleFSLockFactory.javaindex 34bd121ca72..44ac8bf3587 100755--- a/lucene/core/src/java/org/apache/lucene/store/SimpleFSLockFactory.java+++ b/lucene/core/src/java/org/apache/lucene/store/SimpleFSLockFactory.java@@ -60,7 +60,7 @@ public class SimpleFSLockFactory extends FSLockFactory {* directory itself. Be sure to create one instance for each directory* your create!*/- public SimpleFSLockFactory() throws IOException {+ public SimpleFSLockFactory() {this((File) null);}@@ -68,7 +68,7 @@ public class SimpleFSLockFactory extends FSLockFactory {* Instantiate using the provided directory (as a File instance).* @param lockDir where lock files should be created.*/- public SimpleFSLockFactory(File lockDir) throws IOException {+ public SimpleFSLockFactory(File lockDir) {setLockDir(lockDir);}@@ -76,7 +76,7 @@ public class SimpleFSLockFactory extends FSLockFactory {* Instantiate using the provided directory name (String).* @param lockDirName where lock files should be created.*/- public SimpleFSLockFactory(String lockDirName) throws IOException {+ public SimpleFSLockFactory(String lockDirName) {setLockDir(new File(lockDirName));}diff --git a/lucene/core/src/java/org/apache/lucene/store/VerifyingLockFactory.java b/lucene/core/src/java/org/apache/lucene/store/VerifyingLockFactory.javaindex 623c076adf1..9bc5e32950f 100644--- a/lucene/core/src/java/org/apache/lucene/store/VerifyingLockFactory.java+++ b/lucene/core/src/java/org/apache/lucene/store/VerifyingLockFactory.java@@ -69,8 +69,7 @@ public class VerifyingLockFactory extends LockFactory {}@Override- public synchronized boolean obtain(long lockWaitTimeout)- throws LockObtainFailedException, IOException {+ public synchronized boolean obtain(long lockWaitTimeout) throws IOException {boolean obtained = lock.obtain(lockWaitTimeout);if (obtained)verify((byte) 1);@@ -78,8 +77,7 @@ public class VerifyingLockFactory extends LockFactory {}@Override- public synchronized boolean obtain()- throws LockObtainFailedException, IOException {+ public synchronized boolean obtain() throws IOException {return lock.obtain();}@@ -105,7 +103,7 @@ public class VerifyingLockFactory extends LockFactory {* @param port the port {@link LockVerifyServer} islistening on*/- public VerifyingLockFactory(byte id, LockFactory lf, String host, int port) throws IOException {+ public VerifyingLockFactory(byte id, LockFactory lf, String host, int port) {this.id = id;this.lf = lf;this.host = host;diff --git a/lucene/core/src/java/org/apache/lucene/util/BytesRefIterator.java b/lucene/core/src/java/org/apache/lucene/util/BytesRefIterator.javaindex 2bdac21f454..57d7df7e221 100644--- a/lucene/core/src/java/org/apache/lucene/util/BytesRefIterator.java+++ b/lucene/core/src/java/org/apache/lucene/util/BytesRefIterator.java@@ -50,7 +50,7 @@ public interface BytesRefIterator {public static final BytesRefIterator EMPTY = new BytesRefIterator() {@Override- public BytesRef next() throws IOException {+ public BytesRef next() {return null;}diff --git a/lucene/core/src/java/org/apache/lucene/util/PagedBytes.java b/lucene/core/src/java/org/apache/lucene/util/PagedBytes.javaindex 12b682f296d..b35478360ae 100644--- a/lucene/core/src/java/org/apache/lucene/util/PagedBytes.java+++ b/lucene/core/src/java/org/apache/lucene/util/PagedBytes.java@@ -288,7 +288,7 @@ public final class PagedBytes {}/** Copy BytesRef in */- public void copy(BytesRef bytes) throws IOException {+ public void copy(BytesRef bytes) {int byteCount = bytes.length;int bytesUpto = bytes.offset;while (byteCount > 0) {@@ -318,7 +318,7 @@ public final class PagedBytes {/** Copy BytesRef in, setting BytesRef out to the result.* Do not use this if you will use freeze(true).* This only supports bytes.length <= blockSize */- public void copy(BytesRef bytes, BytesRef out) throws IOException {+ public void copy(BytesRef bytes, BytesRef out) {int left = blockSize - upto;if (bytes.length > left || currentBlock==null) {if (currentBlock != null) {@@ -374,7 +374,7 @@ public final class PagedBytes {/** Copy bytes in, writing the length as a 1 or 2 byte* vInt prefix. */- public long copyUsingLengthPrefix(BytesRef bytes) throws IOException {+ public long copyUsingLengthPrefix(BytesRef bytes) {if (bytes.length >= 32768) {throw new IllegalArgumentException("max length is 32767 (got " + bytes.length + ")");}@@ -488,7 +488,7 @@ public final class PagedBytes {}@Override- public void writeBytes(byte[] b, int offset, int length) throws IOException {+ public void writeBytes(byte[] b, int offset, int length) {assert b.length >= offset + length;if (length == 0) {return;diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/DirectPackedReader.java b/lucene/core/src/java/org/apache/lucene/util/packed/DirectPackedReader.javaindex 309849fa4c8..8a7e75d6c19 100644--- a/lucene/core/src/java/org/apache/lucene/util/packed/DirectPackedReader.java+++ b/lucene/core/src/java/org/apache/lucene/util/packed/DirectPackedReader.java@@ -32,8 +32,7 @@ final class DirectPackedReader extends PackedInts.ReaderImpl {// masks[n-1] masks for bottom n bitsprivate final long[] masks;- public DirectPackedReader(int bitsPerValue, int valueCount, IndexInput in)- throws IOException {+ public DirectPackedReader(int bitsPerValue, int valueCount, IndexInput in) {super(valueCount, bitsPerValue);this.in = in;diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlockReaderIterator.java b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlockReaderIterator.javaindex 03e2c0e6474..37e4da78f0c 100644--- a/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlockReaderIterator.java+++ b/lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlockReaderIterator.java@@ -29,8 +29,7 @@ final class Packed64SingleBlockReaderIterator extends ReaderIteratorImpl {private final long mask;private int position;- Packed64SingleBlockReaderIterator(int valueCount, int bitsPerValue, IndexInput in)- throws IOException {+ Packed64SingleBlockReaderIterator(int valueCount, int bitsPerValue, IndexInput in) {super(valueCount, bitsPerValue, in);pending = 0;shift = 64;diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/PackedReaderIterator.java b/lucene/core/src/java/org/apache/lucene/util/packed/PackedReaderIterator.javaindex 86094536062..bbfc79221b6 100644--- a/lucene/core/src/java/org/apache/lucene/util/packed/PackedReaderIterator.java+++ b/lucene/core/src/java/org/apache/lucene/util/packed/PackedReaderIterator.java@@ -29,8 +29,7 @@ final class PackedReaderIterator extends PackedInts.ReaderIteratorImpl {// masks[n-1] masks for bottom n bitsprivate final long[] masks;- public PackedReaderIterator(int valueCount, int bitsPerValue, IndexInput in)- throws IOException {+ public PackedReaderIterator(int valueCount, int bitsPerValue, IndexInput in) {super(valueCount, bitsPerValue, in);masks = new long[bitsPerValue];diff --git a/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java b/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.javaindex d57f2dc12da..c563397b015 100644--- a/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java+++ b/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java@@ -22,7 +22,6 @@ import org.apache.lucene.util.LuceneTestCase;import org.apache.lucene.store.Directory;import org.apache.lucene.store.MockDirectoryWrapper;import org.apache.lucene.store.RAMDirectory;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.IndexWriter;import org.apache.lucene.index.IndexWriterConfig;import org.apache.lucene.index.LogMergePolicy;@@ -47,7 +46,7 @@ public class TestMergeSchedulerExternal extends LuceneTestCase {private class MyMergeScheduler extends ConcurrentMergeScheduler {private class MyMergeThread extends ConcurrentMergeScheduler.MergeThread {- public MyMergeThread(IndexWriter writer, MergePolicy.OneMerge merge) throws IOException {+ public MyMergeThread(IndexWriter writer, MergePolicy.OneMerge merge) {super(writer, merge);mergeThreadCreated = true;}@@ -114,7 +113,7 @@ public class TestMergeSchedulerExternal extends LuceneTestCase {private static class ReportingMergeScheduler extends MergeScheduler {@Override- public void merge(IndexWriter writer) throws CorruptIndexException, IOException {+ public void merge(IndexWriter writer) throws IOException {OneMerge merge = null;while ((merge = writer.getNextMerge()) != null) {if (VERBOSE) {@@ -125,7 +124,7 @@ public class TestMergeSchedulerExternal extends LuceneTestCase {}@Override- public void close() throws CorruptIndexException, IOException {}+ public void close() throws IOException {}}diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java b/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.javaindex 1960a3fe680..818d471c12c 100644--- a/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java+++ b/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java@@ -45,7 +45,7 @@ public class TestCachingTokenFilter extends BaseTokenStreamTestCase {private OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (index == tokens.length) {return false;} else {diff --git a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat.javaindex 7fc4e753293..05d43e753e8 100644--- a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat.java+++ b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat.java@@ -30,7 +30,6 @@ import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;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;@@ -189,7 +188,7 @@ public class TestPerFieldPostingsFormat extends LuceneTestCase {}public void assertQuery(Term t, Directory dir, int num)- throws CorruptIndexException, IOException {+ throws IOException {if (VERBOSE) {System.out.println("\nTEST: assertQuery " + t);}diff --git a/lucene/core/src/test/org/apache/lucene/index/BinaryTokenStream.java b/lucene/core/src/test/org/apache/lucene/index/BinaryTokenStream.javaindex 96b4d546996..21ff12b293a 100644--- a/lucene/core/src/test/org/apache/lucene/index/BinaryTokenStream.java+++ b/lucene/core/src/test/org/apache/lucene/index/BinaryTokenStream.java@@ -17,8 +17,6 @@ package org.apache.lucene.index;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.analysis.TokenStream;import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;import org.apache.lucene.util.AttributeImpl;@@ -36,7 +34,7 @@ public final class BinaryTokenStream extends TokenStream {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (available) {available = false;return true;@@ -45,7 +43,7 @@ public final class BinaryTokenStream extends TokenStream {}@Override- public void reset() throws IOException {+ public void reset() {available = true;}diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java b/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.javaindex 41d02f0856a..ed3e83a0a7d 100644--- a/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java@@ -17,8 +17,6 @@ package org.apache.lucene.index;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.analysis.TokenStream;import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;@@ -94,7 +92,7 @@ public class Test2BPostings extends LuceneTestCase {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (index <= 'z') {buffer[0] = (char) index++;return true;@@ -103,7 +101,7 @@ public class Test2BPostings extends LuceneTestCase {}@Override- public void reset() throws IOException {+ public void reset() {index = 'a';}}diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java b/lucene/core/src/test/org/apache/lucene/index/TestCodecs.javaindex 59ba76b28a8..3f55f237d5d 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java@@ -76,7 +76,7 @@ public class TestCodecs extends LuceneTestCase {private final static int TERM_DOC_FREQ_RAND = 20;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {NUM_TEST_ITER = atLeast(20);}diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.javaindex 666174210f3..7d9bc3c8262 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java@@ -44,7 +44,7 @@ import org.apache.lucene.util._TestUtil;public class TestDeletionPolicy extends LuceneTestCase {- private void verifyCommitOrder(List<? extends IndexCommit> commits) throws IOException {+ private void verifyCommitOrder(List<? extends IndexCommit> commits) {final IndexCommit firstCommit = commits.get(0);long last = SegmentInfos.generationFromSegmentsFileName(firstCommit.getSegmentsFileName());assertEquals(last, firstCommit.getGeneration());diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.javaindex 18d5c5e566d..f9d3bf3afcf 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java@@ -39,7 +39,6 @@ import org.apache.lucene.index.IndexWriterConfig.OpenMode;import org.apache.lucene.search.DocIdSetIterator;import org.apache.lucene.search.FieldCache;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.store.NoSuchDirectoryException;import org.apache.lucene.util.Bits;import org.apache.lucene.util.BytesRef;@@ -1003,7 +1002,7 @@ public void testFilesOpenClose() throws IOException {dir.close();}- public void testTryIncRef() throws CorruptIndexException, LockObtainFailedException, IOException {+ public void testTryIncRef() throws IOException {Directory dir = newDirectory();IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));writer.addDocument(new Document());@@ -1017,7 +1016,7 @@ public void testFilesOpenClose() throws IOException {dir.close();}- public void testStressTryIncRef() throws CorruptIndexException, LockObtainFailedException, IOException, InterruptedException {+ public void testStressTryIncRef() throws IOException, InterruptedException {Directory dir = newDirectory();IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));writer.addDocument(new Document());diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.javaindex 7b103bd796e..253908e6ba7 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java@@ -18,8 +18,17 @@ package org.apache.lucene.index;*/import java.io.Closeable;import java.io.IOException;-import java.util.*;+import java.util.ArrayList;+import java.util.Arrays;+import java.util.Collections;+import java.util.EnumSet;+import java.util.HashMap;+import java.util.HashSet;+import java.util.List;+import java.util.Map;import java.util.Map.Entry;+import java.util.Random;+import java.util.Set;import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.document.ByteDocValuesField;@@ -39,9 +48,14 @@ import org.apache.lucene.document.TextField;import org.apache.lucene.index.DocValues.SortedSource;import org.apache.lucene.index.DocValues.Source;import org.apache.lucene.index.DocValues.Type;-import org.apache.lucene.search.*;+import org.apache.lucene.search.BooleanClause;+import org.apache.lucene.search.BooleanQuery;+import org.apache.lucene.search.DocIdSetIterator;+import org.apache.lucene.search.IndexSearcher;+import org.apache.lucene.search.ScoreDoc;+import org.apache.lucene.search.TermQuery;+import org.apache.lucene.search.TopDocs;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.BytesRefHash;import org.apache.lucene.util.FixedBitSet;@@ -62,7 +76,7 @@ public class TestDocValuesIndexing extends LuceneTestCase {/** Simple test case to show how to use the API*/- public void testDocValuesSimple() throws CorruptIndexException, IOException {+ public void testDocValuesSimple() throws IOException {Directory dir = newDirectory();IndexWriter writer = new IndexWriter(dir, writerConfig(false));for (int i = 0; i < 5; i++) {@@ -357,7 +371,7 @@ public class TestDocValuesIndexing extends LuceneTestCase {}public void runTestIndexBytes(IndexWriterConfig cfg, boolean withDeletions)- throws CorruptIndexException, LockObtainFailedException, IOException {+ throws IOException {final Directory d = newDirectory();IndexWriter w = new IndexWriter(d, cfg);final List<Type> byteVariantList = new ArrayList<Type>(BYTES);@@ -443,7 +457,7 @@ public class TestDocValuesIndexing extends LuceneTestCase {d.close();}- public void testGetArrayNumerics() throws CorruptIndexException, IOException {+ public void testGetArrayNumerics() throws IOException {Directory d = newDirectory();IndexWriterConfig cfg = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));IndexWriter w = new IndexWriter(d, cfg);@@ -525,7 +539,7 @@ public class TestDocValuesIndexing extends LuceneTestCase {d.close();}- public void testGetArrayBytes() throws CorruptIndexException, IOException {+ public void testGetArrayBytes() throws IOException {Directory d = newDirectory();IndexWriterConfig cfg = newIndexWriterConfig(TEST_VERSION_CURRENT,new MockAnalyzer(random()));@@ -596,7 +610,7 @@ public class TestDocValuesIndexing extends LuceneTestCase {private FixedBitSet indexValues(IndexWriter w, int numValues, Type valueType,List<Type> valueVarList, boolean withDeletions, int bytesSize)- throws CorruptIndexException, IOException {+ throws IOException {final boolean isNumeric = NUMERICS.contains(valueType);FixedBitSet deleted = new FixedBitSet(numValues);Document doc = new Document();diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesTypeCompatibility.java b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesTypeCompatibility.javaindex ca03e788d46..618e05780f8 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesTypeCompatibility.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesTypeCompatibility.java@@ -33,7 +33,6 @@ import org.apache.lucene.document.SortedBytesDocValuesField;import org.apache.lucene.document.StraightBytesDocValuesField;import org.apache.lucene.index.DocValues.Type;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.LuceneTestCase;@@ -42,8 +41,7 @@ import org.apache.lucene.util.LuceneTestCase;*/public class TestDocValuesTypeCompatibility extends LuceneTestCase {- public void testAddCompatibleIntTypes() throws CorruptIndexException,- LockObtainFailedException, IOException {+ public void testAddCompatibleIntTypes() throws IOException {int numIter = atLeast(10);for (int i = 0; i < numIter; i++) {Directory dir = newDirectory();@@ -97,8 +95,7 @@ public class TestDocValuesTypeCompatibility extends LuceneTestCase {}}- public void testAddCompatibleDoubleTypes() throws CorruptIndexException,- LockObtainFailedException, IOException {+ public void testAddCompatibleDoubleTypes() throws IOException {int numIter = atLeast(10);for (int i = 0; i < numIter; i++) {Directory dir = newDirectory();@@ -151,8 +148,7 @@ public class TestDocValuesTypeCompatibility extends LuceneTestCase {}}- public void testAddCompatibleDoubleTypes2() throws CorruptIndexException,- LockObtainFailedException, IOException {+ public void testAddCompatibleDoubleTypes2() throws IOException {int numIter = atLeast(10);for (int i = 0; i < numIter; i++) {Directory dir = newDirectory();@@ -183,8 +179,7 @@ public class TestDocValuesTypeCompatibility extends LuceneTestCase {}- public void testAddCompatibleByteTypes() throws CorruptIndexException,- LockObtainFailedException, IOException {+ public void testAddCompatibleByteTypes() throws IOException {int numIter = atLeast(10);for (int i = 0; i < numIter; i++) {Directory dir = newDirectory();@@ -262,7 +257,7 @@ public class TestDocValuesTypeCompatibility extends LuceneTestCase {}private void addDoc(IndexWriter writer, IndexableField... fields)- throws CorruptIndexException, IOException {+ throws IOException {Document doc = new Document();for (IndexableField indexableField : fields) {doc.add(indexableField);diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.javaindex 201d32eb5f5..11445dda98a 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java@@ -226,7 +226,7 @@ public class TestDocumentWriter extends LuceneTestCase {private CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (index == tokens.length) {return false;} else {diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java b/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.javaindex 64b599da6cb..5bbc43ad547 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java@@ -115,7 +115,7 @@ public class TestFieldsReader extends LuceneTestCase {Directory fsDir;- public FaultyFSDirectory(File dir) throws IOException {+ public FaultyFSDirectory(File dir) {fsDir = newFSDirectory(dir);lockFactory = fsDir.getLockFactory();}diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFilterAtomicReader.java b/lucene/core/src/test/org/apache/lucene/index/TestFilterAtomicReader.javaindex dcbdf1d1941..376a7a493aa 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestFilterAtomicReader.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestFilterAtomicReader.java@@ -175,7 +175,7 @@ public class TestFilterAtomicReader extends LuceneTestCase {target.close();}- private void checkOverrideMethods(Class<?> clazz) throws Exception {+ private void checkOverrideMethods(Class<?> clazz) {boolean fail = false;for (Method m : clazz.getMethods()) {int mods = m.getModifiers();diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.javaindex f1059b73ad5..4f0929ef96d 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java@@ -26,7 +26,6 @@ import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.document.Document;import org.apache.lucene.index.DocumentsWriterPerThreadPool.ThreadState;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.store.MockDirectoryWrapper;import org.apache.lucene.util.LineFileDocs;import org.apache.lucene.util.LuceneTestCase;@@ -48,22 +47,19 @@ public class TestFlushByRamOrCountsPolicy extends LuceneTestCase {lineDocFile = null;}- public void testFlushByRam() throws CorruptIndexException,- LockObtainFailedException, IOException, InterruptedException {+ public void testFlushByRam() throws IOException, InterruptedException {final double ramBuffer = (TEST_NIGHTLY ? 1 : 10) + atLeast(2)+ random().nextDouble();runFlushByRam(1 + random().nextInt(TEST_NIGHTLY ? 5 : 1), ramBuffer, false);}- public void testFlushByRamLargeBuffer() throws CorruptIndexException,- LockObtainFailedException, IOException, InterruptedException {+ public void testFlushByRamLargeBuffer() throws IOException, InterruptedException {// with a 256 mb ram buffer we should never stallrunFlushByRam(1 + random().nextInt(TEST_NIGHTLY ? 5 : 1), 256.d, true);}protected void runFlushByRam(int numThreads, double maxRamMB,- boolean ensureNotStalled) throws IOException, CorruptIndexException,- LockObtainFailedException, InterruptedException {+ boolean ensureNotStalled) throws IOException, InterruptedException {final int numDocumentsToIndex = 10 + atLeast(30);AtomicInteger numDocs = new AtomicInteger(numDocumentsToIndex);Directory dir = newDirectory();@@ -116,8 +112,7 @@ public class TestFlushByRamOrCountsPolicy extends LuceneTestCase {dir.close();}- public void testFlushDocCount() throws CorruptIndexException,- LockObtainFailedException, IOException, InterruptedException {+ public void testFlushDocCount() throws IOException, InterruptedException {int[] numThreads = new int[] { 2 + atLeast(1), 1 };for (int i = 0; i < numThreads.length; i++) {@@ -230,8 +225,7 @@ public class TestFlushByRamOrCountsPolicy extends LuceneTestCase {dir.close();}- public void testStallControl() throws InterruptedException,- CorruptIndexException, LockObtainFailedException, IOException {+ public void testStallControl() throws InterruptedException, IOException {int[] numThreads = new int[] { 4 + random().nextInt(8), 1 };final int numDocumentsToIndex = 50 + random().nextInt(50);diff --git a/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java b/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.javaindex 666e8f8bc2e..80ead166b1b 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java@@ -40,7 +40,7 @@ public class TestForceMergeForever extends LuceneTestCase {}@Override- public void merge(MergePolicy.OneMerge merge) throws CorruptIndexException, IOException {+ public void merge(MergePolicy.OneMerge merge) throws IOException {if (merge.maxNumSegments != -1 && (first || merge.segments.size() == 1)) {first = false;if (VERBOSE) {diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexCommit.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexCommit.javaindex 63c903537a4..fda37cf0abc 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexCommit.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexCommit.java@@ -17,7 +17,6 @@ package org.apache.lucene.index;* limitations under the License.*/-import java.io.IOException;import java.util.Collection;import java.util.Map;@@ -35,10 +34,10 @@ public class TestIndexCommit extends LuceneTestCase {IndexCommit ic1 = new IndexCommit() {@Override public String getSegmentsFileName() { return "a"; }@Override public Directory getDirectory() { return dir; }- @Override public Collection<String> getFileNames() throws IOException { return null; }+ @Override public Collection<String> getFileNames() { return null; }@Override public void delete() {}@Override public long getGeneration() { return 0; }- @Override public Map<String, String> getUserData() throws IOException { return null; }+ @Override public Map<String, String> getUserData() { return null; }@Override public boolean isDeleted() { return false; }@Override public int getSegmentCount() { return 2; }};@@ -46,10 +45,10 @@ public class TestIndexCommit extends LuceneTestCase {IndexCommit ic2 = new IndexCommit() {@Override public String getSegmentsFileName() { return "b"; }@Override public Directory getDirectory() { return dir; }- @Override public Collection<String> getFileNames() throws IOException { return null; }+ @Override public Collection<String> getFileNames() { return null; }@Override public void delete() {}@Override public long getGeneration() { return 0; }- @Override public Map<String, String> getUserData() throws IOException { return null; }+ @Override public Map<String, String> getUserData() { return null; }@Override public boolean isDeleted() { return false; }@Override public int getSegmentCount() { return 2; }};diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.javaindex bf1a9f77722..195c455f182 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java@@ -820,7 +820,7 @@ public class TestIndexWriter extends LuceneTestCase {}@Override- protected void doBeforeFlush() throws IOException {+ protected void doBeforeFlush() {beforeWasCalled = true;}}@@ -1527,7 +1527,7 @@ public class TestIndexWriter extends LuceneTestCase {}@Override- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {clearAttributes();if (upto < tokens.length) {termAtt.setEmpty();diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.javaindex c37d3d8f672..50a0480dc7d 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java@@ -983,7 +983,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {}@Override- public void close() throws IOException {}+ public void close() {}}));try {diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.javaindex 1995045f966..114f583f1d3 100755--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java@@ -227,7 +227,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase {writer.addDocument(doc);}- private void checkInvariants(IndexWriter writer) throws IOException {+ private void checkInvariants(IndexWriter writer) {writer.waitForMerges();int maxBufferedDocs = writer.getConfig().getMaxBufferedDocs();int mergeFactor = ((LogMergePolicy) writer.getConfig().getMergePolicy()).getMergeFactor();diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.javaindex 3a759daa6c3..d07a7756f5f 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java@@ -312,7 +312,7 @@ public class TestIndexWriterMerging extends LuceneTestCaseprivate class MyMergeScheduler extends MergeScheduler {@Overridesynchronized public void merge(IndexWriter writer)- throws CorruptIndexException, IOException {+ throws IOException {while(true) {MergePolicy.OneMerge merge = writer.getNextMerge();diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.javaindex b86a416277a..da6c43fffa6 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java@@ -25,7 +25,6 @@ import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.document.TextField;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.LuceneTestCase;@@ -36,8 +35,8 @@ public class TestIndexWriterNRTIsCurrent extends LuceneTestCase {volatile boolean stop = false;}- public void testIsCurrentWithThreads() throws CorruptIndexException,- LockObtainFailedException, IOException, InterruptedException {+ public void testIsCurrentWithThreads() throws+ IOException, InterruptedException {Directory dir = newDirectory();IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT,new MockAnalyzer(random()));diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNorms.java b/lucene/core/src/test/org/apache/lucene/index/TestNorms.javaindex 320acd0c97f..186bc7a572a 100755--- a/lucene/core/src/test/org/apache/lucene/index/TestNorms.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestNorms.java@@ -175,8 +175,7 @@ public class TestNorms extends LuceneTestCase {otherDir.close();}- public void buildIndex(Directory dir, boolean writeNorms) throws IOException,- CorruptIndexException {+ public void buildIndex(Directory dir, boolean writeNorms) throws IOException {Random random = random();IndexWriterConfig config = newIndexWriterConfig(TEST_VERSION_CURRENT,new MockAnalyzer(random()));diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPayloadProcessorProvider.java b/lucene/core/src/test/org/apache/lucene/index/TestPayloadProcessorProvider.javaindex 2ab4fdc579b..ecf4703006e 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestPayloadProcessorProvider.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestPayloadProcessorProvider.java@@ -50,7 +50,7 @@ public class TestPayloadProcessorProvider extends LuceneTestCase {}@Override- public ReaderPayloadProcessor getReaderProcessor(AtomicReader reader) throws IOException {+ public ReaderPayloadProcessor getReaderProcessor(AtomicReader reader) {if (reader instanceof SegmentReader) {return processors.get(((SegmentReader) reader).directory());} else {@@ -63,7 +63,7 @@ public class TestPayloadProcessorProvider extends LuceneTestCase {private static final class PerTermPayloadProcessor extends ReaderPayloadProcessor {@Override- public PayloadProcessor getProcessor(String field, BytesRef text) throws IOException {+ public PayloadProcessor getProcessor(String field, BytesRef text) {// don't process payloads of terms other than "p:p1"if (!field.equals("p") || !text.bytesEquals(new BytesRef("p1"))) {return null;@@ -79,7 +79,7 @@ public class TestPayloadProcessorProvider extends LuceneTestCase {private static final class DeletePayloadProcessor extends PayloadProcessor {@Override- public void processPayload(BytesRef payload) throws IOException {+ public void processPayload(BytesRef payload) {payload.length = 0;}@@ -98,7 +98,7 @@ public class TestPayloadProcessorProvider extends LuceneTestCase {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (called) {return false;}diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java b/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.javaindex 79ddbfb3281..375bd57e4e4 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java@@ -258,7 +258,7 @@ public class TestPerSegmentDeletes extends LuceneTestCase {@Overridepublic MergeSpecification findMerges(SegmentInfos segmentInfos)- throws CorruptIndexException, IOException {+ throws IOException {MergeSpecification ms = new MergeSpecification();if (doMerge) {OneMerge om = new OneMerge(segmentInfos.asList().subList(start, start + length));@@ -272,13 +272,13 @@ public class TestPerSegmentDeletes extends LuceneTestCase {@Overridepublic MergeSpecification findForcedMerges(SegmentInfos segmentInfos,int maxSegmentCount, Map<SegmentInfoPerCommit,Boolean> segmentsToMerge)- throws CorruptIndexException, IOException {+ throws IOException {return null;}@Overridepublic MergeSpecification findForcedDeletesMerges(- SegmentInfos segmentInfos) throws CorruptIndexException, IOException {+ SegmentInfos segmentInfos) throws IOException {return null;}diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java b/lucene/core/src/test/org/apache/lucene/index/TestSameTokenSamePosition.javaindex c19176cb8ab..5d627f13fe4 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java@@ -72,7 +72,7 @@ final class BugReproTokenStream extends TokenStream {private final int incs[] = new int[]{1, 0, 1, 0};@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (nextTokenIndex < tokenCount) {termAtt.setEmpty().append(terms[nextTokenIndex]);offsetAtt.setOffset(starts[nextTokenIndex], ends[nextTokenIndex]);diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java b/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.javaindex 1dae6589884..9ca95c9cc9d 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java@@ -43,7 +43,7 @@ public class TestSizeBoundedForceMerge extends LuceneTestCase {writer.commit();}- private static IndexWriterConfig newWriterConfig() throws IOException {+ private static IndexWriterConfig newWriterConfig() {IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, null);conf.setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);conf.setRAMBufferSizeMB(IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB);diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java b/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.javaindex 70e67b3da70..f5dbcd009c2 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java@@ -68,8 +68,7 @@ public class TestTypePromotion extends LuceneTestCase {Int, Float, Byte}- private void runTest(EnumSet<Type> types, TestType type)- throws CorruptIndexException, IOException {+ private void runTest(EnumSet<Type> types, TestType type) throws IOException {Directory dir = newDirectory();IndexWriter writer = new IndexWriter(dir,newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));@@ -119,7 +118,7 @@ public class TestTypePromotion extends LuceneTestCase {private void assertValues(TestType type, Directory dir, long[] values, Type[] sourceType)- throws CorruptIndexException, IOException {+ throws IOException {DirectoryReader reader = DirectoryReader.open(dir);assertEquals(1, reader.getSequentialSubReaders().size());IndexReaderContext topReaderContext = reader.getTopReaderContext();@@ -181,7 +180,7 @@ public class TestTypePromotion extends LuceneTestCase {public void index(IndexWriter writer,Type valueType, long[] values, Type[] sourceTypes, int offset, int num)- throws CorruptIndexException, IOException {+ throws IOException {final Field valField;if (VERBOSE) {@@ -322,8 +321,7 @@ public class TestTypePromotion extends LuceneTestCase {runTest(INTEGERS, TestType.Int);}- public void testPromotFloatingPoint() throws CorruptIndexException,- IOException {+ public void testPromotFloatingPoint() throws IOException {runTest(FLOATS, TestType.Float);}diff --git a/lucene/core/src/test/org/apache/lucene/search/BaseTestRangeFilter.java b/lucene/core/src/test/org/apache/lucene/search/BaseTestRangeFilter.javaindex 21b8cf35326..72da35be7d8 100644--- a/lucene/core/src/test/org/apache/lucene/search/BaseTestRangeFilter.java+++ b/lucene/core/src/test/org/apache/lucene/search/BaseTestRangeFilter.java@@ -54,9 +54,7 @@ public class BaseTestRangeFilter extends LuceneTestCase {this.minR = minR;this.maxR = maxR;this.allowNegativeRandomInts = allowNegativeRandomInts;- try {- index = newDirectory(random);- } catch (IOException e) { throw new RuntimeException(e); }+ index = newDirectory(random);}}diff --git a/lucene/core/src/test/org/apache/lucene/search/FieldCacheRewriteMethod.java b/lucene/core/src/test/org/apache/lucene/search/FieldCacheRewriteMethod.javaindex ba84a6b1055..861a79b0746 100644--- a/lucene/core/src/test/org/apache/lucene/search/FieldCacheRewriteMethod.java+++ b/lucene/core/src/test/org/apache/lucene/search/FieldCacheRewriteMethod.java@@ -94,12 +94,12 @@ public final class FieldCacheRewriteMethod extends MultiTermQuery.RewriteMethodTermsEnum termsEnum = query.getTermsEnum(new Terms() {@Override- public Comparator<BytesRef> getComparator() throws IOException {+ public Comparator<BytesRef> getComparator() {return BytesRef.getUTF8SortedAsUnicodeComparator();}@Override- public TermsEnum iterator(TermsEnum reuse) throws IOException {+ public TermsEnum iterator(TermsEnum reuse) {return fcsi.getTermsEnum();}@@ -109,17 +109,17 @@ public final class FieldCacheRewriteMethod extends MultiTermQuery.RewriteMethod}@Override- public long getSumDocFreq() throws IOException {+ public long getSumDocFreq() {return -1;}@Override- public int getDocCount() throws IOException {+ public int getDocCount() {return -1;}@Override- public long size() throws IOException {+ public long size() {return -1;}});diff --git a/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java b/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.javaindex e73f55ee7c3..d631892d34e 100644--- a/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java+++ b/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java@@ -17,8 +17,6 @@ package org.apache.lucene.search;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.index.AtomicReaderContext;import org.apache.lucene.index.Norm;import org.apache.lucene.search.similarities.Similarity;@@ -41,18 +39,17 @@ final class JustCompileSearch {static final class JustCompileCollector extends Collector {@Override- public void collect(int doc) throws IOException {+ public void collect(int doc) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public void setNextReader(AtomicReaderContext context)- throws IOException {+ public void setNextReader(AtomicReaderContext context) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -66,7 +63,7 @@ final class JustCompileSearch {static final class JustCompileDocIdSet extends DocIdSet {@Override- public DocIdSetIterator iterator() throws IOException {+ public DocIdSetIterator iterator() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -80,12 +77,12 @@ final class JustCompileSearch {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}}@@ -114,12 +111,12 @@ final class JustCompileSearch {}@Override- public int compareBottom(int doc) throws IOException {+ public int compareBottom(int doc) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public void copy(int slot, int doc) throws IOException {+ public void copy(int slot, int doc) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -129,8 +126,7 @@ final class JustCompileSearch {}@Override- public FieldComparator<Object> setNextReader(AtomicReaderContext context)- throws IOException {+ public FieldComparator<Object> setNextReader(AtomicReaderContext context) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -149,7 +145,7 @@ final class JustCompileSearch {@Overridepublic FieldComparator<?> newComparator(String fieldname, int numHits,- int sortPos, boolean reversed) throws IOException {+ int sortPos, boolean reversed) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -160,7 +156,7 @@ final class JustCompileSearch {// still added here in case someone will add abstract methods in the future.@Override- public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {+ public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) {return null;}}@@ -194,12 +190,12 @@ final class JustCompileSearch {static final class JustCompilePhraseScorer extends PhraseScorer {JustCompilePhraseScorer(Weight weight, PhraseQuery.PostingsAndFreq[] postings,- Similarity.SloppySimScorer docScorer) throws IOException {+ Similarity.SloppySimScorer docScorer) {super(weight, postings, docScorer);}@Override- protected float phraseFreq() throws IOException {+ protected float phraseFreq() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -221,13 +217,12 @@ final class JustCompileSearch {}@Override- public boolean score(Collector collector, int max, int firstDocID)- throws IOException {+ public boolean score(Collector collector, int max, int firstDocID) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public float score() throws IOException {+ public float score() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -237,12 +232,12 @@ final class JustCompileSearch {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}}@@ -255,12 +250,12 @@ final class JustCompileSearch {}@Override- public ExactSimScorer exactSimScorer(SimWeight stats, AtomicReaderContext context) throws IOException {+ public ExactSimScorer exactSimScorer(SimWeight stats, AtomicReaderContext context) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public SloppySimScorer sloppySimScorer(SimWeight stats, AtomicReaderContext context) throws IOException {+ public SloppySimScorer sloppySimScorer(SimWeight stats, AtomicReaderContext context) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -277,18 +272,17 @@ final class JustCompileSearch {}@Override- public void collect(int doc) throws IOException {+ public void collect(int doc) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public void setNextReader(AtomicReaderContext context)- throws IOException {+ public void setNextReader(AtomicReaderContext context) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -317,7 +311,7 @@ final class JustCompileSearch {static final class JustCompileWeight extends Weight {@Override- public Explanation explain(AtomicReaderContext context, int doc) throws IOException {+ public Explanation explain(AtomicReaderContext context, int doc) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -332,14 +326,13 @@ final class JustCompileSearch {}@Override- public float getValueForNormalization() throws IOException {+ public float getValueForNormalization() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Overridepublic Scorer scorer(AtomicReaderContext context, boolean scoreDocsInOrder,- boolean topScorer, Bits acceptDocs)- throws IOException {+ boolean topScorer, Bits acceptDocs) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.javaindex e47fc6ee772..1278cd79e0f 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java@@ -17,7 +17,6 @@ package org.apache.lucene.search;* limitations under the License.*/-import java.io.IOException;import java.util.ArrayList;import java.util.Arrays;import java.util.List;@@ -81,14 +80,14 @@ public class TestBooleanScorer extends LuceneTestCaseBooleanWeight weight = (BooleanWeight) new BooleanQuery().createWeight(searcher);Scorer[] scorers = new Scorer[] {new Scorer(weight) {private int doc = -1;- @Override public float score() throws IOException { return 0; }+ @Override public float score() { return 0; }@Override public int docID() { return doc; }- @Override public int nextDoc() throws IOException {+ @Override public int nextDoc() {return doc = doc == -1 ? 3000 : NO_MORE_DOCS;}- @Override public int advance(int target) throws IOException {+ @Override public int advance(int target) {return doc = target <= 3000 ? 3000 : NO_MORE_DOCS;}@@ -104,7 +103,7 @@ public class TestBooleanScorer extends LuceneTestCase}@Override- public void collect(int doc) throws IOException {+ public void collect(int doc) {hits.add(docBase+doc);}@@ -158,7 +157,7 @@ public class TestBooleanScorer extends LuceneTestCase}@Override- public void collect(int doc) throws IOException {+ public void collect(int doc) {count[0]++;}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.javaindex c8998f74417..bbe2bc3da2b 100755--- a/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java@@ -85,13 +85,13 @@ public class TestCachingCollector extends LuceneTestCase {int prevDocID = -1;@Override- public void setScorer(Scorer scorer) throws IOException {}+ public void setScorer(Scorer scorer) {}@Override- public void setNextReader(AtomicReaderContext context) throws IOException {}+ public void setNextReader(AtomicReaderContext context) {}@Override- public void collect(int doc) throws IOException {+ public void collect(int doc) {assertEquals(prevDocID + 1, doc);prevDocID = doc;}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDocBoost.java b/lucene/core/src/test/org/apache/lucene/search/TestDocBoost.javaindex f04483d7561..3cf2e85f83f 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestDocBoost.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestDocBoost.java@@ -63,7 +63,7 @@ public class TestDocBoost extends LuceneTestCase {private int base = 0;private Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Overridediff --git a/lucene/core/src/test/org/apache/lucene/search/TestDocIdSet.java b/lucene/core/src/test/org/apache/lucene/search/TestDocIdSet.javaindex 092b91b1f5a..f9a9735fac8 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestDocIdSet.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestDocIdSet.java@@ -17,7 +17,6 @@ package org.apache.lucene.search;* limitations under the License.*/-import java.io.IOException;import java.util.ArrayList;import java.util.Arrays;import java.util.Iterator;@@ -50,13 +49,13 @@ public class TestDocIdSet extends LuceneTestCase {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {docid++;return docid < maxdoc ? docid : (docid = NO_MORE_DOCS);}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {while (nextDoc() < target) {}return docid;}@@ -115,7 +114,7 @@ public class TestDocIdSet extends LuceneTestCase {// Now search w/ a Filter which returns a null DocIdSetFilter f = new Filter() {@Override- public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {+ public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) {return null;}};@@ -141,7 +140,7 @@ public class TestDocIdSet extends LuceneTestCase {// Now search w/ a Filter which returns a null DocIdSetFilter f = new Filter() {@Override- public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {+ public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) {final DocIdSet innerNullIteratorSet = new DocIdSet() {@Overridepublic DocIdSetIterator iterator() {diff --git a/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java b/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.javaindex ff0d132f599..cc77bc2d09e 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java@@ -157,7 +157,7 @@ class ElevationComparatorSource extends FieldComparatorSource {bottomVal = values[slot];}- private int docVal(int doc) throws IOException {+ private int docVal(int doc) {int ord = idIndex.getOrd(doc);if (ord == 0) {return 0;@@ -169,12 +169,12 @@ class ElevationComparatorSource extends FieldComparatorSource {}@Override- public int compareBottom(int doc) throws IOException {+ public int compareBottom(int doc) {return docVal(doc) - bottomVal;}@Override- public void copy(int slot, int doc) throws IOException {+ public void copy(int slot, int doc) {values[slot] = docVal(doc);}@@ -190,7 +190,7 @@ class ElevationComparatorSource extends FieldComparatorSource {}@Override- public int compareDocToValue(int doc, Integer valueObj) throws IOException {+ public int compareDocToValue(int doc, Integer valueObj) {final int value = valueObj.intValue();final int docValue = docVal(doc);// values will be small enough that there is no overflow concerndiff --git a/lucene/core/src/test/org/apache/lucene/search/TestFieldValueFilter.java b/lucene/core/src/test/org/apache/lucene/search/TestFieldValueFilter.javaindex e15cd5c4200..44d2208d324 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestFieldValueFilter.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestFieldValueFilter.java@@ -21,7 +21,6 @@ import java.io.IOException;import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.RandomIndexWriter;@@ -90,7 +89,7 @@ public class TestFieldValueFilter extends LuceneTestCase {}private int[] buildIndex(RandomIndexWriter writer, int docs)- throws IOException, CorruptIndexException {+ throws IOException {int[] docStates = new int[docs];for (int i = 0; i < docs; i++) {Document doc = new Document();diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFilteredSearch.java b/lucene/core/src/test/org/apache/lucene/search/TestFilteredSearch.javaindex 18e52674d2b..1897519bc54 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestFilteredSearch.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestFilteredSearch.java@@ -24,14 +24,12 @@ import org.apache.lucene.util.LuceneTestCase;import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.document.Document;import org.apache.lucene.index.AtomicReaderContext;-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.Term;import org.apache.lucene.index.IndexWriterConfig.OpenMode;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.Bits;import org.apache.lucene.util.FixedBitSet;@@ -44,7 +42,7 @@ public class TestFilteredSearch extends LuceneTestCase {private static final String FIELD = "category";- public void testFilteredSearch() throws CorruptIndexException, LockObtainFailedException, IOException {+ public void testFilteredSearch() throws IOException {boolean enforceSingleSegment = true;Directory directory = newDirectory();int[] filterBits = {1, 36};diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermConstantScore.javaindex 7cec595a15f..549e1c56ca2 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java@@ -178,7 +178,7 @@ public class TestMultiTermConstantScore extends BaseTestRangeFilter {private int base = 0;private Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Overridediff --git a/lucene/core/src/test/org/apache/lucene/search/TestNRTManager.java b/lucene/core/src/test/org/apache/lucene/search/TestNRTManager.javaindex bb20c8702ce..f88cf35dfd4 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestNRTManager.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestNRTManager.java@@ -27,7 +27,6 @@ import org.apache.lucene.analysis.Analyzer;import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.IndexWriter;@@ -37,7 +36,6 @@ import org.apache.lucene.index.RandomIndexWriter;import org.apache.lucene.index.Term;import org.apache.lucene.index.ThreadedIndexingAndSearchingTestCase;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.store.NRTCachingDirectory;import org.apache.lucene.util.IOUtils;import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;@@ -367,7 +365,7 @@ public class TestNRTManager extends ThreadedIndexingAndSearchingTestCase {public LatchedIndexWriter(Directory d, IndexWriterConfig conf,CountDownLatch latch, CountDownLatch signal)- throws CorruptIndexException, LockObtainFailedException, IOException {+ throws IOException {super(d, conf);this.latch = latch;this.signal = signal;@@ -376,7 +374,7 @@ public class TestNRTManager extends ThreadedIndexingAndSearchingTestCase {public void updateDocument(Term term,Iterable<? extends IndexableField> doc, Analyzer analyzer)- throws CorruptIndexException, IOException {+ throws IOException {super.updateDocument(term, doc, analyzer);try {if (waitAfterUpdate) {@@ -398,7 +396,7 @@ public class TestNRTManager extends ThreadedIndexingAndSearchingTestCase {final SearcherFactory theEvilOne = new SearcherFactory() {@Override- public IndexSearcher newSearcher(IndexReader ignored) throws IOException {+ public IndexSearcher newSearcher(IndexReader ignored) {return new IndexSearcher(other);}};diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.javaindex 584c7e6e2e9..988b671d42b 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java@@ -17,8 +17,6 @@ package org.apache.lucene.search;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.RandomIndexWriter;import org.apache.lucene.index.Term;@@ -34,17 +32,17 @@ public class TestPositiveScoresOnlyCollector extends LuceneTestCase {super(weight);}- @Override public float score() throws IOException {+ @Override public float score() {return idx == scores.length ? Float.NaN : scores[idx];}@Override public int docID() { return idx; }- @Override public int nextDoc() throws IOException {+ @Override public int nextDoc() {return ++idx != scores.length ? idx : NO_MORE_DOCS;}- @Override public int advance(int target) throws IOException {+ @Override public int advance(int target) {idx = target;return idx < scores.length ? idx : NO_MORE_DOCS;}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPrefixRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestPrefixRandom.javaindex 82050e41bfe..6a4228f1fa3 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestPrefixRandom.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestPrefixRandom.java@@ -91,7 +91,7 @@ public class TestPrefixRandom extends LuceneTestCase {private class SimplePrefixTermsEnum extends FilteredTermsEnum {private final BytesRef prefix;- private SimplePrefixTermsEnum(TermsEnum tenum, BytesRef prefix) throws IOException {+ private SimplePrefixTermsEnum(TermsEnum tenum, BytesRef prefix) {super(tenum);this.prefix = prefix;setInitialSeekTerm(new BytesRef(""));diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.javaindex 621234633e4..870db4f5404 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java@@ -102,7 +102,7 @@ public class TestRegexpQuery extends LuceneTestCase {BasicAutomata.makeString("brown"),BasicAutomata.makeString("bob")));- public Automaton getAutomaton(String name) throws IOException {+ public Automaton getAutomaton(String name) {if (name.equals("quickBrown")) return quickBrownAutomaton;else return null;}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom2.java b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom2.javaindex ee0efc29676..54ab48aa7d5 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom2.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom2.java@@ -116,7 +116,7 @@ public class TestRegexpRandom2 extends LuceneTestCase {CharacterRunAutomaton runAutomaton = new CharacterRunAutomaton(automaton);CharsRef utf16 = new CharsRef(10);- private SimpleAutomatonTermsEnum(TermsEnum tenum) throws IOException {+ private SimpleAutomatonTermsEnum(TermsEnum tenum) {super(tenum);setInitialSeekTerm(new BytesRef(""));}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.javaindex 9a2830a5523..52c68d99abc 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java@@ -36,7 +36,7 @@ public class TestScoreCachingWrappingScorer extends LuceneTestCase {super(weight);}- @Override public float score() throws IOException {+ @Override public float score() {// advance idx on purpose, so that consecutive calls to score will get// different results. This is to emulate computation of a score. If// ScoreCachingWrappingScorer is used, this should not be called more than@@ -46,11 +46,11 @@ public class TestScoreCachingWrappingScorer extends LuceneTestCase {@Override public int docID() { return doc; }- @Override public int nextDoc() throws IOException {+ @Override public int nextDoc() {return ++doc < scores.length ? doc : NO_MORE_DOCS;}- @Override public int advance(int target) throws IOException {+ @Override public int advance(int target) {doc = target;return doc < scores.length ? doc : NO_MORE_DOCS;}@@ -80,11 +80,10 @@ public class TestScoreCachingWrappingScorer extends LuceneTestCase {++idx;}- @Override public void setNextReader(AtomicReaderContext context)- throws IOException {+ @Override public void setNextReader(AtomicReaderContext context) {}- @Override public void setScorer(Scorer scorer) throws IOException {+ @Override public void setScorer(Scorer scorer) {this.scorer = new ScoreCachingWrappingScorer(scorer);}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.javaindex c2ab9e3ebec..d700d963d03 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java@@ -208,7 +208,7 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {final ExecutorService es = random().nextBoolean() ? null : Executors.newCachedThreadPool(new NamedThreadFactory("testIntermediateClose"));final SearcherFactory factory = new SearcherFactory() {@Override- public IndexSearcher newSearcher(IndexReader r) throws IOException {+ public IndexSearcher newSearcher(IndexReader r) {try {if (triedReopen.get()) {awaitEnterWarm.countDown();@@ -334,7 +334,7 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {final SearcherFactory theEvilOne = new SearcherFactory() {@Override- public IndexSearcher newSearcher(IndexReader ignored) throws IOException {+ public IndexSearcher newSearcher(IndexReader ignored) {return new IndexSearcher(other);}};diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.javaindex 979fd4a2774..9bca7b6a3c7 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java@@ -78,7 +78,7 @@ public class TestSimilarity extends LuceneTestCase {searcher.search(new TermQuery(b), new Collector() {private Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Override@@ -101,7 +101,7 @@ public class TestSimilarity extends LuceneTestCase {private int base = 0;private Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Override@@ -127,7 +127,7 @@ public class TestSimilarity extends LuceneTestCase {new Collector() {private Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Override@@ -148,7 +148,7 @@ public class TestSimilarity extends LuceneTestCase {searcher.search(pq, new Collector() {private Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Overridediff --git a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.javaindex 2ca5d9c2c3a..fdde5323713 100755--- a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java@@ -207,7 +207,7 @@ public class TestSloppyPhraseQuery extends LuceneTestCase {Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@@ -218,7 +218,7 @@ public class TestSloppyPhraseQuery extends LuceneTestCase {}@Override- public void setNextReader(AtomicReaderContext context) throws IOException {+ public void setNextReader(AtomicReaderContext context) {// do nothing}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery2.java b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery2.javaindex 4cfd2502b4f..316991ef15c 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery2.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery2.java@@ -184,7 +184,7 @@ public class TestSloppyPhraseQuery2 extends SearchEquivalenceTestBase {}}- private MultiPhraseQuery randomPhraseQuery(long seed) throws Exception {+ private MultiPhraseQuery randomPhraseQuery(long seed) {Random random = new Random(seed);int length = _TestUtil.nextInt(random, 2, 5);MultiPhraseQuery pq = new MultiPhraseQuery();diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSort.java b/lucene/core/src/test/org/apache/lucene/search/TestSort.javaindex 9841d09fde6..cd4d90133ad 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestSort.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestSort.java@@ -42,7 +42,6 @@ import org.apache.lucene.document.StraightBytesDocValuesField;import org.apache.lucene.document.StringField;import org.apache.lucene.document.TextField;import org.apache.lucene.index.AtomicReaderContext;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.DocValues;import org.apache.lucene.index.IndexReader;@@ -55,7 +54,6 @@ import org.apache.lucene.index.Term;import org.apache.lucene.search.BooleanClause.Occur;import org.apache.lucene.search.FieldValueHitQueue.Entry;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.Bits;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.DocIdBitSet;@@ -87,7 +85,7 @@ public class TestSort extends LuceneTestCase {private Sort sort;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {NUM_STRINGS = atLeast(500);}@@ -217,7 +215,7 @@ public class TestSort extends LuceneTestCase {return getIndex (true, true);}- private IndexSearcher getFullStrings() throws CorruptIndexException, LockObtainFailedException, IOException {+ private IndexSearcher getFullStrings() throws IOException {Directory indexStore = newDirectory();dirs.add(indexStore);IndexWriter writer = new IndexWriter(diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.javaindex 931919c0abe..f5b62a3844e 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java@@ -89,7 +89,7 @@ public class TestTermScorer extends LuceneTestCase {private Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.javaindex 0a7f3357395..f8f728f9061 100644--- a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java+++ b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java@@ -55,19 +55,18 @@ public class TestTopDocsCollector extends LuceneTestCase {}@Override- public void collect(int doc) throws IOException {+ public void collect(int doc) {++totalHits;pq.insertWithOverflow(new ScoreDoc(doc + base, scores[idx++]));}@Override- public void setNextReader(AtomicReaderContext context)- throws IOException {+ public void setNextReader(AtomicReaderContext context) {base = context.docBase;}@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {// Don't do anything. Assign scores in random}diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.javaindex 5e5ca65d0d6..881d6aa4b06 100644--- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java+++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java@@ -185,8 +185,7 @@ public class TestSimilarityBase extends LuceneTestCase {* Similarities in {@link #sims} and checks if the score is valid; i.e. it* is a finite positive real number.*/- private void unitTestCore(BasicStats stats, float freq, int docLen)- throws IOException {+ private void unitTestCore(BasicStats stats, float freq, int docLen) {for (SimilarityBase sim : sims) {BasicStats realStats = (BasicStats) sim.computeWeight(stats.getTotalBoost(),toCollectionStats(stats),@@ -518,8 +517,7 @@ public class TestSimilarityBase extends LuceneTestCase {* Similarities in {@link #sims} and compares the score against the manually* computed {@code gold}.*/- private void correctnessTestCore(SimilarityBase sim, float gold)- throws IOException {+ private void correctnessTestCore(SimilarityBase sim, float gold) {BasicStats stats = createStats();BasicStats realStats = (BasicStats) sim.computeWeight(stats.getTotalBoost(),toCollectionStats(stats),diff --git a/lucene/core/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java b/lucene/core/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.javaindex 88448f9afa2..1442e26db85 100644--- a/lucene/core/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java+++ b/lucene/core/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java@@ -52,12 +52,12 @@ final class JustCompileSearchSpans {}@Override- public boolean next() throws IOException {+ public boolean next() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public boolean skipTo(int target) throws IOException {+ public boolean skipTo(int target) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -67,7 +67,7 @@ final class JustCompileSearchSpans {}@Override- public Collection<byte[]> getPayload() throws IOException {+ public Collection<byte[]> getPayload() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -86,7 +86,7 @@ final class JustCompileSearchSpans {}@Override- public Spans getSpans(AtomicReaderContext context, Bits acceptDocs, Map<Term,TermContext> termContexts) throws IOException {+ public Spans getSpans(AtomicReaderContext context, Bits acceptDocs, Map<Term,TermContext> termContexts) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -100,7 +100,7 @@ final class JustCompileSearchSpans {static final class JustCompilePayloadSpans extends Spans {@Override- public Collection<byte[]> getPayload() throws IOException {+ public Collection<byte[]> getPayload() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -120,12 +120,12 @@ final class JustCompileSearchSpans {}@Override- public boolean next() throws IOException {+ public boolean next() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@Override- public boolean skipTo(int target) throws IOException {+ public boolean skipTo(int target) {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}@@ -144,7 +144,7 @@ final class JustCompileSearchSpans {}@Override- protected boolean setFreqCurrentDoc() throws IOException {+ protected boolean setFreqCurrentDoc() {throw new UnsupportedOperationException(UNSUPPORTED_MSG);}}diff --git a/lucene/core/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java b/lucene/core/src/test/org/apache/lucene/search/spans/TestPayloadSpans.javaindex 675560698ed..54a111d7833 100644--- a/lucene/core/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java+++ b/lucene/core/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java@@ -23,14 +23,17 @@ import java.util.Collection;import java.util.HashSet;import java.util.Set;-import org.apache.lucene.analysis.*;+import org.apache.lucene.analysis.Analyzer;+import org.apache.lucene.analysis.MockTokenizer;+import org.apache.lucene.analysis.TokenFilter;+import org.apache.lucene.analysis.TokenStream;+import org.apache.lucene.analysis.Tokenizer;import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.document.TextField;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.RandomIndexWriter;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.Term;@@ -42,7 +45,6 @@ import org.apache.lucene.search.payloads.PayloadSpanUtil;import org.apache.lucene.search.similarities.DefaultSimilarity;import org.apache.lucene.search.similarities.Similarity;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.LuceneTestCase;@@ -248,8 +250,7 @@ public class TestPayloadSpans extends LuceneTestCase {directory.close();}- public void testShrinkToAfterShortestMatch() throws CorruptIndexException,- LockObtainFailedException, IOException {+ public void testShrinkToAfterShortestMatch() throws IOException {Directory directory = newDirectory();RandomIndexWriter writer = new RandomIndexWriter(random(), directory,newIndexWriterConfig(TEST_VERSION_CURRENT, new TestPayloadAnalyzer()));@@ -286,8 +287,7 @@ public class TestPayloadSpans extends LuceneTestCase {directory.close();}- public void testShrinkToAfterShortestMatch2() throws CorruptIndexException,- LockObtainFailedException, IOException {+ public void testShrinkToAfterShortestMatch2() throws IOException {Directory directory = newDirectory();RandomIndexWriter writer = new RandomIndexWriter(random(), directory,newIndexWriterConfig(TEST_VERSION_CURRENT, new TestPayloadAnalyzer()));@@ -322,8 +322,7 @@ public class TestPayloadSpans extends LuceneTestCase {directory.close();}- public void testShrinkToAfterShortestMatch3() throws CorruptIndexException,- LockObtainFailedException, IOException {+ public void testShrinkToAfterShortestMatch3() throws IOException {Directory directory = newDirectory();RandomIndexWriter writer = new RandomIndexWriter(random(), directory,newIndexWriterConfig(TEST_VERSION_CURRENT, new TestPayloadAnalyzer()));diff --git a/lucene/core/src/test/org/apache/lucene/util/TestNumericUtils.java b/lucene/core/src/test/org/apache/lucene/util/TestNumericUtils.javaindex a34855aa6b9..eda91b019d5 100644--- a/lucene/core/src/test/org/apache/lucene/util/TestNumericUtils.java+++ b/lucene/core/src/test/org/apache/lucene/util/TestNumericUtils.java@@ -219,7 +219,7 @@ public class TestNumericUtils extends LuceneTestCase {/** Note: The neededBounds Iterable must be unsigned (easier understanding what's happening) */private void assertLongRangeSplit(final long lower, final long upper, int precisionStep,final boolean useBitSet, final Iterable<Long> expectedBounds, final Iterable<Integer> expectedShifts- ) throws Exception {+ ) {// Cannot use FixedBitSet since the range could be long:final OpenBitSet bits=useBitSet ? new OpenBitSet(upper-lower+1) : null;final Iterator<Long> neededBounds = (expectedBounds == null) ? null : expectedBounds.iterator();@@ -460,7 +460,7 @@ public class TestNumericUtils extends LuceneTestCase {/** Note: The neededBounds Iterable must be unsigned (easier understanding what's happening) */private void assertIntRangeSplit(final int lower, final int upper, int precisionStep,final boolean useBitSet, final Iterable<Integer> expectedBounds, final Iterable<Integer> expectedShifts- ) throws Exception {+ ) {final FixedBitSet bits=useBitSet ? new FixedBitSet(upper-lower+1) : null;final Iterator<Integer> neededBounds = (expectedBounds == null) ? null : expectedBounds.iterator();final Iterator<Integer> neededShifts = (expectedShifts == null) ? null : expectedShifts.iterator();diff --git a/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestReproduceMessage.java b/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestReproduceMessage.javaindex ab6409ed708..f635ce542e0 100644--- a/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestReproduceMessage.java+++ b/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestReproduceMessage.java@@ -293,7 +293,7 @@ public class TestReproduceMessage extends WithNestedTests {Assert.assertTrue(runAndReturnSyserr().contains("NOTE: reproduce with:"));}- private String runAndReturnSyserr() throws Exception {+ private String runAndReturnSyserr() {JUnitCore.runClasses(Nested.class);String err = getSysErr();diff --git a/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java b/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.javaindex 183f18ffa6c..d92f7722484 100644--- a/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java+++ b/lucene/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java@@ -37,7 +37,6 @@ import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;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;@@ -126,7 +125,7 @@ public class FormBasedXmlQueryDemo extends HttpServlet {}}- private void openExampleIndex() throws CorruptIndexException, IOException {+ private void openExampleIndex() throws IOException {//Create a RAM-based index from our test data fileRAMDirectory rd = new RAMDirectory();IndexWriterConfig iwConfig = new IndexWriterConfig(Version.LUCENE_40, analyzer);diff --git a/lucene/facet/src/java/org/apache/lucene/facet/enhancements/EnhancementsCategoryTokenizer.java b/lucene/facet/src/java/org/apache/lucene/facet/enhancements/EnhancementsCategoryTokenizer.javaindex d1a489eb54d..b5e0053b9c0 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/enhancements/EnhancementsCategoryTokenizer.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/enhancements/EnhancementsCategoryTokenizer.java@@ -1,6 +1,5 @@package org.apache.lucene.facet.enhancements;-import java.io.IOException;import java.util.List;import org.apache.lucene.analysis.TokenStream;@@ -59,10 +58,9 @@ public class EnhancementsCategoryTokenizer extends CategoryTokenizer {* The stream of category tokens.* @param indexingParams* The indexing params to use.- * @throws IOException*/public EnhancementsCategoryTokenizer(TokenStream input,- EnhancementsIndexingParams indexingParams) throws IOException {+ EnhancementsIndexingParams indexingParams) {super(input, indexingParams);payloadBytes = new byte[Vint8.MAXIMUM_BYTES_NEEDED* (indexingParams.getCategoryEnhancements().size() + 1)];diff --git a/lucene/facet/src/java/org/apache/lucene/facet/enhancements/EnhancementsDocumentBuilder.java b/lucene/facet/src/java/org/apache/lucene/facet/enhancements/EnhancementsDocumentBuilder.javaindex d3b2f007ebe..c8ca0286640 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/enhancements/EnhancementsDocumentBuilder.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/enhancements/EnhancementsDocumentBuilder.java@@ -46,10 +46,9 @@ public class EnhancementsDocumentBuilder extends CategoryDocumentBuilder {* @param taxonomyWriter* @param params* Indexing params which include {@link CategoryEnhancement}s.- * @throws IOException*/public EnhancementsDocumentBuilder(TaxonomyWriter taxonomyWriter,- EnhancementsIndexingParams params) throws IOException {+ EnhancementsIndexingParams params) {super(taxonomyWriter, params);}diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/CategoryDocumentBuilder.java b/lucene/facet/src/java/org/apache/lucene/facet/index/CategoryDocumentBuilder.javaindex 263fab02dbb..f67cd72a1b7 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/index/CategoryDocumentBuilder.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/index/CategoryDocumentBuilder.java@@ -93,11 +93,9 @@ public class CategoryDocumentBuilder {* @param taxonomyWriter* to which new categories will be added, as well as translating* known categories to ordinals- * @throws IOException- *+ **/- public CategoryDocumentBuilder(TaxonomyWriter taxonomyWriter)- throws IOException {+ public CategoryDocumentBuilder(TaxonomyWriter taxonomyWriter) {this(taxonomyWriter, new DefaultFacetIndexingParams());}@@ -111,10 +109,9 @@ public class CategoryDocumentBuilder {* @param params* holds all parameters the indexing process should use such as* category-list parameters- * @throws IOException*/public CategoryDocumentBuilder(TaxonomyWriter taxonomyWriter,- FacetIndexingParams params) throws IOException {+ FacetIndexingParams params) {this.taxonomyWriter = taxonomyWriter;this.indexingParams = params;this.categoriesMap = new HashMap<String, List<CategoryAttribute>>();diff --git a/lucene/facet/src/java/org/apache/lucene/facet/index/streaming/CategoryAttributesStream.java b/lucene/facet/src/java/org/apache/lucene/facet/index/streaming/CategoryAttributesStream.javaindex e96881429f7..7d076554b71 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/index/streaming/CategoryAttributesStream.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/index/streaming/CategoryAttributesStream.java@@ -1,6 +1,5 @@package org.apache.lucene.facet.index.streaming;-import java.io.IOException;import java.util.Iterator;import org.apache.lucene.analysis.TokenStream;@@ -59,7 +58,7 @@ public class CategoryAttributesStream extends TokenStream {}@Override- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {if (iterator == null) {if (iterable == null) {return false;diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/ScoredDocIdCollector.java b/lucene/facet/src/java/org/apache/lucene/facet/search/ScoredDocIdCollector.javaindex 7f5bf533800..85e1f2a1478 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/search/ScoredDocIdCollector.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/ScoredDocIdCollector.java@@ -51,7 +51,7 @@ public abstract class ScoredDocIdCollector extends Collector {public boolean acceptsDocsOutOfOrder() { return true; }@Override- public void collect(int doc) throws IOException {+ public void collect(int doc) {docIds.fastSet(docBase + doc);++numDocIds;}@@ -62,7 +62,7 @@ public abstract class ScoredDocIdCollector extends Collector {}@Override- public ScoredDocIDsIterator scoredDocIdsIterator() throws IOException {+ public ScoredDocIDsIterator scoredDocIdsIterator() {return new ScoredDocIDsIterator() {private DocIdSetIterator docIdsIter = docIds.iterator();@@ -92,7 +92,7 @@ public abstract class ScoredDocIdCollector extends Collector {}@Override- public void setScorer(Scorer scorer) throws IOException {}+ public void setScorer(Scorer scorer) {}}private static final class ScoringDocIdCollector extends ScoredDocIdCollector {@@ -124,7 +124,7 @@ public abstract class ScoredDocIdCollector extends Collector {}@Override- public ScoredDocIDsIterator scoredDocIdsIterator() throws IOException {+ public ScoredDocIDsIterator scoredDocIdsIterator() {return new ScoredDocIDsIterator() {private DocIdSetIterator docIdsIter = docIds.iterator();@@ -160,7 +160,7 @@ public abstract class ScoredDocIdCollector extends Collector {public void setDefaultScore(float defaultScore) {}@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}}diff --git a/lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCounts.java b/lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCounts.javaindex 3df26940c8c..3c294042525 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCounts.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/search/TotalFacetCounts.java@@ -12,7 +12,6 @@ import java.util.HashMap;import java.util.concurrent.atomic.AtomicInteger;import org.apache.lucene.index.IndexReader;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.facet.index.params.CategoryListParams;import org.apache.lucene.facet.index.params.FacetIndexingParams;@@ -73,7 +72,7 @@ public class TotalFacetCounts {* Construct by key - from index Directory or by recomputing.*/private TotalFacetCounts (TaxonomyReader taxonomy, FacetIndexingParams facetIndexingParams,- int[][] counts, CreationType createType4Test) throws IOException, LockObtainFailedException {+ int[][] counts, CreationType createType4Test) {this.taxonomy = taxonomy;this.facetIndexingParams = facetIndexingParams;this.totalCounts = counts;diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/CategoryPath.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/CategoryPath.javaindex fb49a04280b..30de4d9e67b 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/CategoryPath.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/CategoryPath.java@@ -1013,7 +1013,7 @@ public class CategoryPath implements Serializable, Cloneable, Comparable<Categorosw.flush();}- private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {+ private void readObject(java.io.ObjectInputStream in) throws IOException {InputStreamReader isr = new InputStreamReader(in, "UTF-8");this.deserializeFromStreamReader(isr);}diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/Consts.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/Consts.javaindex bc204be2a1a..b7c404972f3 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/Consts.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/Consts.java@@ -1,7 +1,5 @@package org.apache.lucene.facet.taxonomy.directory;-import java.io.IOException;-import org.apache.lucene.index.FieldInfo;import org.apache.lucene.index.StoredFieldVisitor;@@ -41,12 +39,12 @@ abstract class Consts {private String fullPath;@Override- public void stringField(FieldInfo fieldInfo, String value) throws IOException {+ public void stringField(FieldInfo fieldInfo, String value) {fullPath = value;}@Override- public Status needsField(FieldInfo fieldInfo) throws IOException {+ public Status needsField(FieldInfo fieldInfo) {return fullPath == null ? Status.YES : Status.STOP;}diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.javaindex 202c35fef54..bbf62408d57 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyReader.java@@ -127,7 +127,7 @@ public class DirectoryTaxonomyReader implements TaxonomyReader {parentArray.refresh(indexReader);}- protected DirectoryReader openIndexReader(Directory directory) throws CorruptIndexException, IOException {+ protected DirectoryReader openIndexReader(Directory directory) throws IOException {return DirectoryReader.open(directory);}@@ -218,7 +218,7 @@ public class DirectoryTaxonomyReader implements TaxonomyReader {return ret;}- public CategoryPath getPath(int ordinal) throws CorruptIndexException, IOException {+ public CategoryPath getPath(int ordinal) throws IOException {ensureOpen();// TODO (Facet): Currently, the LRU cache we use (getCategoryCache) holds// strings with delimiters, not CategoryPath objects, so even if@@ -235,7 +235,7 @@ public class DirectoryTaxonomyReader implements TaxonomyReader {return new CategoryPath(label, delimiter);}- public boolean getPath(int ordinal, CategoryPath result) throws CorruptIndexException, IOException {+ public boolean getPath(int ordinal, CategoryPath result) throws IOException {ensureOpen();String label = getLabel(ordinal);if (label==null) {@@ -246,7 +246,7 @@ public class DirectoryTaxonomyReader implements TaxonomyReader {return true;}- private String getLabel(int catID) throws CorruptIndexException, IOException {+ private String getLabel(int catID) throws IOException {ensureOpen();// First try to find the answer in the LRU cache. It is very// unfortunate that we need to allocate an Integer object here -diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.javaindex 4450f339be4..49f4c2cfdd3 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java@@ -312,7 +312,7 @@ public class DirectoryTaxonomyWriter implements TaxonomyWriter {* {@link #defaultTaxonomyWriterCache()}.*/public DirectoryTaxonomyWriter(Directory directory, OpenMode openMode)- throws CorruptIndexException, LockObtainFailedException, IOException {+ throws IOException {this(directory, openMode, defaultTaxonomyWriterCache());}@@ -330,9 +330,7 @@ public class DirectoryTaxonomyWriter implements TaxonomyWriter {// convenience constructors:- public DirectoryTaxonomyWriter(Directory d)- throws CorruptIndexException, LockObtainFailedException,- IOException {+ public DirectoryTaxonomyWriter(Directory d) throws IOException {this(d, OpenMode.CREATE_OR_APPEND);}@@ -342,14 +340,14 @@ public class DirectoryTaxonomyWriter implements TaxonomyWriter {* {@link Directory}.*/@Override- public synchronized void close() throws CorruptIndexException, IOException {+ public synchronized void close() throws IOException {if (!isClosed) {indexWriter.commit(combinedCommitData(null));doClose();}}- private void doClose() throws CorruptIndexException, IOException {+ private void doClose() throws IOException {indexWriter.close();isClosed = true;closeResources();@@ -656,7 +654,7 @@ public class DirectoryTaxonomyWriter implements TaxonomyWriter {* See {@link TaxonomyWriter#commit()}*/@Override- public synchronized void commit() throws CorruptIndexException, IOException {+ public synchronized void commit() throws IOException {ensureOpen();indexWriter.commit(combinedCommitData(null));}@@ -681,7 +679,7 @@ public class DirectoryTaxonomyWriter implements TaxonomyWriter {* See {@link TaxonomyWriter#commit(Map)}.*/@Override- public synchronized void commit(Map<String,String> commitUserData) throws CorruptIndexException, IOException {+ public synchronized void commit(Map<String,String> commitUserData) throws IOException {ensureOpen();indexWriter.commit(combinedCommitData(commitUserData));}@@ -691,7 +689,7 @@ public class DirectoryTaxonomyWriter implements TaxonomyWriter {* See {@link IndexWriter#prepareCommit}.*/@Override- public synchronized void prepareCommit() throws CorruptIndexException, IOException {+ public synchronized void prepareCommit() throws IOException {ensureOpen();indexWriter.prepareCommit(combinedCommitData(null));}@@ -701,7 +699,7 @@ public class DirectoryTaxonomyWriter implements TaxonomyWriter {* See {@link IndexWriter#prepareCommit(Map)}*/@Override- public synchronized void prepareCommit(Map<String,String> commitUserData) throws CorruptIndexException, IOException {+ public synchronized void prepareCommit(Map<String,String> commitUserData) throws IOException {ensureOpen();indexWriter.prepareCommit(combinedCommitData(commitUserData));}diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/ParentArray.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/ParentArray.javaindex f5364f2f3a4..88897ccbeca 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/ParentArray.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/ParentArray.java@@ -147,7 +147,7 @@ class ParentArray {* NOTE: add() and refresh() CANNOT be used together. If you call add(),* this changes the arrays and refresh() can no longer be used.*/- void add(int ordinal, int parentOrdinal) throws IOException {+ void add(int ordinal, int parentOrdinal) {if (ordinal >= prefetchParentOrdinal.length) {// grow the array, if necessary.// In Java 6, we could just do Arrays.copyOf()...diff --git a/lucene/facet/src/java/org/apache/lucene/facet/util/ScoredDocIdsUtils.java b/lucene/facet/src/java/org/apache/lucene/facet/util/ScoredDocIdsUtils.javaindex 3faf16367b1..cd837693689 100644--- a/lucene/facet/src/java/org/apache/lucene/facet/util/ScoredDocIdsUtils.java+++ b/lucene/facet/src/java/org/apache/lucene/facet/util/ScoredDocIdsUtils.java@@ -125,13 +125,13 @@ public class ScoredDocIdsUtils {public boolean isCacheable() { return true; }@Override- public DocIdSetIterator iterator() throws IOException {+ public DocIdSetIterator iterator() {return new DocIdSetIterator() {private int next = -1;@Override- public int advance(int target) throws IOException {+ public int advance(int target) {while (next < size && docids[next++] < target) {}return next == size ? NO_MORE_DOCS : docids[next];@@ -143,7 +143,7 @@ public class ScoredDocIdsUtils {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {if (++next >= size) {return NO_MORE_DOCS;}@@ -155,7 +155,7 @@ public class ScoredDocIdsUtils {};}- public ScoredDocIDsIterator iterator() throws IOException {+ public ScoredDocIDsIterator iterator() {return new ScoredDocIDsIterator() {int next = -1;@@ -251,12 +251,12 @@ public class ScoredDocIdsUtils {}@Override- public DocIdSetIterator iterator() throws IOException {+ public DocIdSetIterator iterator() {return new DocIdSetIterator() {private int next = -1;@Override- public int advance(int target) throws IOException {+ public int advance(int target) {if (target <= next) {target = next + 1;}@@ -270,7 +270,7 @@ public class ScoredDocIdsUtils {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {return ++next < maxDoc ? next : NO_MORE_DOCS;}@@ -337,13 +337,13 @@ public class ScoredDocIdsUtils {}@Override- public DocIdSetIterator iterator() throws IOException {+ public DocIdSetIterator iterator() {return new DocIdSetIterator() {final Bits liveDocs = MultiFields.getLiveDocs(reader);private int next = -1;@Override- public int advance(int target) throws IOException {+ public int advance(int target) {if (target > next) {next = target - 1;}@@ -356,7 +356,7 @@ public class ScoredDocIdsUtils {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {do {++next;} while (next < maxDoc && liveDocs != null && !liveDocs.get(next));diff --git a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.javaindex e9f85a10ba6..97e4dfa1d54 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java@@ -15,7 +15,6 @@ import org.apache.lucene.analysis.MockTokenizer;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.document.TextField;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.DocsEnum;import org.apache.lucene.index.IndexReader;@@ -92,7 +91,7 @@ public abstract class FacetTestBase extends LuceneTestCase {protected IndexSearcher searcher;@BeforeClass- public static void beforeClassFacetTestBase() throws Exception {+ public static void beforeClassFacetTestBase() {TEST_DIR = _TestUtil.getTempDir("facets");dirsPerPartitionSize = new HashMap<Integer, FacetTestBase.SearchTaxoDirPair>();}@@ -215,7 +214,7 @@ public abstract class FacetTestBase extends LuceneTestCase {* <p>Subclasses can override this to test different scenarios*/protected void populateIndex(RandomIndexWriter iw, TaxonomyWriter taxo, FacetIndexingParams iParams)- throws IOException, CorruptIndexException {+ throws IOException {// add test documentsint numDocsToIndex = numDocsToIndex();for (int doc=0; doc<numDocsToIndex; doc++) {@@ -257,8 +256,7 @@ public abstract class FacetTestBase extends LuceneTestCase {/** utility Create a dummy document with specified categories and content */protected final void indexDoc(FacetIndexingParams iParams, RandomIndexWriter iw,- TaxonomyWriter tw, String content, List<CategoryPath> categories) throws IOException,- CorruptIndexException {+ TaxonomyWriter tw, String content, List<CategoryPath> categories) throws IOException {Document d = new Document();CategoryDocumentBuilder builder = new CategoryDocumentBuilder(tw, iParams);builder.setCategoryPaths(categories);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.javaindex a9e20c421c2..fe2acf2f20b 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java@@ -8,7 +8,6 @@ import org.apache.lucene.analysis.standard.StandardAnalyzer;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.document.TextField;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexWriter;import org.apache.lucene.index.IndexWriterConfig;@@ -53,7 +52,7 @@ import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;public class FacetTestUtils {- public static Directory[][] createIndexTaxonomyDirs(int number) throws IOException {+ public static Directory[][] createIndexTaxonomyDirs(int number) {Directory[][] dirs = new Directory[number][2];for (int i = 0; i < number; i++) {dirs[i][0] = LuceneTestCase.newDirectory();@@ -93,8 +92,7 @@ public class FacetTestUtils {public static Collector[] search(IndexSearcher searcher,TaxonomyReader taxonomyReader, DefaultFacetIndexingParams iParams,- int k, String... facetNames) throws IOException,- IllegalAccessException, InstantiationException {+ int k, String... facetNames) throws IOException {Collector[] collectors = new Collector[2];@@ -121,8 +119,7 @@ public class FacetTestUtils {}public static void add(FacetIndexingParams iParams, RandomIndexWriter iw,- TaxonomyWriter tw, String... strings) throws IOException,- CorruptIndexException {+ TaxonomyWriter tw, String... strings) throws IOException {ArrayList<CategoryPath> cps = new ArrayList<CategoryPath>();CategoryPath cp = new CategoryPath(strings);cps.add(cp);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/example/TestMultiCLExample.java b/lucene/facet/src/test/org/apache/lucene/facet/example/TestMultiCLExample.javaindex 73dd9e254d1..eea5e1872f5 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/example/TestMultiCLExample.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/example/TestMultiCLExample.java@@ -6,7 +6,6 @@ import java.util.List;import org.junit.Test;import org.apache.lucene.util.LuceneTestCase;-import org.apache.lucene.facet.example.ExampleResult;import org.apache.lucene.facet.example.multiCL.MultiCLMain;import org.apache.lucene.facet.search.results.FacetResult;import org.apache.lucene.facet.search.results.FacetResultNode;@@ -40,8 +39,7 @@ public class TestMultiCLExample extends LuceneTestCase {assertCorrectMultiResults(res);}- public static void assertCorrectMultiResults(ExampleResult exampleResults)- throws Exception {+ public static void assertCorrectMultiResults(ExampleResult exampleResults) {List<FacetResult> results = exampleResults.getFacetResults();FacetResult result = results.get(0);assertNotNull("Result should not be null", result);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/index/streaming/CategoryParentsStreamTest.java b/lucene/facet/src/test/org/apache/lucene/facet/index/streaming/CategoryParentsStreamTest.javaindex fcb86e5332d..cc3aff4042c 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/index/streaming/CategoryParentsStreamTest.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/index/streaming/CategoryParentsStreamTest.java@@ -15,9 +15,6 @@ import org.apache.lucene.facet.index.categorypolicy.OrdinalPolicy;import org.apache.lucene.facet.index.categorypolicy.PathPolicy;import org.apache.lucene.facet.index.params.DefaultFacetIndexingParams;import org.apache.lucene.facet.index.params.FacetIndexingParams;-import org.apache.lucene.facet.index.streaming.CategoryAttributesStream;-import org.apache.lucene.facet.index.streaming.CategoryListTokenizer;-import org.apache.lucene.facet.index.streaming.CategoryParentsStream;import org.apache.lucene.facet.taxonomy.TaxonomyWriter;import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;@@ -116,7 +113,7 @@ public class CategoryParentsStreamTest extends CategoryContainerTestBase {* @throws FacetException*/@Test- public void testNoRetainableAttributes() throws IOException, FacetException {+ public void testNoRetainableAttributes() throws IOException {Directory directory = newDirectory();TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(directory);@@ -150,7 +147,7 @@ public class CategoryParentsStreamTest extends CategoryContainerTestBase {* @throws FacetException*/@Test- public void testRetainableAttributes() throws IOException, FacetException {+ public void testRetainableAttributes() throws IOException {Directory directory = newDirectory();TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(directory);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/BaseTestTopK.java b/lucene/facet/src/test/org/apache/lucene/facet/search/BaseTestTopK.javaindex 5b79db3639b..c63e0fe167b 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/BaseTestTopK.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/BaseTestTopK.java@@ -4,7 +4,6 @@ import java.io.IOException;import java.util.Arrays;import java.util.List;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.IndexWriterConfig;import org.apache.lucene.index.RandomIndexWriter;import org.apache.lucene.util._TestUtil;@@ -51,7 +50,7 @@ public abstract class BaseTestTopK extends FacetTestBase {@Overrideprotected void populateIndex(RandomIndexWriter iw, TaxonomyWriter taxo,- FacetIndexingParams iParams) throws IOException, CorruptIndexException {+ FacetIndexingParams iParams) throws IOException {currDoc = -1;super.populateIndex(iw, taxo, iParams);}diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.javaindex 87ead5723bb..ddb4ac54480 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java@@ -57,7 +57,7 @@ public class CategoryListIteratorTest extends LuceneTestCase {private boolean exhausted = false;private CharTermAttribute term = addAttribute(CharTermAttribute.class);- public DataTokenStream(String text, IntEncoder encoder) throws IOException {+ public DataTokenStream(String text, IntEncoder encoder) {this.encoder = encoder;term.setEmpty().append(text);}diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.javaindex 4df8ac2d2a8..22a0f862d6a 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java@@ -8,7 +8,6 @@ import org.apache.lucene.analysis.MockTokenizer;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.document.TextField;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.RandomIndexWriter;import org.apache.lucene.index.Term;@@ -17,7 +16,6 @@ import org.apache.lucene.search.Query;import org.apache.lucene.search.TermQuery;import org.apache.lucene.search.TopDocs;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.junit.AfterClass;import org.junit.BeforeClass;import org.junit.Test;@@ -58,7 +56,7 @@ public class DrillDownTest extends LuceneTestCase {private static Directory dir;private static Directory taxoDir;- public DrillDownTest() throws IOException {+ public DrillDownTest() {PerDimensionIndexingParams iParams = new PerDimensionIndexingParams();CategoryListParams aClParams = new CategoryListParams(new Term("testing_facets_a", "a"));CategoryListParams bClParams = new CategoryListParams(new Term("testing_facets_b", "b"));@@ -70,7 +68,7 @@ public class DrillDownTest extends LuceneTestCase {}@BeforeClass- public static void createIndexes() throws CorruptIndexException, LockObtainFailedException, IOException {+ public static void createIndexes() throws IOException {dir = newDirectory();RandomIndexWriter writer = new RandomIndexWriter(random(), dir,newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.KEYWORD, false)));diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestCategoryListCache.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestCategoryListCache.javaindex 063578996aa..1ba547393ff 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestCategoryListCache.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestCategoryListCache.java@@ -72,7 +72,7 @@ public class TestCategoryListCache extends FacetTestBase {doTest(true,true);}- private void doTest(boolean withCache, boolean plantWrongData) throws IOException, Exception {+ private void doTest(boolean withCache, boolean plantWrongData) throws Exception {Map<CategoryPath,Integer> truth = facetCountsTruth();CategoryPath cp = (CategoryPath) truth.keySet().toArray()[0]; // any category path will do for this testCountFacetRequest frq = new CountFacetRequest(cp, 10);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.javaindex 216afcd2c7d..6f0c9e8272e 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java@@ -19,7 +19,6 @@ import org.apache.lucene.facet.taxonomy.TaxonomyReader;import org.apache.lucene.facet.taxonomy.TaxonomyWriter;import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader;import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DocsEnum;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.IndexWriterConfig.OpenMode;@@ -271,12 +270,12 @@ public class TestMultipleCategoryLists extends LuceneTestCase {IOUtils.close(dirs[0]);}- private Directory[][] getDirs() throws IOException {+ private Directory[][] getDirs() {return FacetTestUtils.createIndexTaxonomyDirs(1);}private void assertCorrectResults(FacetsCollector facetsCollector)- throws IOException, IllegalAccessException, InstantiationException {+ throws IOException {List<FacetResult> res = facetsCollector.getFacetResults();FacetResult results = res.get(0);@@ -354,7 +353,7 @@ public class TestMultipleCategoryLists extends LuceneTestCase {}private void seedIndex(RandomIndexWriter iw, TaxonomyWriter tw,- FacetIndexingParams iParams) throws IOException, CorruptIndexException {+ FacetIndexingParams iParams) throws IOException {FacetTestUtils.add(iParams, iw, tw, "Author", "Mark Twain");FacetTestUtils.add(iParams, iw, tw, "Author", "Stephen King");FacetTestUtils.add(iParams, iw, tw, "Author", "Kurt Vonnegut");diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.javaindex b463f039d35..d4b15b405df 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java@@ -8,7 +8,6 @@ import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.document.TextField;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.IndexWriterConfig.OpenMode;import org.apache.lucene.index.RandomIndexWriter;@@ -321,8 +320,7 @@ public class TestTopKInEachNodeResultHandler extends LuceneTestCase {}private void prvt_add(DefaultFacetIndexingParams iParams, RandomIndexWriter iw,- TaxonomyWriter tw, String... strings) throws IOException,- CorruptIndexException {+ TaxonomyWriter tw, String... strings) throws IOException {ArrayList<CategoryPath> cps = new ArrayList<CategoryPath>();CategoryPath cp = new CategoryPath(strings);cps.add(cp);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandlerRandom.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandlerRandom.javaindex ccbfaf5bfd4..1da763b710a 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandlerRandom.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKResultsHandlerRandom.java@@ -34,7 +34,7 @@ import org.apache.lucene.facet.taxonomy.TaxonomyReader;public class TestTopKResultsHandlerRandom extends BaseTestTopK {private List<FacetResult> countFacets(int partitionSize, int numResults, final boolean doComplement)- throws IOException, IllegalAccessException, InstantiationException {+ throws IOException {Query q = new MatchAllDocsQuery();FacetSearchParams facetSearchParams = searchParamsWithRequests(numResults, partitionSize);FacetsCollector fc = new FacetsCollector(facetSearchParams, indexReader, taxoReader) {diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.javaindex aa4b13cc139..84255d29a3c 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java@@ -8,7 +8,6 @@ import java.util.List;import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.analysis.MockTokenizer;import org.apache.lucene.document.Document;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.IndexWriter;@@ -140,8 +139,7 @@ public class TestTotalFacetCountsCache extends LuceneTestCase {}private void doTestGeneralSynchronization(int numThreads, int sleepMillis,- int cacheSize) throws Exception, CorruptIndexException, IOException,- InterruptedException {+ int cacheSize) throws Exception {TFC.setCacheSize(cacheSize);SlowRAMDirectory slowIndexDir = new SlowRAMDirectory(-1, random());MockDirectoryWrapper indexDir = new MockDirectoryWrapper(random(), slowIndexDir);diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiIteratorsPerCLParamsTest.java b/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiIteratorsPerCLParamsTest.javaindex 2907daaada5..6e256d22853 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiIteratorsPerCLParamsTest.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiIteratorsPerCLParamsTest.java@@ -7,7 +7,6 @@ import java.util.List;import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.analysis.MockTokenizer;import org.apache.lucene.document.Document;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.RandomIndexWriter;@@ -84,8 +83,7 @@ public class MultiIteratorsPerCLParamsTest extends LuceneTestCase {doTestCLParamMultiIteratorsByRequest(true);}- private void doTestCLParamMultiIteratorsByRequest(boolean cacheCLI) throws Exception,- CorruptIndexException, IOException {+ private void doTestCLParamMultiIteratorsByRequest(boolean cacheCLI) throws Exception {// Create a CLP which generates different CLIs according to the// FacetRequest's dimensionCategoryListParams clp = new CategoryListParams();diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/BaseSampleTestTopK.java b/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/BaseSampleTestTopK.javaindex 7ab56de6257..536704fa74a 100644--- a/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/BaseSampleTestTopK.java+++ b/lucene/facet/src/test/org/apache/lucene/facet/search/sampling/BaseSampleTestTopK.java@@ -1,6 +1,5 @@package org.apache.lucene.facet.search.sampling;-import java.io.IOException;import java.util.List;import java.util.Random;@@ -53,7 +52,7 @@ public abstract class BaseSampleTestTopK extends BaseTestTopK {* Lots of randomly generated data is being indexed, and later on a "90% docs" faceted search* is performed. The results are compared to non-sampled ones.*/- public void testCountUsingSamping() throws Exception, IOException {+ public void testCountUsingSamping() throws Exception {boolean useRandomSampler = random().nextBoolean();for (int partitionSize : partitionSizes) {try {diff --git a/lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java b/lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.javaindex 400ad16f491..73e44fa744a 100644--- a/lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java+++ b/lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java@@ -9,16 +9,6 @@ import java.util.TreeSet;import org.junit.Test;import org.apache.lucene.util.LuceneTestCase;-import org.apache.lucene.util.encoding.DGapIntEncoder;-import org.apache.lucene.util.encoding.EightFlagsIntEncoder;-import org.apache.lucene.util.encoding.FourFlagsIntEncoder;-import org.apache.lucene.util.encoding.IntDecoder;-import org.apache.lucene.util.encoding.IntEncoder;-import org.apache.lucene.util.encoding.NOnesIntEncoder;-import org.apache.lucene.util.encoding.SimpleIntEncoder;-import org.apache.lucene.util.encoding.SortingIntEncoder;-import org.apache.lucene.util.encoding.UniqueValuesIntEncoder;-import org.apache.lucene.util.encoding.VInt8IntEncoder;/** Licensed to the Apache Software Foundation (ASF) under one or more@@ -142,7 +132,7 @@ public class EncodingTest extends LuceneTestCase {}private static void decoding(ByteArrayOutputStream baos, IntDecoder decoder)- throws IOException, InstantiationException, IllegalAccessException {+ throws IOException {ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());decoder.reInit(bais);diff --git a/lucene/grouping/src/java/org/apache/lucene/search/grouping/dv/DVAllGroupHeadsCollector.java b/lucene/grouping/src/java/org/apache/lucene/search/grouping/dv/DVAllGroupHeadsCollector.javaindex cc914a79734..d6cf5b84af5 100644--- a/lucene/grouping/src/java/org/apache/lucene/search/grouping/dv/DVAllGroupHeadsCollector.java+++ b/lucene/grouping/src/java/org/apache/lucene/search/grouping/dv/DVAllGroupHeadsCollector.java@@ -65,10 +65,9 @@ public abstract class DVAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsC* @param type The {@link Type} which is used to select a concrete implementation.* @param diskResident Whether the values to group by should be disk resident* @return an <code>AbstractAllGroupHeadsCollector</code> instance based on the supplied arguments- * @throws IOException If I/O related errors occur*/@SuppressWarnings("unchecked")- public static <T extends AbstractAllGroupHeadsCollector.GroupHead<?>> DVAllGroupHeadsCollector<T> create(String groupField, Sort sortWithinGroup, DocValues.Type type, boolean diskResident) throws IOException {+ public static <T extends AbstractAllGroupHeadsCollector.GroupHead<?>> DVAllGroupHeadsCollector<T> create(String groupField, Sort sortWithinGroup, DocValues.Type type, boolean diskResident) {switch (type) {case VAR_INTS:case FIXED_INTS_8:@@ -162,7 +161,7 @@ public abstract class DVAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCprivate final Sort sortWithinGroup;private final Map<Comparable<?>, GroupHead> groups;- GeneralAllGroupHeadsCollector(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) throws IOException {+ GeneralAllGroupHeadsCollector(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) {super(groupField, valueType, sortWithinGroup.getSort().length, diskResident);this.sortWithinGroup = sortWithinGroup;groups = new HashMap<Comparable<?>, GroupHead>();@@ -218,7 +217,7 @@ public abstract class DVAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCprivate DocValues.SortedSource source;- SortedBR(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) throws IOException {+ SortedBR(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) {super(groupField, valueType, sortWithinGroup, diskResident);}@@ -244,7 +243,7 @@ public abstract class DVAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCprivate DocValues.Source source;- BR(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) throws IOException {+ BR(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) {super(groupField, valueType, sortWithinGroup, diskResident);}@@ -266,7 +265,7 @@ public abstract class DVAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCprivate DocValues.Source source;- Lng(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) throws IOException {+ Lng(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) {super(groupField, valueType, sortWithinGroup, diskResident);}@@ -287,7 +286,7 @@ public abstract class DVAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCprivate DocValues.Source source;- Dbl(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) throws IOException {+ Dbl(String groupField, DocValues.Type valueType, Sort sortWithinGroup, boolean diskResident) {super(groupField, valueType, sortWithinGroup, diskResident);}diff --git a/lucene/grouping/src/java/org/apache/lucene/search/grouping/term/TermAllGroupHeadsCollector.java b/lucene/grouping/src/java/org/apache/lucene/search/grouping/term/TermAllGroupHeadsCollector.javaindex 8e5f6cd4ed3..dd7dc304732 100644--- a/lucene/grouping/src/java/org/apache/lucene/search/grouping/term/TermAllGroupHeadsCollector.java+++ b/lucene/grouping/src/java/org/apache/lucene/search/grouping/term/TermAllGroupHeadsCollector.java@@ -57,9 +57,8 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHead* @param groupField The field to group by* @param sortWithinGroup The sort within each group* @return an <code>AbstractAllGroupHeadsCollector</code> instance based on the supplied arguments- * @throws IOException If I/O related errors occur*/- public static AbstractAllGroupHeadsCollector<?> create(String groupField, Sort sortWithinGroup) throws IOException {+ public static AbstractAllGroupHeadsCollector<?> create(String groupField, Sort sortWithinGroup) {return create(groupField, sortWithinGroup, DEFAULT_INITIAL_SIZE);}@@ -73,9 +72,8 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHead* the total number of expected unique groups. Be aware that the heap usage is* 4 bytes * initialSize.* @return an <code>AbstractAllGroupHeadsCollector</code> instance based on the supplied arguments- * @throws IOException If I/O related errors occur*/- public static AbstractAllGroupHeadsCollector<?> create(String groupField, Sort sortWithinGroup, int initialSize) throws IOException {+ public static AbstractAllGroupHeadsCollector<?> create(String groupField, Sort sortWithinGroup, int initialSize) {boolean sortAllScore = true;boolean sortAllFieldValue = true;@@ -113,7 +111,7 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHeadprivate Scorer scorer;- GeneralAllGroupHeadsCollector(String groupField, Sort sortWithinGroup) throws IOException {+ GeneralAllGroupHeadsCollector(String groupField, Sort sortWithinGroup) {super(groupField, sortWithinGroup.getSort().length);this.sortWithinGroup = sortWithinGroup;groups = new HashMap<BytesRef, GroupHead>();@@ -409,7 +407,7 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHeadBytesRef[] sortValues;int[] sortOrds;- private GroupHead(int doc, BytesRef groupValue) throws IOException {+ private GroupHead(int doc, BytesRef groupValue) {super(groupValue, doc + readerContext.docBase);sortValues = new BytesRef[sortsIndex.length];sortOrds = new int[sortsIndex.length];diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.javaindex 4eec4555ed5..267e99ff41a 100644--- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java+++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java@@ -429,7 +429,7 @@ public class AllGroupHeadsCollectorTest extends LuceneTestCase {return true;}- private int[] createExpectedGroupHeads(String searchTerm, GroupDoc[] groupDocs, Sort docSort, boolean sortByScoreOnly, int[] fieldIdToDocID) throws IOException {+ private int[] createExpectedGroupHeads(String searchTerm, GroupDoc[] groupDocs, Sort docSort, boolean sortByScoreOnly, int[] fieldIdToDocID) {Map<BytesRef, List<GroupDoc>> groupHeads = new HashMap<BytesRef, List<GroupDoc>>();for (GroupDoc groupDoc : groupDocs) {if (!groupDoc.content.startsWith(searchTerm)) {@@ -518,7 +518,7 @@ public class AllGroupHeadsCollectorTest extends LuceneTestCase {}@SuppressWarnings({"unchecked","rawtypes"})- private AbstractAllGroupHeadsCollector<?> createRandomCollector(String groupField, Sort sortWithinGroup, boolean canUseIDV, Type valueType) throws IOException {+ private AbstractAllGroupHeadsCollector<?> createRandomCollector(String groupField, Sort sortWithinGroup, boolean canUseIDV, Type valueType) {AbstractAllGroupHeadsCollector<? extends AbstractAllGroupHeadsCollector.GroupHead> collector;if (random().nextBoolean()) {ValueSource vs = new BytesRefFieldSource(groupField);diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.javaindex 62a5e30e90c..219c60b8f12 100644--- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.java+++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.java@@ -33,7 +33,6 @@ import org.apache.lucene.store.Directory;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.LuceneTestCase;-import java.io.IOException;import java.util.HashMap;public class AllGroupsCollectorTest extends LuceneTestCase {@@ -127,7 +126,7 @@ public class AllGroupsCollectorTest extends LuceneTestCase {}}- private AbstractAllGroupsCollector<?> createRandomCollector(String groupField, boolean canUseIDV) throws IOException {+ private AbstractAllGroupsCollector<?> createRandomCollector(String groupField, boolean canUseIDV) {AbstractAllGroupsCollector<?> selected;if (random().nextBoolean() && canUseIDV) {boolean diskResident = random().nextBoolean();diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.javaindex c427acaae0a..2267fe716f3 100644--- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java+++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java@@ -18,19 +18,28 @@ package org.apache.lucene.search.grouping;*/import org.apache.lucene.analysis.MockAnalyzer;-import org.apache.lucene.document.*;+import org.apache.lucene.document.Document;+import org.apache.lucene.document.Field;+import org.apache.lucene.document.FieldType;+import org.apache.lucene.document.SortedBytesDocValuesField;+import org.apache.lucene.document.StringField;+import org.apache.lucene.document.TextField;import org.apache.lucene.index.DocValues;import org.apache.lucene.index.RandomIndexWriter;import org.apache.lucene.index.Term;import org.apache.lucene.queries.function.ValueSource;import org.apache.lucene.queries.function.valuesource.BytesRefFieldSource;-import org.apache.lucene.search.*;+import org.apache.lucene.search.CachingWrapperFilter;+import org.apache.lucene.search.Filter;+import org.apache.lucene.search.IndexSearcher;+import org.apache.lucene.search.QueryWrapperFilter;+import org.apache.lucene.search.Sort;+import org.apache.lucene.search.TermQuery;import org.apache.lucene.store.Directory;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.LuceneTestCase;import org.apache.lucene.util.mutable.MutableValueStr;-import java.io.IOException;import java.util.ArrayList;import java.util.HashMap;import java.util.List;@@ -195,7 +204,7 @@ public class GroupingSearchTest extends LuceneTestCase {}}- private GroupingSearch createRandomGroupingSearch(String groupField, Sort groupSort, int docsInGroup, boolean canUseIDV) throws IOException {+ private GroupingSearch createRandomGroupingSearch(String groupField, Sort groupSort, int docsInGroup, boolean canUseIDV) {GroupingSearch groupingSearch;if (random().nextBoolean()) {ValueSource vs = new BytesRefFieldSource(groupField);diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.javaindex a350d6e235e..1824741b9c7 100644--- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java+++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java@@ -191,7 +191,7 @@ public class TokenSources {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (currentToken >= tokens.length) {return false;}diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermPositionVector.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermPositionVector.javaindex 8cb79d4858f..bbda4a96d32 100644--- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermPositionVector.java+++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermPositionVector.java@@ -105,7 +105,7 @@ public final class TokenStreamFromTermPositionVector extends TokenStream {};@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (this.tokensAtCurrentPosition.hasNext()) {final Token next = this.tokensAtCurrentPosition.next();clearAttributes();@@ -119,7 +119,7 @@ public final class TokenStreamFromTermPositionVector extends TokenStream {}@Override- public void reset() throws IOException {+ public void reset() {this.tokensAtCurrentPosition = this.positionedTokens.iterator();}}diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java b/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.javaindex 1687f02e1bb..110736c6292 100644--- a/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java+++ b/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java@@ -125,14 +125,14 @@ public abstract class BaseFragmentsBuilder implements FragmentsBuilder {reader.document(docId, new StoredFieldVisitor() {@Override- public void stringField(FieldInfo fieldInfo, String value) throws IOException {+ public void stringField(FieldInfo fieldInfo, String value) {FieldType ft = new FieldType(TextField.TYPE_STORED);ft.setStoreTermVectors(fieldInfo.hasVectors());fields.add(new Field(fieldInfo.name, value, ft));}@Override- public Status needsField(FieldInfo fieldInfo) throws IOException {+ public Status needsField(FieldInfo fieldInfo) {return fieldInfo.name.equals(fieldName) ? Status.YES : Status.NO;}});diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java b/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.javaindex 81e7aa41799..d88d4f9159c 100644--- a/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java+++ b/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java@@ -348,7 +348,7 @@ public class FieldQuery {return map;}- void add( Query query, IndexReader reader ) throws IOException {+ void add( Query query, IndexReader reader ) {if( query instanceof TermQuery ){addTerm( ((TermQuery)query).getTerm(), query.getBoost() );}diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.javaindex beb1cbab43b..2f7d56dcc57 100644--- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java+++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java@@ -31,7 +31,6 @@ import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apache.lucene.document.TextField;import org.apache.lucene.index.AtomicReaderContext;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.IndexWriter;@@ -46,14 +45,12 @@ import org.apache.lucene.search.spans.SpanNearQuery;import org.apache.lucene.search.spans.SpanQuery;import org.apache.lucene.search.spans.SpanTermQuery;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.LuceneTestCase;import org.apache.lucene.util.FixedBitSet;public class HighlighterPhraseTest extends LuceneTestCase {private static final String FIELD = "text";- public void testConcurrentPhrase() throws CorruptIndexException,- LockObtainFailedException, IOException, InvalidTokenOffsetsException {+ public void testConcurrentPhrase() throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox jumped";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,@@ -94,8 +91,7 @@ public class HighlighterPhraseTest extends LuceneTestCase {}}- public void testConcurrentSpan() throws CorruptIndexException,- LockObtainFailedException, IOException, InvalidTokenOffsetsException {+ public void testConcurrentSpan() throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox jumped";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,@@ -129,19 +125,17 @@ public class HighlighterPhraseTest extends LuceneTestCase {}@Override- public void collect(int i) throws IOException {+ public void collect(int i) {bitset.set(this.baseDoc + i);}@Override- public void setNextReader(AtomicReaderContext context)- throws IOException {+ public void setNextReader(AtomicReaderContext context) {this.baseDoc = context.docBase;}@Override- public void setScorer(org.apache.lucene.search.Scorer scorer)- throws IOException {+ public void setScorer(org.apache.lucene.search.Scorer scorer) {// Do Nothing}});@@ -165,8 +159,7 @@ public class HighlighterPhraseTest extends LuceneTestCase {}}- public void testSparsePhrase() throws CorruptIndexException,- LockObtainFailedException, IOException, InvalidTokenOffsetsException {+ public void testSparsePhrase() throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox did not jump";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,@@ -208,8 +201,7 @@ public class HighlighterPhraseTest extends LuceneTestCase {}}- public void testSparsePhraseWithNoPositions() throws CorruptIndexException,- LockObtainFailedException, IOException, InvalidTokenOffsetsException {+ public void testSparsePhraseWithNoPositions() throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox did not jump";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,@@ -248,8 +240,7 @@ public class HighlighterPhraseTest extends LuceneTestCase {}}- public void testSparseSpan() throws CorruptIndexException,- LockObtainFailedException, IOException, InvalidTokenOffsetsException {+ public void testSparseSpan() throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox did not jump";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,@@ -304,7 +295,7 @@ public class HighlighterPhraseTest extends LuceneTestCase {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {this.i++;if (this.i >= this.tokens.length) {return false;@@ -344,7 +335,7 @@ public class HighlighterPhraseTest extends LuceneTestCase {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {this.i++;if (this.i >= this.tokens.length) {return false;diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.javaindex 8e192d6af72..4f0fddbafa8 100644--- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java+++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java@@ -1458,7 +1458,7 @@ public class HighlighterTest extends BaseTokenStreamTestCase implements Formatte}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if(iter.hasNext()) {Token token = iter.next();clearAttributes();@@ -1509,7 +1509,7 @@ public class HighlighterTest extends BaseTokenStreamTestCase implements Formatte}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if(iter.hasNext()) {Token token = iter.next();clearAttributes();diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.javaindex 0f315e1e4b6..8e8bea22ffb 100644--- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java+++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java@@ -19,7 +19,8 @@ package org.apache.lucene.search.highlight;import java.io.IOException;-import org.apache.lucene.analysis.*;+import org.apache.lucene.analysis.Token;+import org.apache.lucene.analysis.TokenStream;import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;@@ -27,7 +28,6 @@ import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;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;@@ -40,7 +40,6 @@ import org.apache.lucene.search.spans.SpanNearQuery;import org.apache.lucene.search.spans.SpanQuery;import org.apache.lucene.search.spans.SpanTermQuery;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.LockObtainFailedException;import org.apache.lucene.util.LuceneTestCase;// LUCENE-2874@@ -57,7 +56,7 @@ public class TokenSourcesTest extends LuceneTestCase {private final PositionIncrementAttribute positionIncrementAttribute = addAttribute(PositionIncrementAttribute.class);@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {this.i++;if (this.i >= this.tokens.length) {return false;@@ -85,8 +84,7 @@ public class TokenSourcesTest extends LuceneTestCase {}}- public void testOverlapWithOffset() throws CorruptIndexException,- LockObtainFailedException, IOException, InvalidTokenOffsetsException {+ public void testOverlapWithOffset() throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox did not jump";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,@@ -129,8 +127,8 @@ public class TokenSourcesTest extends LuceneTestCase {}}- public void testOverlapWithPositionsAndOffset() throws CorruptIndexException,- LockObtainFailedException, IOException, InvalidTokenOffsetsException {+ public void testOverlapWithPositionsAndOffset()+ throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox did not jump";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,@@ -174,8 +172,8 @@ public class TokenSourcesTest extends LuceneTestCase {}}- public void testOverlapWithOffsetExactPhrase() throws CorruptIndexException,- LockObtainFailedException, IOException, InvalidTokenOffsetsException {+ public void testOverlapWithOffsetExactPhrase()+ throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox did not jump";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,@@ -219,8 +217,7 @@ public class TokenSourcesTest extends LuceneTestCase {}public void testOverlapWithPositionsAndOffsetExactPhrase()- throws CorruptIndexException, LockObtainFailedException, IOException,- InvalidTokenOffsetsException {+ throws IOException, InvalidTokenOffsetsException {final String TEXT = "the fox did not jump";final Directory directory = newDirectory();final IndexWriter indexWriter = new IndexWriter(directory,diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.javaindex 007a46b5a70..d2593ed583d 100644--- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java+++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java@@ -323,7 +323,7 @@ public abstract class AbstractTestCase extends LuceneTestCase {}@Override- public void reset() throws IOException {+ public void reset() {startTerm = 0;nextStartOffset = 0;snippet = null;diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/IndexTimeSynonymTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/IndexTimeSynonymTest.javaindex 4be6340cad2..91f07737d6d 100644--- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/IndexTimeSynonymTest.java+++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/IndexTimeSynonymTest.java@@ -303,7 +303,7 @@ public class IndexTimeSynonymTest extends AbstractTestCase {int p = 0;@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if( p >= tokens.length ) return false;clearAttributes();tokens[p++].copyTo(reusableToken);diff --git a/lucene/join/src/java/org/apache/lucene/search/join/TermsQuery.java b/lucene/join/src/java/org/apache/lucene/search/join/TermsQuery.javaindex 71136c4eec2..d20cc2ae9e4 100644--- a/lucene/join/src/java/org/apache/lucene/search/join/TermsQuery.java+++ b/lucene/join/src/java/org/apache/lucene/search/join/TermsQuery.java@@ -74,7 +74,7 @@ class TermsQuery extends MultiTermQuery {private BytesRef seekTerm;private int upto = 0;- SeekingTermSetTermsEnum(TermsEnum tenum, BytesRefHash terms) throws IOException {+ SeekingTermSetTermsEnum(TermsEnum tenum, BytesRefHash terms) {super(tenum);this.terms = terms;diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java b/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.javaindex 51100ed4cf1..618c4a0e7fb 100644--- a/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java+++ b/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java@@ -299,7 +299,7 @@ public class TestJoinUtil extends LuceneTestCase {topScoreDocCollector.collect(doc);}- public void setNextReader(AtomicReaderContext context) throws IOException {+ public void setNextReader(AtomicReaderContext context) {docBase = context.docBase;topScoreDocCollector.setNextReader(context);}@@ -496,7 +496,7 @@ public class TestJoinUtil extends LuceneTestCase {reuse = null;}- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@@ -528,7 +528,7 @@ public class TestJoinUtil extends LuceneTestCase {terms = FieldCache.DEFAULT.getTerms(context.reader(), fromField);}- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@@ -587,7 +587,7 @@ public class TestJoinUtil extends LuceneTestCase {}public boolean acceptsDocsOutOfOrder() {return false;}- public void setScorer(Scorer scorer) throws IOException {}+ public void setScorer(Scorer scorer) {}});} else {toSearcher.search(new MatchAllDocsQuery(), new Collector() {@@ -596,7 +596,7 @@ public class TestJoinUtil extends LuceneTestCase {private int docBase;private final BytesRef spare = new BytesRef();- public void collect(int doc) throws IOException {+ public void collect(int doc) {JoinScore joinScore = joinValueToJoinScores.get(terms.getTerm(doc, spare));if (joinScore == null) {return;@@ -610,7 +610,7 @@ public class TestJoinUtil extends LuceneTestCase {}public boolean acceptsDocsOutOfOrder() {return false;}- public void setScorer(Scorer scorer) throws IOException {}+ public void setScorer(Scorer scorer) {}});}queryVals.put(uniqueRandomValue, docToJoinScore);@@ -625,7 +625,7 @@ public class TestJoinUtil extends LuceneTestCase {private TopDocs createExpectedTopDocs(String queryValue,final boolean from,final ScoreMode scoreMode,- IndexIterationContext context) throws IOException {+ IndexIterationContext context) {Map<Integer, JoinScore> hitsToJoinScores;if (from) {diff --git a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.javaindex e908d10c526..cf1724b3f7e 100644--- a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java+++ b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java@@ -32,7 +32,6 @@ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;-import org.apache.lucene.document.Document;import org.apache.lucene.index.AtomicReader;import org.apache.lucene.index.AtomicReaderContext;import org.apache.lucene.index.FieldInfo;@@ -443,7 +442,7 @@ public class MemoryIndex {}@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@@ -770,13 +769,13 @@ public class MemoryIndex {}@Override- public long getSumDocFreq() throws IOException {+ public long getSumDocFreq() {// each term has df=1return info.sortedTerms.length;}@Override- public int getDocCount() throws IOException {+ public int getDocCount() {return info.sortedTerms.length > 0 ? 1 : 0;}@@ -1065,7 +1064,7 @@ public class MemoryIndex {}@Override- public DocValues docValues(String field) throws IOException {+ public DocValues docValues(String field) {return null;}@@ -1075,7 +1074,7 @@ public class MemoryIndex {private Similarity cachedSimilarity;@Override- public DocValues normValues(String field) throws IOException {+ public DocValues normValues(String field) {DocValues norms = cachedNormValues;Similarity sim = getSimilarity();if (!field.equals(cachedFieldName) || sim != cachedSimilarity) { // not cached?diff --git a/lucene/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.java b/lucene/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.javaindex fc63bacd0c1..95d234a41ef 100644--- a/lucene/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.java+++ b/lucene/misc/src/java/org/apache/lucene/index/BalancedSegmentMergePolicy.java@@ -245,7 +245,7 @@ public class BalancedSegmentMergePolicy extends LogByteSizeMergePolicy {@Overridepublic MergeSpecification findForcedDeletesMerges(SegmentInfos infos)- throws CorruptIndexException, IOException {+ throws IOException {final int numSegs = infos.size();final int numLargeSegs = (numSegs < _numLargeSegments ? numSegs : _numLargeSegments);MergeSpecification spec = null;@@ -335,7 +335,7 @@ public class BalancedSegmentMergePolicy extends LogByteSizeMergePolicy {}}- private OneMerge findOneSegmentToExpunge(SegmentInfos infos, int maxNumSegments) throws IOException {+ private OneMerge findOneSegmentToExpunge(SegmentInfos infos, int maxNumSegments) {int expungeCandidate = -1;int maxDelCount = 0;diff --git a/lucene/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java b/lucene/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.javaindex f26a0e44922..2fc612ba315 100644--- a/lucene/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java+++ b/lucene/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java@@ -180,11 +180,11 @@ public class MultiPassIndexSplitter {*/private static final class FakeDeleteIndexReader extends BaseCompositeReader<FakeDeleteAtomicIndexReader> {- public FakeDeleteIndexReader(IndexReader reader) throws IOException {+ public FakeDeleteIndexReader(IndexReader reader) {super(initSubReaders(reader));}- private static FakeDeleteAtomicIndexReader[] initSubReaders(IndexReader reader) throws IOException {+ private static FakeDeleteAtomicIndexReader[] initSubReaders(IndexReader reader) {final List<AtomicReaderContext> leaves = reader.getTopReaderContext().leaves();final FakeDeleteAtomicIndexReader[] subs = new FakeDeleteAtomicIndexReader[leaves.size()];int i = 0;@@ -206,7 +206,7 @@ public class MultiPassIndexSplitter {}@Override- protected void doClose() throws IOException {}+ protected void doClose() {}// no need to override numDocs/hasDeletions,// as we pass the subreaders directly to IW.addIndexes().diff --git a/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java b/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.javaindex 5772ae5b40e..3b8ea425106 100644--- a/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java+++ b/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java@@ -199,7 +199,7 @@ public class NativeUnixDirectory extends FSDirectory {//}@Override- public void flush() throws IOException {+ public void flush() {// TODO -- I don't think this method is necessary?}@@ -257,7 +257,7 @@ public class NativeUnixDirectory extends FSDirectory {}@Override- public long length() throws IOException {+ public long length() {return fileLength + bufferPos;}diff --git a/lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java b/lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.javaindex 500ca7ac0f8..230b5577f93 100755--- a/lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java+++ b/lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java@@ -290,7 +290,7 @@ public class CustomScoreQuery extends Query {// constructorprivate CustomScorer(CustomScoreProvider provider, CustomWeight w, float qWeight,- Scorer subQueryScorer, Scorer[] valSrcScorers) throws IOException {+ Scorer subQueryScorer, Scorer[] valSrcScorers) {super(w);this.qWeight = qWeight;this.subQueryScorer = subQueryScorer;diff --git a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TFValueSource.java b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TFValueSource.javaindex 5405a0f8bf3..4682efdb0e7 100755--- a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TFValueSource.java+++ b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TFValueSource.java@@ -87,12 +87,12 @@ public class TFValueSource extends TermFreqValueSource {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {return DocIdSetIterator.NO_MORE_DOCS;}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {return DocIdSetIterator.NO_MORE_DOCS;}};diff --git a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TermFreqValueSource.java b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TermFreqValueSource.javaindex 462afe7d9dd..f2b2699e98f 100755--- a/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TermFreqValueSource.java+++ b/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/TermFreqValueSource.java@@ -80,12 +80,12 @@ public class TermFreqValueSource extends DocFreqValueSource {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {return DocIdSetIterator.NO_MORE_DOCS;}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {return DocIdSetIterator.NO_MORE_DOCS;}};diff --git a/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.javaindex ee1d056a9ce..bcfd61edb57 100755--- a/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java+++ b/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java@@ -20,8 +20,16 @@ package org.apache.lucene.queries;import org.apache.lucene.queries.function.FunctionQuery;import org.apache.lucene.queries.function.FunctionTestSetup;import org.apache.lucene.queries.function.ValueSource;-import org.apache.lucene.queries.function.valuesource.FloatFieldSource;-import org.apache.lucene.search.*;+import org.apache.lucene.search.BooleanClause;+import org.apache.lucene.search.BooleanQuery;+import org.apache.lucene.search.Explanation;+import org.apache.lucene.search.FieldCache;+import org.apache.lucene.search.IndexSearcher;+import org.apache.lucene.search.Query;+import org.apache.lucene.search.QueryUtils;+import org.apache.lucene.search.TermQuery;+import org.apache.lucene.search.TermRangeQuery;+import org.apache.lucene.search.TopDocs;import org.junit.BeforeClass;import org.junit.Test;import java.io.IOException;@@ -178,7 +186,7 @@ public class TestCustomScoreQuery extends FunctionTestSetup {final int[] values = FieldCache.DEFAULT.getInts(context.reader(), INT_FIELD, false);return new CustomScoreProvider(context) {@Override- public float customScore(int doc, float subScore, float valSrcScore) throws IOException {+ public float customScore(int doc, float subScore, float valSrcScore) {assertTrue(doc <= context.reader().maxDoc());return values[doc];}diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.javaindex ce73bc2937e..c07323c6633 100644--- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.java+++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.java@@ -17,12 +17,15 @@ package org.apache.lucene.queries.function;* limitations under the License.*/-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader;import org.apache.lucene.queries.function.valuesource.OrdFieldSource;import org.apache.lucene.queries.function.valuesource.ReverseOrdFieldSource;-import org.apache.lucene.search.*;+import org.apache.lucene.search.IndexSearcher;+import org.apache.lucene.search.Query;+import org.apache.lucene.search.QueryUtils;+import org.apache.lucene.search.ScoreDoc;+import org.apache.lucene.search.TopDocs;import org.junit.BeforeClass;import org.junit.Test;@@ -48,7 +51,7 @@ public class TestOrdValues extends FunctionTestSetup {* Test OrdFieldSource*/@Test- public void testOrdFieldRank() throws CorruptIndexException, Exception {+ public void testOrdFieldRank() throws Exception {doTestRank(ID_FIELD, true);}@@ -56,12 +59,12 @@ public class TestOrdValues extends FunctionTestSetup {* Test ReverseOrdFieldSource*/@Test- public void testReverseOrdFieldRank() throws CorruptIndexException, Exception {+ public void testReverseOrdFieldRank() throws Exception {doTestRank(ID_FIELD, false);}// Test that queries based on reverse/ordFieldScore scores correctly- private void doTestRank(String field, boolean inOrder) throws CorruptIndexException, Exception {+ private void doTestRank(String field, boolean inOrder) throws Exception {IndexReader r = DirectoryReader.open(dir);IndexSearcher s = new IndexSearcher(r);ValueSource vs;@@ -98,7 +101,7 @@ public class TestOrdValues extends FunctionTestSetup {* Test exact score for OrdFieldSource*/@Test- public void testOrdFieldExactScore() throws CorruptIndexException, Exception {+ public void testOrdFieldExactScore() throws Exception {doTestExactScore(ID_FIELD, true);}@@ -106,13 +109,13 @@ public class TestOrdValues extends FunctionTestSetup {* Test exact score for ReverseOrdFieldSource*/@Test- public void testReverseOrdFieldExactScore() throws CorruptIndexException, Exception {+ public void testReverseOrdFieldExactScore() throws Exception {doTestExactScore(ID_FIELD, false);}// Test that queries based on reverse/ordFieldScore returns docs with expected score.- private void doTestExactScore(String field, boolean inOrder) throws CorruptIndexException, Exception {+ private void doTestExactScore(String field, boolean inOrder) throws Exception {IndexReader r = DirectoryReader.open(dir);IndexSearcher s = new IndexSearcher(r);ValueSource vs;diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.javaindex 2c6e7b97ff7..3e62f786936 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java@@ -478,11 +478,7 @@ public abstract class QueryParserBase {PositionIncrementAttribute posIncrAtt = null;int numTokens = 0;- try {- buffer.reset();- } catch (IOException e) {- throw new ParseException("Unable to initialize TokenStream to analyze query text", e);- }+ buffer.reset();if (buffer.hasAttribute(TermToBytesRefAttribute.class)) {termAtt = buffer.getAttribute(TermToBytesRefAttribute.class);@@ -1072,7 +1068,7 @@ public abstract class QueryParserBase {}// extracted from the .jj grammar- Query handleBoost(Query q, Token boost) throws ParseException {+ Query handleBoost(Query q, Token boost) {if (boost != null) {float f = (float) 1.0;try {diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.javaindex 88399c92752..ec53ca622c6 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java@@ -21,7 +21,6 @@ import java.util.List;import org.apache.lucene.queryparser.flexible.messages.MessageImpl;import org.apache.lucene.queryparser.flexible.core.QueryNodeError;-import org.apache.lucene.queryparser.flexible.core.QueryNodeException;import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages;import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax;@@ -43,10 +42,8 @@ public class BoostQueryNode extends QueryNodeImpl {* the query to be boosted* @param value* the boost value, it may vary from 0.0 to 1.0- *- * @throws QueryNodeException*/- public BoostQueryNode(QueryNode query, float value) throws QueryNodeException {+ public BoostQueryNode(QueryNode query, float value) {if (query == null) {throw new QueryNodeError(new MessageImpl(QueryParserMessages.NODE_ACTION_NOT_SUPPORTED, "query", "null"));diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.javaindex 20b7eb62b25..72721114557 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java@@ -19,23 +19,17 @@ package org.apache.lucene.queryparser.flexible.core.nodes;import org.apache.lucene.queryparser.flexible.messages.MessageImpl;import org.apache.lucene.queryparser.flexible.core.QueryNodeError;-import org.apache.lucene.queryparser.flexible.core.QueryNodeException;import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages;import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax;-import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException;public class PhraseSlopQueryNode extends QueryNodeImpl implements FieldableNode {private int value = 0;/**- * @throws QueryNodeException- * @throws QueryNodeParseException- * @exception QueryNodeParseException- * throw in overridden method to disallow+ * @exception QueryNodeError throw in overridden method to disallow*/- public PhraseSlopQueryNode(QueryNode query, int value)- throws QueryNodeException {+ public PhraseSlopQueryNode(QueryNode query, int value) {if (query == null) {throw new QueryNodeError(new MessageImpl(QueryParserMessages.NODE_ACTION_NOT_SUPPORTED, "query", "null"));diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/BooleanQueryNodeBuilder.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/BooleanQueryNodeBuilder.javaindex c9d401e956a..da58d0cd23a 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/BooleanQueryNodeBuilder.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/BooleanQueryNodeBuilder.java@@ -83,8 +83,7 @@ public class BooleanQueryNodeBuilder implements StandardQueryBuilder {}- private static BooleanClause.Occur getModifierValue(QueryNode node)- throws QueryNodeException {+ private static BooleanClause.Occur getModifierValue(QueryNode node) {if (node instanceof ModifierQueryNode) {ModifierQueryNode mNode = ((ModifierQueryNode) node);diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/StandardBooleanQueryNodeBuilder.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/StandardBooleanQueryNodeBuilder.javaindex 82f689e936a..ba91dc339da 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/StandardBooleanQueryNodeBuilder.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/StandardBooleanQueryNodeBuilder.java@@ -84,8 +84,7 @@ public class StandardBooleanQueryNodeBuilder implements StandardQueryBuilder {}- private static BooleanClause.Occur getModifierValue(QueryNode node)- throws QueryNodeException {+ private static BooleanClause.Occur getModifierValue(QueryNode node) {if (node instanceof ModifierQueryNode) {ModifierQueryNode mNode = ((ModifierQueryNode) node);diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.javaindex 8451a10f4a8..8cc48de4016 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java@@ -97,7 +97,7 @@ public class QueryTemplateManager {* Fast means of constructing query using a precompiled stylesheet*/public static String getQueryAsXmlString(Properties formProperties, Templates template)- throws SAXException, IOException, ParserConfigurationException, TransformerException {+ throws ParserConfigurationException, TransformerException {ByteArrayOutputStream baos = new ByteArrayOutputStream();StreamResult result = new StreamResult(baos);transformCriteria(formProperties, template, result);@@ -120,7 +120,7 @@ public class QueryTemplateManager {* Fast means of constructing query using a cached,precompiled stylesheet*/public static Document getQueryAsDOM(Properties formProperties, Templates template)- throws SAXException, IOException, ParserConfigurationException, TransformerException {+ throws ParserConfigurationException, TransformerException {DOMResult result = new DOMResult();transformCriteria(formProperties, template, result);return (Document) result.getNode();@@ -159,13 +159,13 @@ public class QueryTemplateManager {* Fast transformation using a pre-compiled stylesheet (suitable for production environments)*/public static void transformCriteria(Properties formProperties, Templates template, Result result)- throws SAXException, IOException, ParserConfigurationException, TransformerException {+ throws ParserConfigurationException, TransformerException {transformCriteria(formProperties, template.newTransformer(), result);}public static void transformCriteria(Properties formProperties, Transformer transformer, Result result)- throws SAXException, IOException, ParserConfigurationException, TransformerException {+ throws ParserConfigurationException, TransformerException {dbf.setNamespaceAware(true);//Create an XML document representing the search index document.diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.javaindex d14733d0993..b8a76441770 100644--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java@@ -18,7 +18,6 @@ package org.apache.lucene.queryparser.classic;*/import org.apache.lucene.analysis.Analyzer;-import org.apache.lucene.analysis.TokenStream;import org.apache.lucene.analysis.Tokenizer;import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;@@ -67,7 +66,7 @@ public class TestMultiPhraseQueryParsing extends LuceneTestCase {}@Override- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {clearAttributes();if (upto < tokens.length) {final TokenAndPos token = tokens[upto++];diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.javaindex 8525d4611af..8926a4a7b4f 100644--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java@@ -446,7 +446,7 @@ public class TestPrecedenceQueryParser extends LuceneTestCase {}/** for testing DateTools support */- private String getDate(Date d, DateTools.Resolution resolution) throws Exception {+ private String getDate(Date d, DateTools.Resolution resolution) {return DateTools.dateToString(d, resolution);}diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.javaindex 7c387c150c0..4f66aa856fd 100644--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java@@ -680,8 +680,7 @@ public class TestQPHelper extends LuceneTestCase {}/** for testing DateTools support */- private String getDate(Date d, DateTools.Resolution resolution)- throws Exception {+ private String getDate(Date d, DateTools.Resolution resolution) {return DateTools.dateToString(d, resolution);}diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.javaindex f87af0e0a29..431ebc08812 100644--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java@@ -586,7 +586,7 @@ public abstract class QueryParserTestBase extends LuceneTestCase {}/** for testing DateTools support */- private String getDate(Date d, DateTools.Resolution resolution) throws Exception {+ private String getDate(Date d, DateTools.Resolution resolution) {return DateTools.dateToString(d, resolution);}@@ -936,13 +936,13 @@ public abstract class QueryParserTestBase extends LuceneTestCase {final int[] type = new int[1];QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "field", new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)) {@Override- protected Query getWildcardQuery(String field, String termStr) throws ParseException {+ protected Query getWildcardQuery(String field, String termStr) {// override error checking of superclasstype[0]=1;return new TermQuery(new Term(field,termStr));}@Override- protected Query getPrefixQuery(String field, String termStr) throws ParseException {+ protected Query getPrefixQuery(String field, String termStr) {// override error checking of superclasstype[0]=2;return new TermQuery(new Term(field,termStr));diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.javaindex 299139c9fe0..6933701e2e3 100644--- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java+++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java@@ -63,11 +63,9 @@ public class SlowCollatedTermRangeTermsEnum extends FilteredTermsEnum {* The collator to use to collate index Terms, to determine their* membership in the range bounded by <code>lowerTerm</code> and* <code>upperTerm</code>.- *- * @throws IOException*/public SlowCollatedTermRangeTermsEnum(TermsEnum tenum, String lowerTermText, String upperTermText,- boolean includeLower, boolean includeUpper, Collator collator) throws IOException {+ boolean includeLower, boolean includeUpper, Collator collator) {super(tenum);this.collator = collator;this.upperTermText = upperTermText;diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexTermsEnum.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexTermsEnum.javaindex 118ffbff5b0..bce7bf830de 100644--- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexTermsEnum.java+++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexTermsEnum.java@@ -23,8 +23,6 @@ import org.apache.lucene.index.TermsEnum;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.StringHelper;-import java.io.IOException;-/*** Subclass of FilteredTermEnum for enumerating all terms that match the* specified regular expression term using the specified regular expression@@ -39,7 +37,7 @@ public class RegexTermsEnum extends FilteredTermsEnum {private RegexCapabilities.RegexMatcher regexImpl;private final BytesRef prefixRef;- public RegexTermsEnum(TermsEnum tenum, Term term, RegexCapabilities regexCap) throws IOException {+ public RegexTermsEnum(TermsEnum tenum, Term term, RegexCapabilities regexCap) {super(tenum);String text = term.text();this.regexImpl = regexCap.compile(text);diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.javaindex cb174131705..fbe09d98198 100644--- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java+++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java@@ -1,6 +1,5 @@package org.apache.lucene.sandbox.queries;-import java.io.IOException;import java.text.Collator;import java.util.Locale;@@ -90,7 +89,7 @@ public class TestSlowCollationMethods extends LuceneTestCase {public void testSort() throws Exception {SortField sf = new SortField("field", new FieldComparatorSource() {@Override- public FieldComparator<String> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException {+ public FieldComparator<String> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) {return new SlowCollatedStringComparator(numHits, fieldname, collator);}});diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.javaindex 4d78c9fd374..0f35b9de88f 100644--- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java@@ -34,7 +34,6 @@ import org.apache.lucene.spatial.prefix.tree.Node;import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;import org.apache.lucene.spatial.util.CachedDistanceValueSource;-import java.io.IOException;import java.util.Iterator;import java.util.List;import java.util.Map;@@ -126,7 +125,7 @@ public abstract class PrefixTreeStrategy extends SpatialStrategy<SimpleSpatialFiCharSequence nextTokenStringNeedingLeaf = null;@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {clearAttributes();if (nextTokenStringNeedingLeaf != null) {termAtt.append(nextTokenStringNeedingLeaf);diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/BytesRefList.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/BytesRefList.javaindex dbb60800cab..ff8c400fb49 100644--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/BytesRefList.java+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/BytesRefList.java@@ -17,7 +17,6 @@ package org.apache.lucene.search.suggest;* the License.*/-import java.io.IOException;import java.util.Arrays;import java.util.Comparator;@@ -190,7 +189,7 @@ public final class BytesRefList {int pos = 0;@Override- public BytesRef next() throws IOException {+ public BytesRef next() {if (pos < size) {return get(spare, ords == null ? pos++ : ords[pos++]);}diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.javaindex b2590d58119..579a5f4facc 100755--- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java+++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;import org.apache.lucene.analysis.MockAnalyzer;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;-import org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.DirectoryReader;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.IndexWriter;@@ -103,7 +102,7 @@ public class TestSpellChecker extends LuceneTestCase {}- public void testBuild() throws CorruptIndexException, IOException {+ public void testBuild() throws IOException {IndexReader r = DirectoryReader.open(userindex);spellChecker.clearIndex();diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TermFreqArrayIterator.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TermFreqArrayIterator.javaindex cb963ea062c..06d7301f843 100644--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TermFreqArrayIterator.java+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TermFreqArrayIterator.java@@ -17,7 +17,6 @@ package org.apache.lucene.search.suggest;* limitations under the License.*/-import java.io.IOException;import java.util.Arrays;import java.util.Comparator;import java.util.Iterator;@@ -50,7 +49,7 @@ public final class TermFreqArrayIterator implements TermFreqIterator {}@Override- public BytesRef next() throws IOException {+ public BytesRef next() {if (i.hasNext()) {current = i.next();spare.copyBytes(current.term);diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/CannedTokenStream.java b/lucene/test-framework/src/java/org/apache/lucene/analysis/CannedTokenStream.javaindex 8bfa21ea19d..cc5058b4615 100644--- a/lucene/test-framework/src/java/org/apache/lucene/analysis/CannedTokenStream.java+++ b/lucene/test-framework/src/java/org/apache/lucene/analysis/CannedTokenStream.java@@ -17,8 +17,6 @@ package org.apache.lucene.analysis;* limitations under the License.*/-import java.io.IOException;-import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;@@ -42,7 +40,7 @@ public final class CannedTokenStream extends TokenStream {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (upto < tokens.length) {final Token token = tokens[upto++];// TODO: can we just capture/restoreState sodiff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/EmptyTokenizer.java b/lucene/test-framework/src/java/org/apache/lucene/analysis/EmptyTokenizer.javaindex 3a20afcb410..3d33330206a 100644--- a/lucene/test-framework/src/java/org/apache/lucene/analysis/EmptyTokenizer.java+++ b/lucene/test-framework/src/java/org/apache/lucene/analysis/EmptyTokenizer.java@@ -17,7 +17,6 @@ package org.apache.lucene.analysis;* limitations under the License.*/-import java.io.IOException;import java.io.Reader;/**@@ -30,7 +29,7 @@ public final class EmptyTokenizer extends Tokenizer {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {return false;}}diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/mockintblock/MockFixedIntBlockPostingsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/codecs/mockintblock/MockFixedIntBlockPostingsFormat.javaindex 5a64166b9eb..8a0e9e157d8 100644--- a/lucene/test-framework/src/java/org/apache/lucene/codecs/mockintblock/MockFixedIntBlockPostingsFormat.java+++ b/lucene/test-framework/src/java/org/apache/lucene/codecs/mockintblock/MockFixedIntBlockPostingsFormat.java@@ -84,7 +84,7 @@ public class MockFixedIntBlockPostingsFormat extends PostingsFormat {return new FixedIntBlockIndexInput(dir.openInput(fileName, context)) {@Override- protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException {+ protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) {return new BlockReader() {public void seek(long pos) {}public void readBlock() throws IOException {diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/mockintblock/MockVariableIntBlockPostingsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/codecs/mockintblock/MockVariableIntBlockPostingsFormat.javaindex dc25fb13824..8f569561d0e 100644--- a/lucene/test-framework/src/java/org/apache/lucene/codecs/mockintblock/MockVariableIntBlockPostingsFormat.java+++ b/lucene/test-framework/src/java/org/apache/lucene/codecs/mockintblock/MockVariableIntBlockPostingsFormat.java@@ -85,7 +85,7 @@ public class MockVariableIntBlockPostingsFormat extends PostingsFormat {return new VariableIntBlockIndexInput(in) {@Override- protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException {+ protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) {return new BlockReader() {public void seek(long pos) {}public int readBlock() throws IOException {diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterAtomicReader.java b/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterAtomicReader.javaindex 6c831a7d7ce..f7f4cd8c81e 100644--- a/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterAtomicReader.java+++ b/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterAtomicReader.java@@ -21,8 +21,6 @@ import java.io.IOException;import java.util.ArrayList;import java.util.Set;-import org.apache.lucene.index.FilterAtomicReader;-public final class FieldFilterAtomicReader extends FilterAtomicReader {private final Set<String> fields;@@ -63,7 +61,7 @@ public final class FieldFilterAtomicReader extends FilterAtomicReader {}@Override- public void document(final int docID, final StoredFieldVisitor visitor) throws CorruptIndexException, IOException {+ public void document(final int docID, final StoredFieldVisitor visitor) throws IOException {super.document(docID, new StoredFieldVisitor() {@Overridepublic void binaryField(FieldInfo fieldInfo, byte[] value, int offset, int length) throws IOException {diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/MockRandomMergePolicy.java b/lucene/test-framework/src/java/org/apache/lucene/index/MockRandomMergePolicy.javaindex 2cdd657e84a..1890501eae7 100644--- a/lucene/test-framework/src/java/org/apache/lucene/index/MockRandomMergePolicy.java+++ b/lucene/test-framework/src/java/org/apache/lucene/index/MockRandomMergePolicy.java@@ -60,7 +60,7 @@ public class MockRandomMergePolicy extends MergePolicy {@Overridepublic MergeSpecification findForcedMerges(SegmentInfos segmentInfos, int maxSegmentCount, Map<SegmentInfoPerCommit,Boolean> segmentsToMerge)- throws CorruptIndexException, IOException {+ throws IOException {final List<SegmentInfoPerCommit> eligibleSegments = new ArrayList<SegmentInfoPerCommit>();for(SegmentInfoPerCommit info : segmentInfos) {@@ -96,9 +96,7 @@ public class MockRandomMergePolicy extends MergePolicy {}@Override- public MergeSpecification findForcedDeletesMerges(- SegmentInfos segmentInfos)- throws CorruptIndexException, IOException {+ public MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos) throws IOException {return findMerges(segmentInfos);}diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java b/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.javaindex d3ced90bb45..5629c0a171b 100644--- a/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java+++ b/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java@@ -326,28 +326,28 @@ public class RandomIndexWriter implements Closeable {maybeCommit();}- public void addIndexes(Directory... dirs) throws CorruptIndexException, IOException {+ public void addIndexes(Directory... dirs) throws IOException {w.addIndexes(dirs);}- public void addIndexes(IndexReader... readers) throws CorruptIndexException, IOException {+ public void addIndexes(IndexReader... readers) throws IOException {w.addIndexes(readers);}- public void deleteDocuments(Term term) throws CorruptIndexException, IOException {+ public void deleteDocuments(Term term) throws IOException {w.deleteDocuments(term);}- public void deleteDocuments(Query q) throws CorruptIndexException, IOException {+ public void deleteDocuments(Query q) throws IOException {w.deleteDocuments(q);}- public void commit() throws CorruptIndexException, IOException {+ public void commit() throws IOException {w.commit();switchDoDocValues();}- public int numDocs() throws IOException {+ public int numDocs() {return w.numDocs();}diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.javaindex 11f63298cdd..69f946e7891 100644--- a/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java+++ b/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java@@ -117,8 +117,7 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCasfinal long stopTime,final Set<String> delIDs,final Set<String> delPackIDs,- final List<SubDocs> allSubDocs)- throws Exception {+ final List<SubDocs> allSubDocs) {final Thread[] threads = new Thread[numThreads];for(int thread=0;thread<numThreads;thread++) {threads[thread] = new Thread() {diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java b/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.javaindex 987a582b33b..2f29eea6ed5 100644--- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java+++ b/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java@@ -91,7 +91,7 @@ public class AssertingIndexSearcher extends IndexSearcher {}@Override- public float getValueForNormalization() throws IOException {+ public float getValueForNormalization() {throw new IllegalStateException("Weight already normalized.");}diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java b/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.javaindex b7c870ffaf5..70a4a98cc6c 100644--- a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java+++ b/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java@@ -27,7 +27,6 @@ import junit.framework.Assert;import org.apache.lucene.index.AtomicReaderContext;import org.apache.lucene.index.IndexReader;-import org.apache.lucene.store.Directory;import org.apache.lucene.util.LuceneTestCase;/**@@ -185,8 +184,7 @@ public class CheckHits {}/** Tests that a Hits has an expected order of documents */- public static void checkDocIds(String mes, int[] results, ScoreDoc[] hits)- throws IOException {+ public static void checkDocIds(String mes, int[] results, ScoreDoc[] hits) {Assert.assertEquals(mes + " nr of hits", hits.length, results.length);for (int i = 0; i < results.length; i++) {Assert.assertEquals(mes + " doc nrs for hit " + i, results[i], hits[i].doc);@@ -200,15 +198,14 @@ public class CheckHits {Query query,ScoreDoc[] hits1,ScoreDoc[] hits2,- int[] results)- throws IOException {+ int[] results) {checkDocIds("hits1", results, hits1);checkDocIds("hits2", results, hits2);checkEqual(query, hits1, hits2);}- public static void checkEqual(Query query, ScoreDoc[] hits1, ScoreDoc[] hits2) throws IOException {+ public static void checkEqual(Query query, ScoreDoc[] hits1, ScoreDoc[] hits2) {final float scoreTolerance = 1.0e-6f;if (hits1.length != hits2.length) {Assert.fail("Unequal lengths: hits1="+hits1.length+",hits2="+hits2.length);@@ -231,7 +228,7 @@ public class CheckHits {}}- public static String hits2str(ScoreDoc[] hits1, ScoreDoc[] hits2, int start, int end) throws IOException {+ public static String hits2str(ScoreDoc[] hits1, ScoreDoc[] hits2, int start, int end) {StringBuilder sb = new StringBuilder();int len1=hits1==null ? 0 : hits1.length;int len2=hits2==null ? 0 : hits2.length;@@ -422,7 +419,7 @@ public class CheckHits {* @see ExplanationAsserter*/public static class ExplanationAssertingSearcher extends IndexSearcher {- public ExplanationAssertingSearcher(IndexReader r) throws IOException {+ public ExplanationAssertingSearcher(IndexReader r) {super(r);}protected void checkExplanations(Query q) throws IOException {diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java b/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.javaindex d6172ced84b..914297858a1 100644--- a/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java+++ b/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java@@ -141,7 +141,7 @@ public class QueryUtils {public static class FCInvisibleMultiReader extends MultiReader {private final Object cacheKey = new Object();- public FCInvisibleMultiReader(IndexReader... readers) throws IOException {+ public FCInvisibleMultiReader(IndexReader... readers) {super(readers);}@@ -268,7 +268,7 @@ public class QueryUtils {private int leafPtr;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.sc = scorer;}@@ -375,7 +375,7 @@ public class QueryUtils {private int leafPtr;private Bits liveDocs;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Overridediff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.javaindex 2c85fa38806..c8e8cf87afa 100644--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java@@ -282,7 +282,7 @@ public class MockDirectoryWrapper extends Directory {}}- public synchronized void clearCrash() throws IOException {+ public synchronized void clearCrash() {crashed = false;openLocks.clear();}@@ -617,7 +617,7 @@ public class MockDirectoryWrapper extends Directory {* checkIndex() or not. It might mask real problems, where we silently* don't checkindex at all. instead we look for a segments file.*/- private boolean indexPossiblyExists(Directory d) throws IOException {+ private boolean indexPossiblyExists(Directory d) {String files[];try {files = d.listAll();diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/CloseableDirectory.java b/lucene/test-framework/src/java/org/apache/lucene/util/CloseableDirectory.javaindex 8dafa6a1aba..11bfabc456e 100644--- a/lucene/test-framework/src/java/org/apache/lucene/util/CloseableDirectory.java+++ b/lucene/test-framework/src/java/org/apache/lucene/util/CloseableDirectory.java@@ -1,7 +1,6 @@package org.apache.lucene.util;import java.io.Closeable;-import java.io.IOException;import org.apache.lucene.store.MockDirectoryWrapper;import org.junit.Assert;@@ -39,7 +38,7 @@ final class CloseableDirectory implements Closeable {}@Override- public void close() throws IOException {+ public void close() {// We only attempt to check open/closed state if there were no other test// failures.try {diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.javaindex 39320c87791..14ad8edd6cc 100644--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java@@ -755,7 +755,7 @@ public abstract class LuceneTestCase extends Assert {* some features of Windows, such as not allowing open files to be* overwritten.*/- public static MockDirectoryWrapper newDirectory() throws IOException {+ public static MockDirectoryWrapper newDirectory() {return newDirectory(random());}@@ -763,7 +763,7 @@ public abstract class LuceneTestCase extends Assert {* Returns a new Directory instance, using the specified random.* See {@link #newDirectory()} for more information.*/- public static MockDirectoryWrapper newDirectory(Random r) throws IOException {+ public static MockDirectoryWrapper newDirectory(Random r) {Directory impl = newDirectoryImpl(r, TEST_DIRECTORY);MockDirectoryWrapper dir = new MockDirectoryWrapper(r, maybeNRTWrap(r, impl));closeAfterSuite(new CloseableDirectory(dir, suiteFailureMarker));@@ -785,12 +785,12 @@ public abstract class LuceneTestCase extends Assert {}/** Returns a new FSDirectory instance over the given file, which must be a folder. */- public static MockDirectoryWrapper newFSDirectory(File f) throws IOException {+ public static MockDirectoryWrapper newFSDirectory(File f) {return newFSDirectory(f, null);}/** Returns a new FSDirectory instance over the given file, which must be a folder. */- public static MockDirectoryWrapper newFSDirectory(File f, LockFactory lf) throws IOException {+ public static MockDirectoryWrapper newFSDirectory(File f, LockFactory lf) {String fsdirClass = TEST_DIRECTORY;if (fsdirClass.equals("random")) {fsdirClass = RandomPicks.randomFrom(random(), FS_DIRECTORIES);diff --git a/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java b/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.javaindex 225dce735c3..52a85eb29b8 100644--- a/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java+++ b/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java@@ -147,7 +147,7 @@ public class CarrotClusteringEngine extends SearchClusteringEngine {final IResource foundResource = new IResource() {@Override- public InputStream open() throws IOException {+ public InputStream open() {return new ByteArrayInputStream(asBytes);}diff --git a/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/LuceneCarrot2StemmerFactory.java b/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/LuceneCarrot2StemmerFactory.javaindex df64207d77b..9170e8b984e 100644--- a/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/LuceneCarrot2StemmerFactory.java+++ b/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/LuceneCarrot2StemmerFactory.java@@ -180,7 +180,7 @@ public class LuceneCarrot2StemmerFactory implements IStemmerFactory {private char[] buffer = new char[0];- private LuceneStemmerAdapter() throws Exception {+ private LuceneStemmerAdapter() {delegate = new org.apache.lucene.analysis.ar.ArabicStemmer();normalizer = new org.apache.lucene.analysis.ar.ArabicNormalizer();}diff --git a/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/LuceneCarrot2TokenizerFactory.java b/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/LuceneCarrot2TokenizerFactory.javaindex 6f3f4e4ab45..16b69bdcc6c 100644--- a/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/LuceneCarrot2TokenizerFactory.java+++ b/solr/contrib/clustering/src/java/org/apache/solr/handler/clustering/carrot2/LuceneCarrot2TokenizerFactory.java@@ -141,7 +141,7 @@ public class LuceneCarrot2TokenizerFactory implements ITokenizerFactory {array.reset(term.buffer(), 0, term.length());}- public void reset(Reader input) throws IOException {+ public void reset(Reader input) {try {sentenceTokenizer.reset(input);wordTokenFilter = (TokenStream) tokenFilterClass.getConstructor(diff --git a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/carrot2/DuplicatingTokenizerFactory.java b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/carrot2/DuplicatingTokenizerFactory.javaindex 55400604ee8..2d0e584f679 100644--- a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/carrot2/DuplicatingTokenizerFactory.java+++ b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/carrot2/DuplicatingTokenizerFactory.java@@ -39,7 +39,7 @@ public class DuplicatingTokenizerFactory implements ITokenizerFactory {}@Override- public void reset(Reader input) throws IOException {+ public void reset(Reader input) {delegate.reset(input);}diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestErrorHandling.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestErrorHandling.javaindex 450c1e3cf64..5edc9d862de 100644--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestErrorHandling.java+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestErrorHandling.java@@ -46,7 +46,7 @@ public class TestErrorHandling extends AbstractDataImportHandlerTestCase {}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSolrEntityProcessorEndToEnd.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSolrEntityProcessorEndToEnd.javaindex 4dddf27bb47..36cb3f690a4 100644--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSolrEntityProcessorEndToEnd.java+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSolrEntityProcessorEndToEnd.java@@ -101,13 +101,13 @@ public class TestSolrEntityProcessorEndToEnd extends AbstractDataImportHandlerTe//TODO: fix this test to close its directoriesstatic String savedFactory;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {savedFactory = System.getProperty("solr.DirectoryFactory");System.setProperty("solr.directoryFactory", "solr.StandardDirectoryFactory");}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.javaindex fd7bf2717e0..c232ea658c7 100644--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.java+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.java@@ -22,7 +22,6 @@ import org.junit.BeforeClass;import org.junit.Test;import java.io.File;-import java.io.FileOutputStream;import java.util.ArrayList;import java.util.Collections;import java.util.List;@@ -70,7 +69,7 @@ public class TestSqlEntityProcessorDelta extends AbstractDataImportHandlerTestCa}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {diff --git a/solr/core/src/java/org/apache/solr/analysis/TrieTokenizerFactory.java b/solr/core/src/java/org/apache/solr/analysis/TrieTokenizerFactory.javaindex bb314dcdd70..b760a2ed18b 100644--- a/solr/core/src/java/org/apache/solr/analysis/TrieTokenizerFactory.java+++ b/solr/core/src/java/org/apache/solr/analysis/TrieTokenizerFactory.java@@ -73,15 +73,11 @@ final class TrieTokenizer extends Tokenizer {this.precisionStep = precisionStep;this.ts = ts;- try {- reset(input);- } catch (IOException e) {- throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unable to create TrieIndexTokenizer", e);- }+ reset(input);}@Override- public void reset(Reader input) throws IOException {+ public void reset(Reader input) {try {super.reset(input);input = super.input;@@ -132,7 +128,7 @@ final class TrieTokenizer extends Tokenizer {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (ts.incrementToken()) {ofsAtt.setOffset(startOfs, endOfs);return true;diff --git a/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java b/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.javaindex 9e19e93e74d..a67a9c367b9 100644--- a/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java+++ b/solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java@@ -21,9 +21,7 @@ import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;-import java.util.Set;-import org.apache.lucene.document.Document;import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.SolrServer;import org.apache.solr.client.solrj.SolrServerException;@@ -45,9 +43,6 @@ import org.apache.solr.request.SolrRequestInfo;import org.apache.solr.response.BinaryResponseWriter;import org.apache.solr.response.ResultContext;import org.apache.solr.response.SolrQueryResponse;-import org.apache.solr.response.transform.DocTransformer;-import org.apache.solr.search.DocIterator;-import org.apache.solr.search.DocList;import org.apache.solr.servlet.SolrRequestParsers;/**@@ -187,7 +182,7 @@ public class EmbeddedSolrServer extends SolrServernew JavaBinCodec(resolver) {@Override- public void writeSolrDocument(SolrDocument doc) throws IOException {+ public void writeSolrDocument(SolrDocument doc) {callback.streamSolrDocument( doc );//super.writeSolrDocument( doc, fields );}diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.javaindex 31c40deb781..4d0ea50cd00 100644--- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java+++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java@@ -156,8 +156,7 @@ public class Overseer {}private CloudState processMessage(CloudState cloudState,- final ZkNodeProps message, final String operation)- throws KeeperException, InterruptedException {+ final ZkNodeProps message, final String operation) {if ("state".equals(operation)) {cloudState = updateState(cloudState, message);} else if ("deletecore".equals(operation)) {@@ -197,10 +196,8 @@ public class Overseer {}/*** Try to assign core to the cluster.- * @throws KeeperException- * @throws InterruptedException*/- private CloudState updateState(CloudState state, final ZkNodeProps message) throws KeeperException, InterruptedException {+ private CloudState updateState(CloudState state, final ZkNodeProps message) {final String collection = message.get(ZkStateReader.COLLECTION_PROP);final String zkCoreNodeName = message.get(ZkStateReader.NODE_NAME_PROP) + "_" + message.get(ZkStateReader.CORE_NAME_PROP);final Integer numShards = message.get(ZkStateReader.NUM_SHARDS_PROP)!=null?Integer.parseInt(message.get(ZkStateReader.NUM_SHARDS_PROP)):null;@@ -379,7 +376,7 @@ public class Overseer {}}- public Overseer(final ZkStateReader reader, final String id) throws KeeperException, InterruptedException {+ public Overseer(final ZkStateReader reader, final String id) {log.info("Overseer (id=" + id + ") starting");createOverseerNode(reader.getZkClient());//launch cluster state updater threaddiff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.javaindex 36ffb9fed81..8928e1206d3 100644--- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java+++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java@@ -18,12 +18,10 @@ package org.apache.solr.cloud;*/import java.io.IOException;-import java.net.MalformedURLException;import java.util.Collections;import java.util.List;import java.util.concurrent.ExecutionException;import java.util.concurrent.Future;-import java.util.concurrent.TimeoutException;import org.apache.solr.client.solrj.SolrServerException;import org.apache.solr.client.solrj.impl.HttpSolrServer;@@ -162,8 +160,7 @@ public class RecoveryStrategy extends Thread implements SafeStopThread {}}- private void commitOnLeader(String leaderUrl) throws MalformedURLException,- SolrServerException, IOException {+ private void commitOnLeader(String leaderUrl) throws SolrServerException, IOException {HttpSolrServer server = new HttpSolrServer(leaderUrl);server.setConnectionTimeout(30000);server.setSoTimeout(30000);@@ -176,7 +173,7 @@ public class RecoveryStrategy extends Thread implements SafeStopThread {}private void sendPrepRecoveryCmd(String leaderBaseUrl,- String leaderCoreName) throws MalformedURLException, SolrServerException,+ String leaderCoreName) throws SolrServerException,IOException {HttpSolrServer server = new HttpSolrServer(leaderBaseUrl);server.setConnectionTimeout(45000);@@ -430,7 +427,7 @@ public class RecoveryStrategy extends Thread implements SafeStopThread {}private Future<RecoveryInfo> replay(UpdateLog ulog)- throws InterruptedException, ExecutionException, TimeoutException {+ throws InterruptedException, ExecutionException {Future<RecoveryInfo> future = ulog.applyBufferedUpdates();if (future == null) {// no replay needed\diff --git a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.javaindex 6df34f187d4..3034d12ac9a 100644--- a/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java+++ b/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java@@ -17,14 +17,11 @@ package org.apache.solr.cloud;* limitations under the License.*/-import java.io.IOException;-import java.net.MalformedURLException;import java.util.ArrayList;import java.util.List;import java.util.Map;import org.apache.http.client.HttpClient;-import org.apache.solr.client.solrj.SolrServerException;import org.apache.solr.client.solrj.impl.HttpClientUtil;import org.apache.solr.client.solrj.impl.HttpSolrServer;import org.apache.solr.client.solrj.request.CoreAdminRequest.RequestRecovery;@@ -160,8 +157,7 @@ public class SyncStrategy {}private boolean syncWithReplicas(ZkController zkController, SolrCore core,- ZkNodeProps props, String collection, String shardId)- throws MalformedURLException, SolrServerException, IOException {+ ZkNodeProps props, String collection, String shardId) {List<ZkCoreNodeProps> nodes = zkController.getZkStateReader().getReplicaProps(collection, shardId,props.get(ZkStateReader.NODE_NAME_PROP),@@ -191,8 +187,7 @@ public class SyncStrategy {}private void syncToMe(ZkController zkController, String collection,- String shardId, ZkNodeProps leaderProps) throws MalformedURLException,- SolrServerException, IOException {+ String shardId, ZkNodeProps leaderProps) {// sync everyone else// TODO: we should do this in parallel at leastdiff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.javaindex 4381f654d91..6164e2103d7 100644--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java@@ -26,7 +26,6 @@ import java.util.Iterator;import java.util.List;import java.util.Map;import java.util.Properties;-import java.util.concurrent.ExecutionException;import java.util.concurrent.Future;import java.util.concurrent.TimeoutException;import java.util.regex.Matcher;@@ -460,10 +459,9 @@ public final class ZkController {* @return config value* @throws KeeperException* @throws InterruptedException- * @throws IOException*/public String readConfigName(String collection) throws KeeperException,- InterruptedException, IOException {+ InterruptedException {String configName = null;@@ -685,17 +683,12 @@ public final class ZkController {* @param core* @param cc* @return whether or not a recovery was started- * @throws InterruptedException- * @throws KeeperException- * @throws IOException- * @throws ExecutionException*/private boolean checkRecovery(String coreName, final CoreDescriptor desc,boolean recoverReloadedCores, final boolean isLeader,final CloudDescriptor cloudDesc, final String collection,final String shardZkNodeName, String shardId, ZkNodeProps leaderProps,- SolrCore core, CoreContainer cc) throws InterruptedException,- KeeperException, IOException, ExecutionException {+ SolrCore core, CoreContainer cc) {if (SKIP_AUTO_RECOVERY) {log.warn("Skipping recovery according to sys prop solrcloud.skip.autorecovery");return false;@@ -814,7 +807,7 @@ public final class ZkController {zkClient.printLayoutToStdOut();}- public void createCollectionZkNode(CloudDescriptor cd) throws KeeperException, InterruptedException, IOException {+ public void createCollectionZkNode(CloudDescriptor cd) throws KeeperException, InterruptedException {String collection = cd.getCollectionName();log.info("Check for collection zkNode:" + collection);@@ -943,8 +936,7 @@ public final class ZkController {return zkStateReader;}- private String doGetShardIdProcess(String coreName, CloudDescriptor descriptor)- throws InterruptedException {+ private String doGetShardIdProcess(String coreName, CloudDescriptor descriptor) {final String shardZkNodeName = getNodeName() + "_" + coreName;int retryCount = 120;while (retryCount-- > 0) {@@ -996,11 +988,7 @@ public final class ZkController {String shardZkNodeName = getCoreNodeName(cd);if (cd.getCloudDescriptor().getShardId() == null && needsToBeAssignedShardId(cd, zkStateReader.getCloudState(), shardZkNodeName)) {String shardId;- try {- shardId = doGetShardIdProcess(cd.getName(), cd.getCloudDescriptor());- } catch (InterruptedException e) {- throw new SolrException(ErrorCode.SERVER_ERROR, "Interrupted");- }+ shardId = doGetShardIdProcess(cd.getName(), cd.getCloudDescriptor());cd.getCloudDescriptor().setShardId(shardId);}diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.javaindex a5d25568eab..4ffdd7eb7ee 100644--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java@@ -28,15 +28,31 @@ import org.apache.lucene.store.LockObtainFailedException;import org.apache.solr.common.SolrException;import org.apache.solr.common.params.CommonParams;import org.apache.solr.common.params.CommonParams.EchoParamStyle;-import org.apache.solr.common.params.ShardParams;import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.NamedList;import org.apache.solr.common.util.SimpleOrderedMap;import org.apache.solr.handler.admin.ShowFileRequestHandler;-import org.apache.solr.handler.component.*;+import org.apache.solr.handler.component.DebugComponent;+import org.apache.solr.handler.component.FacetComponent;+import org.apache.solr.handler.component.HighlightComponent;+import org.apache.solr.handler.component.MoreLikeThisComponent;+import org.apache.solr.handler.component.QueryComponent;+import org.apache.solr.handler.component.RealTimeGetComponent;+import org.apache.solr.handler.component.SearchComponent;+import org.apache.solr.handler.component.StatsComponent;import org.apache.solr.request.SolrQueryRequest;import org.apache.solr.request.SolrRequestHandler;-import org.apache.solr.response.*;+import org.apache.solr.response.BinaryResponseWriter;+import org.apache.solr.response.CSVResponseWriter;+import org.apache.solr.response.JSONResponseWriter;+import org.apache.solr.response.PHPResponseWriter;+import org.apache.solr.response.PHPSerializedResponseWriter;+import org.apache.solr.response.PythonResponseWriter;+import org.apache.solr.response.QueryResponseWriter;+import org.apache.solr.response.RawResponseWriter;+import org.apache.solr.response.RubyResponseWriter;+import org.apache.solr.response.SolrQueryResponse;+import org.apache.solr.response.XMLResponseWriter;import org.apache.solr.response.transform.TransformerFactory;import org.apache.solr.schema.IndexSchema;import org.apache.solr.search.QParserPlugin;@@ -46,7 +62,11 @@ import org.apache.solr.search.ValueSourceParser;import org.apache.solr.update.DirectUpdateHandler2;import org.apache.solr.update.SolrIndexWriter;import org.apache.solr.update.UpdateHandler;-import org.apache.solr.update.processor.*;+import org.apache.solr.update.processor.DistributedUpdateProcessorFactory;+import org.apache.solr.update.processor.LogUpdateProcessorFactory;+import org.apache.solr.update.processor.RunUpdateProcessorFactory;+import org.apache.solr.update.processor.UpdateRequestProcessorChain;+import org.apache.solr.update.processor.UpdateRequestProcessorFactory;import org.apache.solr.util.RefCounted;import org.apache.solr.util.plugin.NamedListInitializedPlugin;import org.apache.solr.util.plugin.PluginInfoInitialized;@@ -56,11 +76,35 @@ import org.slf4j.LoggerFactory;import org.xml.sax.SAXException;import javax.xml.parsers.ParserConfigurationException;-import java.io.*;+import java.io.File;+import java.io.FileInputStream;+import java.io.IOException;+import java.io.InputStream;+import java.io.Writer;import java.lang.reflect.Constructor;import java.net.URL;-import java.util.*;-import java.util.concurrent.*;+import java.util.ArrayList;+import java.util.Collection;+import java.util.Collections;+import java.util.Date;+import java.util.HashMap;+import java.util.HashSet;+import java.util.IdentityHashMap;+import java.util.LinkedHashMap;+import java.util.LinkedList;+import java.util.List;+import java.util.Locale;+import java.util.Map;+import java.util.Properties;+import java.util.Set;+import java.util.StringTokenizer;+import java.util.concurrent.Callable;+import java.util.concurrent.ConcurrentHashMap;+import java.util.concurrent.CountDownLatch;+import java.util.concurrent.ExecutorService;+import java.util.concurrent.Executors;+import java.util.concurrent.Future;+import java.util.concurrent.TimeUnit;import java.util.concurrent.atomic.AtomicInteger;import java.util.concurrent.atomic.AtomicLong;import java.util.concurrent.locks.ReentrantLock;@@ -75,7 +119,7 @@ public final class SolrCore implements SolrInfoMBean {// These should *only* be used for debugging or monitoring purposespublic static final AtomicLong numOpens = new AtomicLong();public static final AtomicLong numCloses = new AtomicLong();- public static Map<SolrCore,Exception> openHandles = Collections.synchronizedMap(new IdentityHashMap<SolrCore,Exception>());+ public static Map<SolrCore,Exception> openHandles = Collections.synchronizedMap(new IdentityHashMap<SolrCore, Exception>());public static Logger log = LoggerFactory.getLogger(SolrCore.class);@@ -1003,12 +1047,7 @@ public final class SolrCore implements SolrInfoMBean {* {@link org.apache.solr.request.SolrQueryRequest#getSearcher()} instead.*/public RefCounted<SolrIndexSearcher> getSearcher() {- try {- return getSearcher(false,true,null);- } catch (IOException e) {- SolrException.log(log,null,e);- return null;- }+ return getSearcher(false,true,null);}/**@@ -1072,7 +1111,7 @@ public final class SolrCore implements SolrInfoMBean {}- public RefCounted<SolrIndexSearcher> getSearcher(boolean forceNew, boolean returnSearcher, final Future[] waitSearcher) throws IOException {+ public RefCounted<SolrIndexSearcher> getSearcher(boolean forceNew, boolean returnSearcher, final Future[] waitSearcher) {return getSearcher(forceNew, returnSearcher, waitSearcher, false);}@@ -1217,9 +1256,8 @@ public final class SolrCore implements SolrInfoMBean {* @param returnSearcher if true, returns a {@link SolrIndexSearcher} holder with the refcount already incremented.* @param waitSearcher if non-null, will be filled in with a {@link Future} that will return after the new searcher is registered.* @param updateHandlerReopens if true, the UpdateHandler will be used when reopening a {@link SolrIndexSearcher}.- * @throws IOException*/- public RefCounted<SolrIndexSearcher> getSearcher(boolean forceNew, boolean returnSearcher, final Future[] waitSearcher, boolean updateHandlerReopens) throws IOException {+ public RefCounted<SolrIndexSearcher> getSearcher(boolean forceNew, boolean returnSearcher, final Future[] waitSearcher, boolean updateHandlerReopens) {// it may take some time to open an index.... we may need to make// sure that two threads aren't trying to open one at the same time// if it isn't necessary.@@ -1476,7 +1514,7 @@ public final class SolrCore implements SolrInfoMBean {//// onDeckSearchers will also be decremented (it should have been incremented// as a result of opening a new searcher).- private void registerSearcher(RefCounted<SolrIndexSearcher> newSearcherHolder) throws IOException {+ private void registerSearcher(RefCounted<SolrIndexSearcher> newSearcherHolder) {synchronized (searcherLock) {try {if (_searcher != null) {diff --git a/solr/core/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java b/solr/core/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.javaindex ab5f96033a9..6bfdc24358b 100644--- a/solr/core/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java+++ b/solr/core/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java@@ -326,7 +326,7 @@ public abstract class AnalysisRequestHandlerBase extends RequestHandlerBase {}@Override- public boolean incrementToken() throws IOException {+ public boolean incrementToken() {if (tokenIterator.hasNext()) {clearAttributes();AttributeSource next = tokenIterator.next();diff --git a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.javaindex 226b9e43ac9..74dd04f5425 100644--- a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java@@ -942,7 +942,7 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAwstream.write(out);}- public void write(Writer writer, SolrQueryRequest request, SolrQueryResponse response) throws IOException {+ public void write(Writer writer, SolrQueryRequest request, SolrQueryResponse response) {throw new RuntimeException("This is a binary writer , Cannot write to a characterstream");}diff --git a/solr/core/src/java/org/apache/solr/handler/RequestHandlerUtils.java b/solr/core/src/java/org/apache/solr/handler/RequestHandlerUtils.javaindex 7a963d00370..fb5e8e44c0b 100755--- a/solr/core/src/java/org/apache/solr/handler/RequestHandlerUtils.java+++ b/solr/core/src/java/org/apache/solr/handler/RequestHandlerUtils.java@@ -90,8 +90,7 @@ public class RequestHandlerUtils/*** Modify UpdateCommand based on request parameters*/- public static void updateCommit(CommitUpdateCommand cmd, SolrParams params) throws IOException- {+ public static void updateCommit(CommitUpdateCommand cmd, SolrParams params) {if( params == null ) return;cmd.openSearcher = params.getBool( UpdateParams.OPEN_SEARCHER, cmd.openSearcher );diff --git a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java b/solr/core/src/java/org/apache/solr/handler/SnapPuller.javaindex 445e7a81fba..02bf0f0f0b1 100644--- a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java+++ b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java@@ -663,7 +663,7 @@ public class SnapPuller {/*** Copy all index files from the temp index dir to the actual index. The segments_N file is copied last.*/- private boolean copyIndexFiles(File tmpIdxDir, File indexDir) throws IOException {+ private boolean copyIndexFiles(File tmpIdxDir, File indexDir) {String segmentsFile = null;List<String> copiedfiles = new ArrayList<String>();for (Map<String, Object> f : filesDownloaded) {@@ -690,7 +690,7 @@ public class SnapPuller {/*** The conf files are copied to the tmp dir to the conf dir. A backup of the old file is maintained*/- private void copyTmpConfFiles2Conf(File tmpconfDir) throws IOException {+ private void copyTmpConfFiles2Conf(File tmpconfDir) {File confDir = new File(solrCore.getResourceLoader().getConfigDir());for (File file : tmpconfDir.listFiles()) {File oldFile = new File(confDir, file.getName());diff --git a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java b/solr/core/src/java/org/apache/solr/handler/SnapShooter.javaindex 35d20790aa7..45fdfd7dfae 100644--- a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java+++ b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java@@ -53,7 +53,7 @@ public class SnapShooter {private SolrCore solrCore;private SimpleFSLockFactory lockFactory;- public SnapShooter(SolrCore core, String location) throws IOException {+ public SnapShooter(SolrCore core, String location) {solrCore = core;if (location == null) snapDir = core.getDataDir();else {diff --git a/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.javaindex 3fc7c80e284..b919fe4a9c6 100644--- a/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java@@ -195,8 +195,7 @@ public class ShowFileRequestHandler extends RequestHandlerBasersp.setHttpCaching(false);}- private void showFromFileSystem(SolrQueryRequest req, SolrQueryResponse rsp)- throws IOException {+ private void showFromFileSystem(SolrQueryRequest req, SolrQueryResponse rsp) {File adminFile = null;final SolrResourceLoader loader = req.getCore().getResourceLoader();diff --git a/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.javaindex c3cd99b3770..7b500546749 100644--- a/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java@@ -81,8 +81,7 @@ public class SystemInfoHandler extends RequestHandlerBase/*** Get system info*/- private SimpleOrderedMap<Object> getCoreInfo( SolrCore core ) throws Exception- {+ private SimpleOrderedMap<Object> getCoreInfo( SolrCore core ) {SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();IndexSchema schema = core.getSchema();@@ -110,8 +109,7 @@ public class SystemInfoHandler extends RequestHandlerBase/*** Get system info*/- public static SimpleOrderedMap<Object> getSystemInfo() throws Exception- {+ public static SimpleOrderedMap<Object> getSystemInfo() {SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();@@ -255,8 +253,7 @@ public class SystemInfoHandler extends RequestHandlerBasereturn jvm;}- private static SimpleOrderedMap<Object> getLuceneInfo() throws Exception- {+ private static SimpleOrderedMap<Object> getLuceneInfo() {SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();Package p = SolrCore.class.getPackage();diff --git a/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.javaindex f50877ecc05..b9df00c81de 100644--- a/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java@@ -79,8 +79,7 @@ public class ThreadDumpHandler extends RequestHandlerBase//--------------------------------------------------------------------------------//--------------------------------------------------------------------------------- private static SimpleOrderedMap<Object> getThreadInfo( ThreadInfo ti, ThreadMXBean tmbean ) throws IOException- {+ private static SimpleOrderedMap<Object> getThreadInfo( ThreadInfo ti, ThreadMXBean tmbean ) {SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();long tid = ti.getThreadId();diff --git a/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java b/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.javaindex 2e5bfb5e105..5d233f64b15 100644--- a/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java+++ b/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java@@ -480,7 +480,7 @@ public class QueryElevationComponent extends SearchComponent implements SolrCoreprivate SentinelIntSet ordSet; //the key half of the mapprivate BytesRef[] termValues;//the value half of the map- public ElevationComparatorSource(final QueryElevationComponent.ElevationObj elevations) throws IOException {+ public ElevationComparatorSource(final QueryElevationComponent.ElevationObj elevations) {this.elevations = elevations;int size = elevations.ids.size();ordSet = new SentinelIntSet(size, -1);@@ -506,7 +506,7 @@ public class QueryElevationComponent extends SearchComponent implements SolrCorebottomVal = values[slot];}- private int docVal(int doc) throws IOException {+ private int docVal(int doc) {if (ordSet.size() > 0) {int slot = ordSet.find(doc);if (slot >= 0) {@@ -519,12 +519,12 @@ public class QueryElevationComponent extends SearchComponent implements SolrCore}@Override- public int compareBottom(int doc) throws IOException {+ public int compareBottom(int doc) {return bottomVal - docVal(doc);}@Override- public void copy(int slot, int doc) throws IOException {+ public void copy(int slot, int doc) {values[slot] = docVal(doc);}@@ -562,7 +562,7 @@ public class QueryElevationComponent extends SearchComponent implements SolrCore}@Override- public int compareDocToValue(int doc, Integer valueObj) throws IOException {+ public int compareDocToValue(int doc, Integer valueObj) {final int value = valueObj.intValue();final int docValue = docVal(doc);return docValue - value; // values will be small enough that there is no overflow concerndiff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.javaindex bc82d71f861..c9ba1880ab3 100644--- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java@@ -17,7 +17,6 @@package org.apache.solr.handler.component;-import org.apache.lucene.queryparser.classic.ParseException;import org.apache.solr.common.SolrException;import org.apache.solr.common.params.CommonParams;import org.apache.solr.common.params.ModifiableSolrParams;@@ -35,7 +34,10 @@ import org.apache.solr.util.plugin.SolrCoreAware;import org.slf4j.Logger;import org.slf4j.LoggerFactory;-import java.util.*;+import java.util.ArrayList;+import java.util.LinkedList;+import java.util.List;+/***@@ -156,7 +158,7 @@ public class SearchHandler extends RequestHandlerBase implements SolrCoreAware ,@Override- public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception, ParseException, InstantiationException, IllegalAccessException+ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception{// int sleep = req.getParams().getInt("sleep",0);// if (sleep > 0) {log.error("SLEEPING for " + sleep); Thread.sleep(sleep);}diff --git a/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java b/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.javaindex 2afab13aa72..77def6ecba4 100644--- a/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java+++ b/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java@@ -252,22 +252,22 @@ public class TermVectorComponent extends SearchComponent implements SolrCoreAwar// once we find it...final StoredFieldVisitor getUniqValue = new StoredFieldVisitor() {@Override- public void stringField(FieldInfo fieldInfo, String value) throws IOException {+ public void stringField(FieldInfo fieldInfo, String value) {uniqValues.add(value);}@Override- public void intField(FieldInfo fieldInfo, int value) throws IOException {+ public void intField(FieldInfo fieldInfo, int value) {uniqValues.add(Integer.toString(value));}@Override- public void longField(FieldInfo fieldInfo, long value) throws IOException {+ public void longField(FieldInfo fieldInfo, long value) {uniqValues.add(Long.toString(value));}@Override- public Status needsField(FieldInfo fieldInfo) throws IOException {+ public Status needsField(FieldInfo fieldInfo) {return (fieldInfo.name.equals(finalUniqFieldName)) ? Status.YES : Status.NO;}};diff --git a/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java b/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.javaindex 52cbe71960f..0fe01655e49 100644--- a/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java+++ b/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java@@ -48,7 +48,6 @@ import javax.xml.stream.FactoryConfigurationError;import javax.xml.stream.XMLStreamConstants;import javax.xml.stream.XMLInputFactory;import javax.xml.transform.Transformer;-import javax.xml.transform.TransformerConfigurationException;import javax.xml.transform.TransformerException;import javax.xml.transform.dom.DOMResult;import javax.xml.transform.dom.DOMSource;@@ -190,9 +189,7 @@ public class XMLLoader extends ContentStreamLoader {* @since solr 1.2*/void processUpdate(SolrQueryRequest req, UpdateRequestProcessor processor, XMLStreamReader parser)- throws XMLStreamException, IOException, FactoryConfigurationError,- InstantiationException, IllegalAccessException,- TransformerConfigurationException {+ throws XMLStreamException, IOException, FactoryConfigurationError {AddUpdateCommand addCmd = null;SolrParams params = req.getParams();while (true) {diff --git a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.javaindex 306a68f2880..7527f7ba896 100644--- a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java+++ b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java@@ -202,9 +202,8 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf* @param tokenStream document text CachingTokenStream* @param fieldName The name of the field* @param request The SolrQueryRequest- * @throws IOException*/- private QueryScorer getSpanQueryScorer(Query query, String fieldName, TokenStream tokenStream, SolrQueryRequest request) throws IOException {+ private QueryScorer getSpanQueryScorer(Query query, String fieldName, TokenStream tokenStream, SolrQueryRequest request) {boolean reqFieldMatch = request.getParams().getFieldBool(fieldName, HighlightParams.FIELD_MATCH, false);Boolean highlightMultiTerm = request.getParams().getBool(HighlightParams.HIGHLIGHT_MULTI_TERM, true);if(highlightMultiTerm == null) {diff --git a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java b/solr/core/src/java/org/apache/solr/schema/IndexSchema.javaindex 1628fdd8486..75edf3ce109 100644--- a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java+++ b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java@@ -20,14 +20,12 @@ package org.apache.solr.schema;import org.apache.lucene.analysis.Analyzer;import org.apache.lucene.analysis.AnalyzerWrapper;import org.apache.lucene.index.IndexableField;-import org.apache.lucene.search.similarities.DefaultSimilarity;import org.apache.lucene.search.similarities.Similarity;import org.apache.lucene.util.Version;import org.apache.lucene.analysis.util.ResourceLoader;import org.apache.solr.common.SolrException;import org.apache.solr.common.params.SolrParams;import org.apache.solr.util.DOMUtil;-import org.apache.solr.common.util.NamedList;import org.apache.solr.util.SystemIdResolver;import org.apache.solr.core.SolrConfig;import org.apache.solr.core.Config;@@ -39,11 +37,18 @@ import org.xml.sax.InputSource;import javax.xml.xpath.XPath;import javax.xml.xpath.XPathConstants;-import javax.xml.xpath.XPathExpressionException;-import java.util.*;import org.slf4j.Logger;import org.slf4j.LoggerFactory;+import java.util.ArrayList;+import java.util.Arrays;+import java.util.Collection;+import java.util.Collections;+import java.util.HashMap;+import java.util.HashSet;+import java.util.List;+import java.util.Map;+/*** <code>IndexSchema</code> contains information about the valid fields in an index* and the types of those fields.@@ -688,7 +693,7 @@ public final class IndexSchema {return newArr;}- static SimilarityFactory readSimilarity(ResourceLoader loader, Node node) throws XPathExpressionException {+ static SimilarityFactory readSimilarity(ResourceLoader loader, Node node) {if (node==null) {return null;} else {diff --git a/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java b/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.javaindex 78961bed8f2..be93b639b64 100644--- a/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java+++ b/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java@@ -214,7 +214,7 @@ public class PreAnalyzedField extends FieldType {return binaryValue;}- public final boolean incrementToken() throws IOException {+ public final boolean incrementToken() {// lazy init the iteratorif (it == null) {it = cachedStates.iterator();diff --git a/solr/core/src/java/org/apache/solr/schema/RandomSortField.java b/solr/core/src/java/org/apache/solr/schema/RandomSortField.javaindex 8234729d229..e7666094c6f 100644--- a/solr/core/src/java/org/apache/solr/schema/RandomSortField.java+++ b/solr/core/src/java/org/apache/solr/schema/RandomSortField.java@@ -102,7 +102,7 @@ public class RandomSortField extends FieldType {private static FieldComparatorSource randomComparatorSource = new FieldComparatorSource() {@Override- public FieldComparator<Integer> newComparator(final String fieldname, final int numHits, int sortPos, boolean reversed) throws IOException {+ public FieldComparator<Integer> newComparator(final String fieldname, final int numHits, int sortPos, boolean reversed) {return new FieldComparator<Integer>() {int seed;private final int[] values = new int[numHits];@@ -119,17 +119,17 @@ public class RandomSortField extends FieldType {}@Override- public int compareBottom(int doc) throws IOException {+ public int compareBottom(int doc) {return bottomVal - hash(doc+seed);}@Override- public void copy(int slot, int doc) throws IOException {+ public void copy(int slot, int doc) {values[slot] = hash(doc+seed);}@Override- public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {+ public FieldComparator setNextReader(AtomicReaderContext context) {seed = getSeed(fieldname, context);return this;}diff --git a/solr/core/src/java/org/apache/solr/schema/TextField.java b/solr/core/src/java/org/apache/solr/schema/TextField.javaindex 764ec2b5c9a..b294988dff2 100644--- a/solr/core/src/java/org/apache/solr/schema/TextField.java+++ b/solr/core/src/java/org/apache/solr/schema/TextField.java@@ -186,11 +186,7 @@ public class TextField extends FieldType {PositionIncrementAttribute posIncrAtt = null;int numTokens = 0;- try {- buffer.reset();- } catch (IOException e) {- throw new RuntimeException("Unable to initialize TokenStream to analyze query text", e);- }+ buffer.reset();if (buffer.hasAttribute(CharTermAttribute.class)) {termAtt = buffer.getAttribute(CharTermAttribute.class);diff --git a/solr/core/src/java/org/apache/solr/search/BitDocSet.java b/solr/core/src/java/org/apache/solr/search/BitDocSet.javaindex dc567a6f524..2a8aecf282d 100644--- a/solr/core/src/java/org/apache/solr/search/BitDocSet.java+++ b/solr/core/src/java/org/apache/solr/search/BitDocSet.java@@ -18,7 +18,6 @@package org.apache.solr.search;import org.apache.lucene.index.AtomicReader;-import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.AtomicReaderContext;import org.apache.lucene.search.BitsFilteredDocIdSet;import org.apache.lucene.search.DocIdSet;@@ -28,8 +27,6 @@ import org.apache.lucene.util.OpenBitSet;import org.apache.lucene.util.OpenBitSetIterator;import org.apache.lucene.search.DocIdSetIterator;-import java.io.IOException;-/*** <code>BitDocSet</code> represents an unordered set of Lucene Document Ids* using a BitSet. A set bit represents inclusion in the set for that document.@@ -249,7 +246,7 @@ public class BitDocSet extends DocSetBase {return new Filter() {@Override- public DocIdSet getDocIdSet(final AtomicReaderContext context, final Bits acceptDocs) throws IOException {+ public DocIdSet getDocIdSet(final AtomicReaderContext context, final Bits acceptDocs) {AtomicReader reader = context.reader();// all Solr DocSets that are used as filters only include live docsfinal Bits acceptDocs2 = acceptDocs == null ? null : (reader.getLiveDocs() == acceptDocs ? null : acceptDocs);@@ -264,7 +261,7 @@ public class BitDocSet extends DocSetBase {return BitsFilteredDocIdSet.wrap(new DocIdSet() {@Override- public DocIdSetIterator iterator() throws IOException {+ public DocIdSetIterator iterator() {return new DocIdSetIterator() {int pos=base-1;int adjustedDoc=-1;@@ -275,13 +272,13 @@ public class BitDocSet extends DocSetBase {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {pos = bs.nextSetBit(pos+1);return adjustedDoc = (pos>=0 && pos<max) ? pos-base : NO_MORE_DOCS;}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {if (target==NO_MORE_DOCS) return adjustedDoc=NO_MORE_DOCS;pos = bs.nextSetBit(target+base);return adjustedDoc = (pos>=0 && pos<max) ? pos-base : NO_MORE_DOCS;@@ -295,7 +292,7 @@ public class BitDocSet extends DocSetBase {}@Override- public Bits bits() throws IOException {+ public Bits bits() {return new Bits() {@Overridepublic boolean get(int index) {diff --git a/solr/core/src/java/org/apache/solr/search/DocSetBase.java b/solr/core/src/java/org/apache/solr/search/DocSetBase.javaindex 93b6fcdda08..c5b75188ee5 100644--- a/solr/core/src/java/org/apache/solr/search/DocSetBase.java+++ b/solr/core/src/java/org/apache/solr/search/DocSetBase.java@@ -27,8 +27,6 @@ import org.apache.lucene.search.DocIdSetIterator;import org.apache.lucene.search.BitsFilteredDocIdSet;import org.apache.lucene.index.AtomicReaderContext;-import java.io.IOException;-/** A base class that may be usefull for implementing DocSets */abstract class DocSetBase implements DocSet {@@ -140,7 +138,7 @@ abstract class DocSetBase implements DocSet {return new Filter() {@Override- public DocIdSet getDocIdSet(final AtomicReaderContext context, Bits acceptDocs) throws IOException {+ public DocIdSet getDocIdSet(final AtomicReaderContext context, Bits acceptDocs) {AtomicReader reader = context.reader();// all Solr DocSets that are used as filters only include live docsfinal Bits acceptDocs2 = acceptDocs == null ? null : (reader.getLiveDocs() == acceptDocs ? null : acceptDocs);@@ -155,7 +153,7 @@ abstract class DocSetBase implements DocSet {return BitsFilteredDocIdSet.wrap(new DocIdSet() {@Override- public DocIdSetIterator iterator() throws IOException {+ public DocIdSetIterator iterator() {return new DocIdSetIterator() {int pos=base-1;int adjustedDoc=-1;@@ -166,13 +164,13 @@ abstract class DocSetBase implements DocSet {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {pos = bs.nextSetBit(pos+1);return adjustedDoc = (pos>=0 && pos<max) ? pos-base : NO_MORE_DOCS;}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {if (target==NO_MORE_DOCS) return adjustedDoc=NO_MORE_DOCS;pos = bs.nextSetBit(target+base);return adjustedDoc = (pos>=0 && pos<max) ? pos-base : NO_MORE_DOCS;@@ -186,7 +184,7 @@ abstract class DocSetBase implements DocSet {}@Override- public Bits bits() throws IOException {+ public Bits bits() {// sparse filters should not use random accessreturn null;}diff --git a/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.javaindex 4a1eef34d32..e910e83c8f1 100755--- a/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java+++ b/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java@@ -420,9 +420,8 @@ class ExtendedDismaxQParser extends QParser {* Extracts all the alised fields from the requests and adds them to up* @param up* @param tiebreaker- * @throws ParseException*/- private void addAliasesFromRequest(ExtendedSolrQueryParser up, float tiebreaker) throws ParseException {+ private void addAliasesFromRequest(ExtendedSolrQueryParser up, float tiebreaker) {Iterator<String> it = solrParams.getParameterNamesIterator();while(it.hasNext()) {String param = it.next();@@ -1155,7 +1154,7 @@ class ExtendedDismaxQParser extends QParser {return lst;}- private Query getQuery() throws ParseException {+ private Query getQuery() {try {switch (type) {diff --git a/solr/core/src/java/org/apache/solr/search/FastLRUCache.java b/solr/core/src/java/org/apache/solr/search/FastLRUCache.javaindex 8a2a07fcdae..c4732f6d1a5 100644--- a/solr/core/src/java/org/apache/solr/search/FastLRUCache.java+++ b/solr/core/src/java/org/apache/solr/search/FastLRUCache.java@@ -20,9 +20,7 @@ import org.apache.solr.common.SolrException;import org.apache.solr.util.ConcurrentLRUCache;import org.apache.solr.common.util.NamedList;import org.apache.solr.common.util.SimpleOrderedMap;-import org.apache.solr.core.SolrCore;-import java.io.IOException;import java.io.Serializable;import java.util.List;import java.util.Map;@@ -136,7 +134,7 @@ public class FastLRUCache<K,V> extends SolrCacheBase implements SolrCache<K,V> {cache.setAlive(state == State.LIVE);}- public void warm(SolrIndexSearcher searcher, SolrCache old) throws IOException {+ public void warm(SolrIndexSearcher searcher, SolrCache old) {if (regenerator == null) return;long warmingStartTime = System.currentTimeMillis();FastLRUCache other = (FastLRUCache) old;diff --git a/solr/core/src/java/org/apache/solr/search/FieldQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/FieldQParserPlugin.javaindex 1eb488cc794..02716800467 100644--- a/solr/core/src/java/org/apache/solr/search/FieldQParserPlugin.java+++ b/solr/core/src/java/org/apache/solr/search/FieldQParserPlugin.java@@ -16,8 +16,7 @@*/package org.apache.solr.search;-import org.apache.lucene.queryparser.classic.ParseException;-import org.apache.lucene.search.*;+import org.apache.lucene.search.Query;import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.NamedList;import org.apache.solr.request.SolrQueryRequest;@@ -42,7 +41,7 @@ public class FieldQParserPlugin extends QParserPlugin {public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {return new QParser(qstr, localParams, params, req) {@Override- public Query parse() throws ParseException {+ public Query parse() {String field = localParams.get(QueryParsing.F);String queryText = localParams.get(QueryParsing.V);SchemaField sf = req.getSchema().getField(field);diff --git a/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.javaindex 3837662fa59..110bf026879 100644--- a/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java+++ b/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java@@ -135,7 +135,7 @@ class JoinQuery extends Query {private float queryWeight;ResponseBuilder rb;- public JoinQueryWeight(SolrIndexSearcher searcher) throws IOException {+ public JoinQueryWeight(SolrIndexSearcher searcher) {this.fromSearcher = searcher;SolrRequestInfo info = SolrRequestInfo.getRequestInfo();if (info != null) {@@ -175,7 +175,7 @@ class JoinQuery extends Query {final RefCounted<SolrIndexSearcher> ref = fromRef;info.addCloseHook(new Closeable() {@Override- public void close() throws IOException {+ public void close() {ref.decref();}});@@ -183,7 +183,7 @@ class JoinQuery extends Query {info.addCloseHook(new Closeable() {@Override- public void close() throws IOException {+ public void close() {fromCore.close();}});diff --git a/solr/core/src/java/org/apache/solr/search/LFUCache.java b/solr/core/src/java/org/apache/solr/search/LFUCache.javaindex e7f26a567f4..521115b2387 100644--- a/solr/core/src/java/org/apache/solr/search/LFUCache.java+++ b/solr/core/src/java/org/apache/solr/search/LFUCache.java@@ -22,7 +22,6 @@ import org.apache.solr.common.util.SimpleOrderedMap;import org.apache.solr.core.SolrCore;import org.apache.solr.util.ConcurrentLFUCache;-import java.io.IOException;import java.io.Serializable;import java.net.URL;import java.util.List;@@ -155,7 +154,7 @@ public class LFUCache<K, V> implements SolrCache<K, V> {return state;}- public void warm(SolrIndexSearcher searcher, SolrCache old) throws IOException {+ public void warm(SolrIndexSearcher searcher, SolrCache old) {if (regenerator == null) return;long warmingStartTime = System.currentTimeMillis();LFUCache other = (LFUCache) old;diff --git a/solr/core/src/java/org/apache/solr/search/LRUCache.java b/solr/core/src/java/org/apache/solr/search/LRUCache.javaindex 0710d51aced..8c631c070ac 100644--- a/solr/core/src/java/org/apache/solr/search/LRUCache.java+++ b/solr/core/src/java/org/apache/solr/search/LRUCache.java@@ -17,7 +17,6 @@package org.apache.solr.search;-import java.io.IOException;import java.util.Iterator;import java.util.LinkedHashMap;import java.util.Map;@@ -144,7 +143,7 @@ public class LRUCache<K,V> extends SolrCacheBase implements SolrCache<K,V> {}}- public void warm(SolrIndexSearcher searcher, SolrCache<K,V> old) throws IOException {+ public void warm(SolrIndexSearcher searcher, SolrCache<K,V> old) {if (regenerator==null) return;long warmingStartTime = System.currentTimeMillis();LRUCache<K,V> other = (LRUCache<K,V>)old;diff --git a/solr/core/src/java/org/apache/solr/search/PrefixQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/PrefixQParserPlugin.javaindex 824fec6cd79..7745b4e6757 100755--- a/solr/core/src/java/org/apache/solr/search/PrefixQParserPlugin.java+++ b/solr/core/src/java/org/apache/solr/search/PrefixQParserPlugin.java@@ -17,7 +17,6 @@package org.apache.solr.search;import org.apache.lucene.index.Term;-import org.apache.lucene.queryparser.classic.ParseException;import org.apache.lucene.search.PrefixQuery;import org.apache.lucene.search.Query;import org.apache.solr.common.params.SolrParams;@@ -40,7 +39,7 @@ public class PrefixQParserPlugin extends QParserPlugin {public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {return new QParser(qstr, localParams, params, req) {@Override- public Query parse() throws ParseException {+ public Query parse() {return new PrefixQuery(new Term(localParams.get(QueryParsing.F), localParams.get(QueryParsing.V)));}};diff --git a/solr/core/src/java/org/apache/solr/search/QueryParsing.java b/solr/core/src/java/org/apache/solr/search/QueryParsing.javaindex edfbae93404..2d149caff67 100644--- a/solr/core/src/java/org/apache/solr/search/QueryParsing.java+++ b/solr/core/src/java/org/apache/solr/search/QueryParsing.java@@ -637,7 +637,7 @@ public class QueryParsing {}}- float getFloat() throws ParseException {+ float getFloat() {eatws();char[] arr = new char[end - pos];int i;@@ -657,7 +657,7 @@ public class QueryParsing {return Float.parseFloat(new String(arr, 0, i));}- Number getNumber() throws ParseException {+ Number getNumber() {eatws();int start = pos;boolean flt = false;@@ -682,7 +682,7 @@ public class QueryParsing {}}- double getDouble() throws ParseException {+ double getDouble() {eatws();char[] arr = new char[end - pos];int i;@@ -702,7 +702,7 @@ public class QueryParsing {return Double.parseDouble(new String(arr, 0, i));}- int getInt() throws ParseException {+ int getInt() {eatws();char[] arr = new char[end - pos];int i;diff --git a/solr/core/src/java/org/apache/solr/search/QueryResultKey.java b/solr/core/src/java/org/apache/solr/search/QueryResultKey.javaindex ec4966d071c..003aae4c913 100644--- a/solr/core/src/java/org/apache/solr/search/QueryResultKey.java+++ b/solr/core/src/java/org/apache/solr/search/QueryResultKey.java@@ -20,7 +20,6 @@ package org.apache.solr.search;import org.apache.lucene.search.Query;import org.apache.lucene.search.Sort;import org.apache.lucene.search.SortField;-import java.io.IOException;import java.util.List;/** A hash key encapsulating a query, a list of filters, and a sort@@ -38,7 +37,7 @@ public final class QueryResultKey {private static SortField[] defaultSort = new SortField[0];- public QueryResultKey(Query query, List<Query> filters, Sort sort, int nc_flags) throws IOException {+ public QueryResultKey(Query query, List<Query> filters, Sort sort, int nc_flags) {this.query = query;this.sort = sort;this.filters = filters;diff --git a/solr/core/src/java/org/apache/solr/search/RawQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/RawQParserPlugin.javaindex a5977cf0d7d..f4289a7f98c 100644--- a/solr/core/src/java/org/apache/solr/search/RawQParserPlugin.java+++ b/solr/core/src/java/org/apache/solr/search/RawQParserPlugin.java@@ -17,7 +17,6 @@package org.apache.solr.search;import org.apache.lucene.index.Term;-import org.apache.lucene.queryparser.classic.ParseException;import org.apache.lucene.search.Query;import org.apache.lucene.search.TermQuery;import org.apache.solr.common.params.SolrParams;@@ -44,7 +43,7 @@ public class RawQParserPlugin extends QParserPlugin {public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {return new QParser(qstr, localParams, params, req) {@Override- public Query parse() throws ParseException {+ public Query parse() {return new TermQuery(new Term(localParams.get(QueryParsing.F), localParams.get(QueryParsing.V)));}};diff --git a/solr/core/src/java/org/apache/solr/search/ReturnFields.java b/solr/core/src/java/org/apache/solr/search/ReturnFields.javaindex fb7034e73b1..dcc442043ed 100644--- a/solr/core/src/java/org/apache/solr/search/ReturnFields.java+++ b/solr/core/src/java/org/apache/solr/search/ReturnFields.java@@ -155,7 +155,7 @@ public class ReturnFields// like getId, but also accepts dashes for legacy fields- String getFieldName(QueryParsing.StrParser sp) throws ParseException {+ String getFieldName(QueryParsing.StrParser sp) {sp.eatws();int id_start = sp.pos;char ch;diff --git a/solr/core/src/java/org/apache/solr/search/SolrCache.java b/solr/core/src/java/org/apache/solr/search/SolrCache.javaindex 3abb849d3f0..caf636d0d60 100644--- a/solr/core/src/java/org/apache/solr/search/SolrCache.java+++ b/solr/core/src/java/org/apache/solr/search/SolrCache.java@@ -22,7 +22,6 @@ import org.apache.solr.core.SolrInfoMBean;import java.util.Map;import org.slf4j.Logger;import org.slf4j.LoggerFactory;-import java.io.IOException;/**@@ -125,7 +124,7 @@ public interface SolrCache<K,V> extends SolrInfoMBean {* Warm this cache associated with <code>searcher</code> using the <code>old</code>* cache object. <code>this</code> and <code>old</code> will have the same concrete type.*/- void warm(SolrIndexSearcher searcher, SolrCache<K,V> old) throws IOException;+ void warm(SolrIndexSearcher searcher, SolrCache<K,V> old);// Q: an alternative to passing the searcher here would be to pass it in// init and have the cache implementation save it.diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.javaindex 035b97197bd..109eb26a252 100644--- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java+++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java@@ -1300,14 +1300,14 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrInif (!needScores) {collector = new Collector () {@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {}@Override- public void collect(int doc) throws IOException {+ public void collect(int doc) {numHits[0]++;}@Override- public void setNextReader(AtomicReaderContext context) throws IOException {+ public void setNextReader(AtomicReaderContext context) {}@Overridepublic boolean acceptsDocsOutOfOrder() {@@ -1318,7 +1318,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIncollector = new Collector() {Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Override@@ -1328,7 +1328,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrInif (score > topscore[0]) topscore[0]=score;}@Override- public void setNextReader(AtomicReaderContext context) throws IOException {+ public void setNextReader(AtomicReaderContext context) {}@Overridepublic boolean acceptsDocsOutOfOrder() {@@ -1441,7 +1441,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIncollector = setCollector = new DocSetDelegateCollector(smallSetSize, maxDoc, new Collector() {Scorer scorer;@Override- public void setScorer(Scorer scorer) throws IOException {+ public void setScorer(Scorer scorer) {this.scorer = scorer;}@Override@@ -1450,7 +1450,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrInif (score > topscore[0]) topscore[0]=score;}@Override- public void setNextReader(AtomicReaderContext context) throws IOException {+ public void setNextReader(AtomicReaderContext context) {}@Overridepublic boolean acceptsDocsOutOfOrder() {diff --git a/solr/core/src/java/org/apache/solr/search/SortedIntDocSet.java b/solr/core/src/java/org/apache/solr/search/SortedIntDocSet.javaindex 94facd8655d..754fd14e422 100755--- a/solr/core/src/java/org/apache/solr/search/SortedIntDocSet.java+++ b/solr/core/src/java/org/apache/solr/search/SortedIntDocSet.java@@ -24,11 +24,8 @@ import org.apache.lucene.search.BitsFilteredDocIdSet;import org.apache.lucene.search.DocIdSet;import org.apache.lucene.search.DocIdSetIterator;import org.apache.lucene.search.Filter;-import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.AtomicReaderContext;-import java.io.IOException;-/*** <code>SortedIntDocSet</code> represents a sorted set of Lucene Document Ids.*/@@ -658,7 +655,7 @@ public class SortedIntDocSet extends DocSetBase {int lastEndIdx = 0;@Override- public DocIdSet getDocIdSet(final AtomicReaderContext context, final Bits acceptDocs) throws IOException {+ public DocIdSet getDocIdSet(final AtomicReaderContext context, final Bits acceptDocs) {AtomicReader reader = context.reader();// all Solr DocSets that are used as filters only include live docsfinal Bits acceptDocs2 = acceptDocs == null ? null : (reader.getLiveDocs() == acceptDocs ? null : acceptDocs);@@ -695,7 +692,7 @@ public class SortedIntDocSet extends DocSetBase {return BitsFilteredDocIdSet.wrap(new DocIdSet() {@Override- public DocIdSetIterator iterator() throws IOException {+ public DocIdSetIterator iterator() {return new DocIdSetIterator() {int idx = startIdx;int adjustedDoc = -1;@@ -706,12 +703,12 @@ public class SortedIntDocSet extends DocSetBase {}@Override- public int nextDoc() throws IOException {+ public int nextDoc() {return adjustedDoc = (idx > endIdx) ? NO_MORE_DOCS : (docs[idx++] - base);}@Override- public int advance(int target) throws IOException {+ public int advance(int target) {if (idx > endIdx || target==NO_MORE_DOCS) return adjustedDoc=NO_MORE_DOCS;target += base;@@ -757,7 +754,7 @@ public class SortedIntDocSet extends DocSetBase {}@Override- public Bits bits() throws IOException {+ public Bits bits() {// random access is expensive for this setreturn null;}diff --git a/solr/core/src/java/org/apache/solr/search/TermQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/TermQParserPlugin.javaindex 54d37a9d404..381e2e26ca7 100644--- a/solr/core/src/java/org/apache/solr/search/TermQParserPlugin.java+++ b/solr/core/src/java/org/apache/solr/search/TermQParserPlugin.java@@ -17,7 +17,6 @@package org.apache.solr.search;import org.apache.lucene.index.Term;-import org.apache.lucene.queryparser.classic.ParseException;import org.apache.lucene.search.Query;import org.apache.lucene.search.TermQuery;import org.apache.lucene.util.BytesRef;@@ -51,7 +50,7 @@ public class TermQParserPlugin extends QParserPlugin {public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {return new QParser(qstr, localParams, params, req) {@Override- public Query parse() throws ParseException {+ public Query parse() {String fname = localParams.get(QueryParsing.F);FieldType ft = req.getSchema().getFieldTypeNoEx(fname);String val = localParams.get(QueryParsing.V);diff --git a/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java b/solr/core/src/java/org/apache/solr/search/ValueSourceParser.javaindex 75ade0dcd3f..74ee84742d4 100755--- a/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java+++ b/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java@@ -529,13 +529,13 @@ public abstract class ValueSourceParser implements NamedListInitializedPlugin {addParser("pi", new ValueSourceParser() {@Override- public ValueSource parse(FunctionQParser fp) throws ParseException {+ public ValueSource parse(FunctionQParser fp) {return new DoubleConstValueSource(Math.PI);}});addParser("e", new ValueSourceParser() {@Override- public ValueSource parse(FunctionQParser fp) throws ParseException {+ public ValueSource parse(FunctionQParser fp) {return new DoubleConstValueSource(Math.E);}});@@ -601,28 +601,28 @@ public abstract class ValueSourceParser implements NamedListInitializedPlugin {addParser("maxdoc", new ValueSourceParser() {@Override- public ValueSource parse(FunctionQParser fp) throws ParseException {+ public ValueSource parse(FunctionQParser fp) {return new MaxDocValueSource();}});addParser("numdocs", new ValueSourceParser() {@Override- public ValueSource parse(FunctionQParser fp) throws ParseException {+ public ValueSource parse(FunctionQParser fp) {return new NumDocsValueSource();}});addParser("true", new ValueSourceParser() {@Override- public ValueSource parse(FunctionQParser fp) throws ParseException {+ public ValueSource parse(FunctionQParser fp) {return new BoolConstValueSource(true);}});addParser("false", new ValueSourceParser() {@Override- public ValueSource parse(FunctionQParser fp) throws ParseException {+ public ValueSource parse(FunctionQParser fp) {return new BoolConstValueSource(false);}});diff --git a/solr/core/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java b/solr/core/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.javaindex e711823bd64..e33d260dd2d 100755--- a/solr/core/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java+++ b/solr/core/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java@@ -81,7 +81,7 @@ public class ValueSourceRangeFilter extends SolrFilter {return valueSource.getValues(context, readerContext).getRangeScorer(readerContext.reader(), lowerVal, upperVal, includeLower, includeUpper);}@Override- public Bits bits() throws IOException {+ public Bits bits() {return null; // don't use random access}}, acceptDocs);diff --git a/solr/core/src/java/org/apache/solr/search/grouping/collector/FilterCollector.java b/solr/core/src/java/org/apache/solr/search/grouping/collector/FilterCollector.javaindex 6114b81f69c..a200fe67420 100644--- a/solr/core/src/java/org/apache/solr/search/grouping/collector/FilterCollector.java+++ b/solr/core/src/java/org/apache/solr/search/grouping/collector/FilterCollector.java@@ -36,7 +36,7 @@ public class FilterCollector extends Collector {private int docBase;private int matches;- public FilterCollector(DocSet filter, Collector delegate) throws IOException {+ public FilterCollector(DocSet filter, Collector delegate) {this.filter = filter;this.delegate = delegate;}diff --git a/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java b/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.javaindex 09bffec4333..d1e1da2bf61 100644--- a/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java+++ b/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java@@ -74,7 +74,7 @@ public class SearchGroupsResultTransformer implements ShardResultTransformer<Lis/*** {@inheritDoc}*/- public Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> transformToNative(NamedList<NamedList> shardResponse, Sort groupSort, Sort sortWithinGroup, String shard) throws IOException {+ public Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> transformToNative(NamedList<NamedList> shardResponse, Sort groupSort, Sort sortWithinGroup, String shard) {Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> result = new HashMap<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>>();for (Map.Entry<String, NamedList> command : shardResponse) {List<SearchGroup<BytesRef>> searchGroups = new ArrayList<SearchGroup<BytesRef>>();diff --git a/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/ShardResultTransformer.java b/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/ShardResultTransformer.javaindex eb4d5c4c9b5..79998b3df62 100644--- a/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/ShardResultTransformer.java+++ b/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/ShardResultTransformer.java@@ -48,8 +48,7 @@ public interface ShardResultTransformer<T, R> {* @param sortWithinGroup The sort inside a group* @param shard The shard address where the response originated from* @return native structure of the data- * @throws IOException If I/O related errors occur during transforming*/- R transformToNative(NamedList<NamedList> shardResponse, Sort groupSort, Sort sortWithinGroup, String shard) throws IOException;+ R transformToNative(NamedList<NamedList> shardResponse, Sort groupSort, Sort sortWithinGroup, String shard);}diff --git a/solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java b/solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.javaindex 60393e41470..9dffd951a96 100644--- a/solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java+++ b/solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java@@ -21,7 +21,6 @@ import java.io.InputStream;import java.io.IOException;import java.io.PrintWriter;-import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;@@ -42,7 +41,7 @@ public final class LoadAdminUiServlet extends HttpServlet {@Overridepublic void doGet(HttpServletRequest request,HttpServletResponse response)- throws IOException, ServletException {+ throws IOException {response.setCharacterEncoding("UTF-8");response.setContentType("text/html");@@ -76,7 +75,7 @@ public final class LoadAdminUiServlet extends HttpServlet {@Overridepublic void doPost(HttpServletRequest request,HttpServletResponse response)- throws IOException, ServletException {+ throws IOException {doGet(request, response);}}diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.javaindex 5d834c26f72..fce3ae859ff 100644--- a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java+++ b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java@@ -246,7 +246,7 @@ class HttpRequestContentStream extends ContentStreamBase{private final HttpServletRequest req;- public HttpRequestContentStream( HttpServletRequest req ) throws IOException {+ public HttpRequestContentStream( HttpServletRequest req ) {this.req = req;contentType = req.getContentType();diff --git a/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.java b/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.javaindex 484d636e3cc..3cbca19efff 100644--- a/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.java+++ b/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.java@@ -28,7 +28,6 @@ import org.apache.zookeeper.data.Stat;import org.slf4j.Logger;import org.slf4j.LoggerFactory;-import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;@@ -49,13 +48,13 @@ public final class ZookeeperInfoServlet extends HttpServlet {static final Logger log = LoggerFactory.getLogger(ZookeeperInfoServlet.class);@Override- public void init() throws ServletException {+ public void init() {}@Overridepublic void doGet(HttpServletRequest request,HttpServletResponse response)- throws IOException, ServletException {+ throws IOException {response.setCharacterEncoding("UTF-8");response.setContentType("application/json");@@ -92,7 +91,7 @@ public final class ZookeeperInfoServlet extends HttpServlet {@Overridepublic void doPost(HttpServletRequest request,HttpServletResponse response)- throws IOException, ServletException {+ throws IOException {doGet(request, response);}@@ -363,7 +362,7 @@ public final class ZookeeperInfoServlet extends HttpServlet {json.write(v);}- boolean printZnode(JSONWriter json, String path) throws IOException {+ boolean printZnode(JSONWriter json, String path) {try {Stat stat = new Stat();// Trickily, the call to zkClient.getData fills in the stat variablediff --git a/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java b/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.javaindex b97082bdf9d..5d099731885 100644--- a/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java+++ b/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java@@ -27,8 +27,6 @@ import java.util.List;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;-import org.apache.lucene.index.IndexReader;-import org.apache.solr.core.IndexDeletionPolicyWrapper;import org.apache.solr.core.SolrCore;import org.apache.solr.core.SolrConfig;@@ -43,13 +41,11 @@ import org.apache.commons.codec.binary.Base64;public final class HttpCacheHeaderUtil {- public static void sendNotModified(HttpServletResponse res)- throws IOException {+ public static void sendNotModified(HttpServletResponse res) {res.setStatus(HttpServletResponse.SC_NOT_MODIFIED);}- public static void sendPreconditionFailed(HttpServletResponse res)- throws IOException {+ public static void sendPreconditionFailed(HttpServletResponse res) {res.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED);}@@ -215,8 +211,7 @@ public final class HttpCacheHeaderUtil {public static boolean doCacheHeaderValidation(final SolrQueryRequest solrReq,final HttpServletRequest req,final Method reqMethod,- final HttpServletResponse resp)- throws IOException {+ final HttpServletResponse resp) {if (Method.POST==reqMethod || Method.OTHER==reqMethod) {return false;@@ -244,14 +239,12 @@ public final class HttpCacheHeaderUtil {* Check for etag related conditional headers and set status** @return true if no request processing is necessary and HTTP response status has been set, false otherwise.- * @throws IOException*/@SuppressWarnings("unchecked")public static boolean checkETagValidators(final HttpServletRequest req,final HttpServletResponse resp,final Method reqMethod,- final String etag)- throws IOException {+ final String etag) {// First check If-None-Match because this is the common used header// element by HTTP clients@@ -281,12 +274,10 @@ public final class HttpCacheHeaderUtil {* Check for modify time related conditional headers and set status** @return true if no request processing is necessary and HTTP response status has been set, false otherwise.- * @throws IOException*/public static boolean checkLastModValidators(final HttpServletRequest req,final HttpServletResponse resp,- final long lastMod)- throws IOException {+ final long lastMod) {try {// First check for If-Modified-Since because this is the commondiff --git a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.javaindex 3ff53d7b656..3b4ee533d7c 100644--- a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java+++ b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java@@ -21,7 +21,6 @@ import java.io.IOException;import org.apache.lucene.index.IndexWriter;import org.apache.solr.cloud.RecoveryStrategy;-import org.apache.solr.common.SolrException;import org.apache.solr.core.CoreContainer;import org.apache.solr.core.DirectoryFactory;import org.apache.solr.core.SolrCore;@@ -64,7 +63,7 @@ public final class DefaultSolrCoreState extends SolrCoreState {}@Override- public void decref(IndexWriterCloser closer) throws IOException {+ public void decref(IndexWriterCloser closer) {synchronized (this) {refCnt--;if (refCnt == 0) {diff --git a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.javaindex 636df99c5de..4bca46bbf2d 100644--- a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java+++ b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java@@ -42,11 +42,9 @@ import org.apache.lucene.search.BooleanQuery;import org.apache.lucene.search.MatchAllDocsQuery;import org.apache.lucene.search.Query;import org.apache.lucene.search.TermQuery;-import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.common.SolrException;import org.apache.solr.common.SolrException.ErrorCode;import org.apache.solr.common.params.ModifiableSolrParams;-import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.NamedList;import org.apache.solr.common.util.SimpleOrderedMap;import org.apache.solr.core.SolrConfig.UpdateHandlerInfo;@@ -93,7 +91,7 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreStateprotected final CommitTracker commitTracker;protected final CommitTracker softCommitTracker;- public DirectUpdateHandler2(SolrCore core) throws IOException {+ public DirectUpdateHandler2(SolrCore core) {super(core);solrCoreState = new DefaultSolrCoreState(core.getDirectoryFactory());@@ -109,7 +107,7 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreStatesoftCommitTracker = new CommitTracker("Soft", core, softCommitDocsUpperBound, softCommitTimeUpperBound, true, true);}- public DirectUpdateHandler2(SolrCore core, UpdateHandler updateHandler) throws IOException {+ public DirectUpdateHandler2(SolrCore core, UpdateHandler updateHandler) {super(core);if (updateHandler instanceof DirectUpdateHandler2) {this.solrCoreState = ((DirectUpdateHandler2) updateHandler).solrCoreState;diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.javaindex 3a8247b140e..a79e663cb30 100644--- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java+++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java@@ -172,7 +172,7 @@ public class SolrCmdDistributor {}private void doDelete(DeleteUpdateCommand cmd, List<Node> nodes,- ModifiableSolrParams params) throws IOException {+ ModifiableSolrParams params) {flushAdds(1);diff --git a/solr/core/src/java/org/apache/solr/update/TransactionLog.java b/solr/core/src/java/org/apache/solr/update/TransactionLog.javaindex b662a3abc79..23bcbc305c0 100644--- a/solr/core/src/java/org/apache/solr/update/TransactionLog.java+++ b/solr/core/src/java/org/apache/solr/update/TransactionLog.java@@ -18,7 +18,6 @@package org.apache.solr.update;import org.apache.lucene.util.BytesRef;-import org.apache.solr.common.SolrDocument;import org.apache.solr.common.SolrException;import org.apache.solr.common.SolrInputDocument;import org.apache.solr.common.util.FastInputStream;@@ -27,13 +26,19 @@ import org.apache.solr.common.util.JavaBinCodec;import org.slf4j.Logger;import org.slf4j.LoggerFactory;-import java.io.*;+import java.io.File;+import java.io.IOException;+import java.io.OutputStream;+import java.io.RandomAccessFile;import java.nio.ByteBuffer;import java.nio.channels.Channels;import java.nio.channels.FileChannel;-import java.rmi.registry.LocateRegistry;-import java.util.*;-import java.util.concurrent.CountDownLatch;+import java.util.ArrayList;+import java.util.Collection;+import java.util.HashMap;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;import java.util.concurrent.atomic.AtomicInteger;/**@@ -129,11 +134,11 @@ public class TransactionLog {}- TransactionLog(File tlogFile, Collection<String> globalStrings) throws IOException {+ TransactionLog(File tlogFile, Collection<String> globalStrings) {this(tlogFile, globalStrings, false);}- TransactionLog(File tlogFile, Collection<String> globalStrings, boolean openExisting) throws IOException {+ TransactionLog(File tlogFile, Collection<String> globalStrings, boolean openExisting) {try {if (debug) {log.debug("New TransactionLog file=" + tlogFile + ", exists=" + tlogFile.exists() + ", size=" + tlogFile.length() + ", openExisting=" + openExisting);@@ -596,7 +601,7 @@ public class TransactionLog {ChannelFastInputStream fis;private LogCodec codec = new LogCodec() {@Override- public SolrInputDocument readSolrInputDocument(FastInputStream dis) throws IOException {+ public SolrInputDocument readSolrInputDocument(FastInputStream dis) {// Given that the SolrInputDocument is last in an add record, it's OK to just skip// reading it completely.return null;diff --git a/solr/core/src/java/org/apache/solr/update/UpdateLog.java b/solr/core/src/java/org/apache/solr/update/UpdateLog.javaindex 09dc012c3a4..4f44345f8ae 100644--- a/solr/core/src/java/org/apache/solr/update/UpdateLog.java+++ b/solr/core/src/java/org/apache/solr/update/UpdateLog.java@@ -20,7 +20,6 @@ package org.apache.solr.update;import org.apache.lucene.util.BytesRef;import org.apache.solr.common.SolrException;import org.apache.solr.common.SolrInputDocument;-import org.apache.solr.common.params.MapSolrParams;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.NamedList;@@ -31,7 +30,6 @@ import org.apache.solr.request.SolrQueryRequest;import org.apache.solr.request.SolrRequestInfo;import org.apache.solr.response.SolrQueryResponse;import org.apache.solr.search.SolrIndexSearcher;-import org.apache.solr.update.processor.DistributedUpdateProcessor;import org.apache.solr.update.processor.DistributedUpdateProcessorFactory;import org.apache.solr.update.processor.RunUpdateProcessorFactory;import org.apache.solr.update.processor.UpdateRequestProcessor;@@ -632,11 +630,7 @@ public class UpdateLog implements PluginInfoInitialized {private void ensureLog() {if (tlog == null) {String newLogName = String.format(Locale.ENGLISH, LOG_FILENAME_PATTERN, TLOG_NAME, id);- try {- tlog = new TransactionLog(new File(tlogDir, newLogName), globalStrings);- } catch (IOException e) {- throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Can't open new tlog!", e);- }+ tlog = new TransactionLog(new File(tlogDir, newLogName), globalStrings);}}diff --git a/solr/core/src/java/org/apache/solr/util/SystemIdResolver.java b/solr/core/src/java/org/apache/solr/util/SystemIdResolver.javaindex fbcb1ca8eba..cf263aae533 100644--- a/solr/core/src/java/org/apache/solr/util/SystemIdResolver.java+++ b/solr/core/src/java/org/apache/solr/util/SystemIdResolver.java@@ -96,7 +96,7 @@ public final class SystemIdResolver implements EntityResolver, EntityResolver2 {};}- URI resolveRelativeURI(String baseURI, String systemId) throws IOException,URISyntaxException {+ URI resolveRelativeURI(String baseURI, String systemId) throws URISyntaxException {URI uri;// special case for backwards compatibility: if relative systemId starts with "/" (we convert that to an absolute solrres:-URI)diff --git a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomFaceting.javaindex 54fb692ec82..7895b06da14 100644--- a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java+++ b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java@@ -19,14 +19,9 @@ package org.apache.solr;import org.apache.lucene.search.FieldCache;import org.apache.lucene.util._TestUtil;-import org.apache.noggit.JSONUtil;-import org.apache.noggit.ObjectBuilder;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.request.SolrQueryRequest;-import org.apache.solr.schema.IndexSchema;import org.apache.solr.schema.SchemaField;-import org.apache.solr.util.TestUtils;-import org.junit.Before;import org.junit.BeforeClass;import org.junit.Test;@@ -80,7 +75,7 @@ public class TestRandomFaceting extends SolrTestCaseJ4 {model = indexDocs(types, model, ndocs);}- void deleteSomeDocs() throws Exception {+ void deleteSomeDocs() {Random rand = random();int percent = rand.nextInt(100);if (model == null) return;diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.javaindex e8ef66f068d..66bb42d0831 100644--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java@@ -34,12 +34,8 @@ import java.util.concurrent.SynchronousQueue;import java.util.concurrent.ThreadPoolExecutor;import java.util.concurrent.TimeUnit;-import org.apache.lucene.util.LuceneTestCase;-import org.apache.noggit.JSONUtil;-import org.apache.noggit.ObjectBuilder;import org.apache.solr.JSONTestUtil;import org.apache.solr.client.solrj.SolrQuery;-import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.SolrServer;import org.apache.solr.client.solrj.SolrServerException;import org.apache.solr.client.solrj.impl.CloudSolrServer;@@ -48,7 +44,6 @@ import org.apache.solr.client.solrj.request.AbstractUpdateRequest;import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;import org.apache.solr.client.solrj.request.CoreAdminRequest.Create;import org.apache.solr.client.solrj.request.QueryRequest;-import org.apache.solr.client.solrj.request.UpdateRequest;import org.apache.solr.client.solrj.response.QueryResponse;import org.apache.solr.client.solrj.response.UpdateResponse;import org.apache.solr.common.SolrException;@@ -58,7 +53,6 @@ import org.apache.solr.common.cloud.Slice;import org.apache.solr.common.cloud.ZkStateReader;import org.apache.solr.common.params.CommonParams;import org.apache.solr.common.params.UpdateParams;-import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.common.util.NamedList;import org.apache.solr.update.SolrCmdDistributor.Request;@@ -392,7 +386,7 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase {}private void testNumberOfCommitsWithCommitAfterAdd()- throws MalformedURLException, SolrServerException, IOException {+ throws SolrServerException, IOException {long startCommits = getNumCommits((HttpSolrServer) clients.get(0));ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update");@@ -406,7 +400,7 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase {assertEquals(startCommits + 1L, endCommits);}- private Long getNumCommits(HttpSolrServer solrServer) throws MalformedURLException,+ private Long getNumCommits(HttpSolrServer solrServer) throwsSolrServerException, IOException {HttpSolrServer server = new HttpSolrServer(solrServer.getBaseURL());ModifiableSolrParams params = new ModifiableSolrParams();@@ -552,15 +546,13 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase {}private void createCollection(String collection,- List<SolrServer> collectionClients, String baseUrl, int num)- throws MalformedURLException, SolrServerException, IOException, InterruptedException {+ List<SolrServer> collectionClients, String baseUrl, int num) {createCollection(collection, collectionClients, baseUrl, num, null);}private void createCollection(final String collection,List<SolrServer> collectionClients, final String baseUrl, final int num,- final String shardId) throws MalformedURLException, SolrServerException,- IOException, InterruptedException {+ final String shardId) {Callable call = new Callable() {public Object call() {HttpSolrServer server;@@ -594,8 +586,7 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase {collectionClients.add(createNewSolrServer(collection, baseUrl));}- private void testMultipleCollections() throws MalformedURLException,- SolrServerException, IOException, Exception {+ private void testMultipleCollections() throws Exception {// create another 2 collections and search across themcreateNewCollection("collection2");createNewCollection("collection3");@@ -665,8 +656,7 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase {client.add(doc);}- private void createNewCollection(final String collection)- throws MalformedURLException, SolrServerException, IOException, InterruptedException {+ private void createNewCollection(final String collection) throws InterruptedException {final List<SolrServer> collectionClients = new ArrayList<SolrServer>();otherCollectionClients.put(collection, collectionClients);int unique = 0;diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.javaindex a6dcb4fe956..9e3ef14d083 100644--- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java@@ -17,10 +17,7 @@ package org.apache.solr.cloud;* limitations under the License.*/-import java.io.IOException;import java.net.ConnectException;-import java.net.MalformedURLException;-import java.net.URISyntaxException;import java.util.ArrayList;import java.util.List;import java.util.Set;@@ -32,7 +29,6 @@ import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer;import org.apache.solr.client.solrj.impl.HttpClientUtil;import org.apache.solr.client.solrj.impl.HttpSolrServer;import org.apache.solr.common.SolrInputDocument;-import org.apache.zookeeper.KeeperException;import org.junit.After;import org.junit.AfterClass;import org.junit.Before;@@ -43,11 +39,11 @@ import org.junit.Ignore;public class ChaosMonkeyNothingIsSafeTest extends FullSolrCloudTest {@BeforeClass- public static void beforeSuperClass() throws Exception {+ public static void beforeSuperClass() {}@AfterClass- public static void afterSuperClass() throws Exception {+ public static void afterSuperClass() {}@Before@@ -159,8 +155,7 @@ public class ChaosMonkeyNothingIsSafeTest extends FullSolrCloudTest {}}- private void waitForThingsToLevelOut() throws KeeperException,- InterruptedException, Exception, IOException, URISyntaxException {+ private void waitForThingsToLevelOut() throws Exception {int cnt = 0;boolean retry = false;do {@@ -210,7 +205,7 @@ public class ChaosMonkeyNothingIsSafeTest extends FullSolrCloudTest {private List<SolrServer> clients;public FullThrottleStopableIndexingThread(List<SolrServer> clients,- int startI, boolean doDeletes) throws MalformedURLException {+ int startI, boolean doDeletes) {super(startI, doDeletes);setName("FullThrottleStopableIndexingThread");setDaemon(true);@@ -282,18 +277,14 @@ public class ChaosMonkeyNothingIsSafeTest extends FullSolrCloudTest {if (clientIndex > clients.size() - 1) {clientIndex = 0;}- try {- suss.shutdownNow();- suss = new ConcurrentUpdateSolrServer(- ((HttpSolrServer) clients.get(clientIndex)).getBaseURL(),- httpClient, 30, 3) {- public void handleError(Throwable ex) {- log.warn("suss error", ex);- }- };- } catch (MalformedURLException e1) {- e1.printStackTrace();- }+ suss.shutdownNow();+ suss = new ConcurrentUpdateSolrServer(+ ((HttpSolrServer) clients.get(clientIndex)).getBaseURL(),+ httpClient, 30, 3) {+ public void handleError(Throwable ex) {+ log.warn("suss error", ex);+ }+ };}}diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.javaindex 99aca638731..f112db606fd 100644--- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java@@ -17,15 +17,12 @@ package org.apache.solr.cloud;* limitations under the License.*/-import java.io.IOException;-import java.net.URISyntaxException;import java.util.ArrayList;import java.util.List;import java.util.Set;import org.apache.solr.client.solrj.SolrQuery;import org.apache.solr.common.SolrInputDocument;-import org.apache.zookeeper.KeeperException;import org.junit.After;import org.junit.AfterClass;import org.junit.Before;@@ -36,12 +33,12 @@ import org.junit.Ignore;public class ChaosMonkeySafeLeaderTest extends FullSolrCloudTest {@BeforeClass- public static void beforeSuperClass() throws Exception {+ public static void beforeSuperClass() {}@AfterClass- public static void afterSuperClass() throws Exception {+ public static void afterSuperClass() {}@@ -119,8 +116,7 @@ public class ChaosMonkeySafeLeaderTest extends FullSolrCloudTest {if (VERBOSE) System.out.println("control docs:" + controlClient.query(new SolrQuery("*:*")).getResults().getNumFound() + "\n\n");}- private void waitForThingsToLevelOut() throws KeeperException,- InterruptedException, Exception, IOException, URISyntaxException {+ private void waitForThingsToLevelOut() throws Exception {int cnt = 0;boolean retry = false;do {diff --git a/solr/core/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java b/solr/core/src/test/org/apache/solr/cloud/CloudStateUpdateTest.javaindex ad8e94bce84..80abfb58a51 100644--- a/solr/core/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/CloudStateUpdateTest.java@@ -66,7 +66,7 @@ public class CloudStateUpdateTest extends SolrTestCaseJ4 {private Initializer init2;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {System.setProperty("solrcloud.skip.autorecovery", "true");}diff --git a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.javaindex 55c52b90f2b..e3a4b54ff11 100644--- a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java@@ -18,8 +18,6 @@ package org.apache.solr.cloud;*/import java.io.IOException;-import java.net.MalformedURLException;-import java.util.concurrent.TimeoutException;import org.apache.solr.client.solrj.SolrQuery;import org.apache.solr.client.solrj.SolrServer;@@ -48,7 +46,7 @@ public class FullSolrCloudDistribCmdsTest extends FullSolrCloudTest {@BeforeClass- public static void beforeSuperClass() throws Exception {+ public static void beforeSuperClass() {}public FullSolrCloudDistribCmdsTest() {@@ -131,8 +129,7 @@ public class FullSolrCloudDistribCmdsTest extends FullSolrCloudTest {testThatCantForwardToLeaderFails();}- private void testThatCantForwardToLeaderFails() throws InterruptedException,- Exception, TimeoutException, IOException, KeeperException {+ private void testThatCantForwardToLeaderFails() throws Exception {ZkNodeProps props = zkStateReader.getLeaderProps(DEFAULT_COLLECTION, "shard1");chaosMonkey.stopShard("shard1");@@ -164,8 +161,8 @@ public class FullSolrCloudDistribCmdsTest extends FullSolrCloudTest {assertTrue("A whole shard is down - some of these should fail", fails > 0);}- private long addTwoDocsInOneRequest(long docId) throws SolrServerException,- IOException, Exception {+ private long addTwoDocsInOneRequest(long docId) throws+ Exception {QueryResponse results;UpdateRequest uReq;uReq = new UpdateRequest();@@ -192,7 +189,7 @@ public class FullSolrCloudDistribCmdsTest extends FullSolrCloudTest {return docId;}- private long addUpdateDelete() throws Exception, SolrServerException,+ private long addUpdateDelete() throws Exception,IOException {long docId = 99999999L;indexr("id", docId, t1, "originalcontent");@@ -230,13 +227,13 @@ public class FullSolrCloudDistribCmdsTest extends FullSolrCloudTest {return docId;}- private void testDeleteByQueryDistrib() throws Exception, SolrServerException {+ private void testDeleteByQueryDistrib() throws Exception {del("*:*");commit();assertEquals(0, query(cloudClient).getResults().getNumFound());}- private void testIndexingWithSuss() throws MalformedURLException, Exception {+ private void testIndexingWithSuss() throws Exception {ConcurrentUpdateSolrServer suss = new ConcurrentUpdateSolrServer(((HttpSolrServer) clients.get(0)).getBaseURL(), 3, 1);diff --git a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.javaindex 16c13dc7aa2..b4ffdeb2249 100644--- a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java@@ -20,9 +20,12 @@ package org.apache.solr.cloud;import java.io.IOException;import java.net.MalformedURLException;import java.net.URI;-import java.net.URISyntaxException;-import java.util.*;-import java.util.concurrent.TimeoutException;+import java.util.ArrayList;+import java.util.HashMap;+import java.util.HashSet;+import java.util.List;+import java.util.Map;+import java.util.Set;import java.util.concurrent.atomic.AtomicInteger;import org.apache.http.params.CoreConnectionPNames;@@ -46,12 +49,10 @@ import org.apache.solr.common.cloud.ZkStateReader;import org.apache.solr.common.params.CommonParams;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.servlet.SolrDispatchFilter;-import org.apache.zookeeper.KeeperException;import org.junit.After;import org.junit.AfterClass;import org.junit.Before;import org.junit.BeforeClass;-import org.junit.Ignore;/***@@ -61,7 +62,7 @@ import org.junit.Ignore;*/public class FullSolrCloudTest extends AbstractDistributedZkTestCase {@BeforeClass- public static void beforeFullSolrCloudTest() throws Exception {+ public static void beforeFullSolrCloudTest() {// shorten the log output more for this test typeif (formatter != null) formatter.setShorterFormat();}@@ -148,7 +149,7 @@ public class FullSolrCloudTest extends AbstractDistributedZkTestCase {}@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {System.setProperty("solr.directoryFactory", "solr.StandardDirectoryFactory");System.setProperty("solrcloud.update.delay", "0");@@ -327,8 +328,7 @@ public class FullSolrCloudTest extends AbstractDistributedZkTestCase {}protected void updateMappingsFromZk(List<JettySolrRunner> jettys,- List<SolrServer> clients) throws Exception, IOException, KeeperException,- URISyntaxException {+ List<SolrServer> clients) throws Exception {zkStateReader.updateCloudState(true);shardToClient.clear();shardToJetty.clear();@@ -596,8 +596,7 @@ public class FullSolrCloudTest extends AbstractDistributedZkTestCase {}- private long testUpdateAndDelete() throws Exception, SolrServerException,- IOException {+ private long testUpdateAndDelete() throws Exception {long docId = 99999999L;indexr("id", docId, t1, "originalcontent");@@ -632,9 +631,7 @@ public class FullSolrCloudTest extends AbstractDistributedZkTestCase {return docId;}- private void addNewReplica() throws Exception, InterruptedException,- TimeoutException, IOException, KeeperException, URISyntaxException,- SolrServerException {+ private void addNewReplica() throws Exception {JettySolrRunner newReplica = createJettys(1).get(0);waitForRecoveriesToFinish(false);@@ -656,8 +653,7 @@ public class FullSolrCloudTest extends AbstractDistributedZkTestCase {super.waitForRecoveriesToFinish(DEFAULT_COLLECTION, zkStateReader, verbose);}- private void brindDownShardIndexSomeDocsAndRecover() throws Exception,- SolrServerException, IOException, InterruptedException {+ private void brindDownShardIndexSomeDocsAndRecover() throws Exception {SolrQuery query = new SolrQuery("*:*");query.set("distrib", false);diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.javaindex 0106fb6a449..1c54c955128 100644--- a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java@@ -35,7 +35,6 @@ import org.apache.solr.common.cloud.ZkNodeProps;import org.apache.solr.common.cloud.ZkStateReader;import org.apache.solr.core.CoreContainer;import org.apache.solr.core.CoreContainer.Initializer;-import org.apache.zookeeper.KeeperException;import org.junit.AfterClass;import org.junit.BeforeClass;import org.junit.Test;@@ -67,7 +66,7 @@ public class LeaderElectionIntegrationTest extends SolrTestCaseJ4 {private ZkStateReader reader;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {System.setProperty("solrcloud.skip.autorecovery", "true");}@@ -245,7 +244,7 @@ public class LeaderElectionIntegrationTest extends SolrTestCaseJ4 {//Thread.sleep(100000);}- private String getLeader() throws InterruptedException, KeeperException {+ private String getLeader() throws InterruptedException {ZkNodeProps props = reader.getLeaderProps("collection1", "shard1", 30000);String leader = props.get(ZkStateReader.NODE_NAME_PROP);diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.javaindex be44b6510f7..24cae923f2d 100644--- a/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java@@ -51,12 +51,12 @@ public class LeaderElectionTest extends SolrTestCaseJ4 {private volatile boolean stopStress = false;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {createTempDir();}@AfterClass- public static void afterClass() throws InterruptedException {+ public static void afterClass() {}diff --git a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.javaindex 0346435baf1..18dfd7a0136 100644--- a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java@@ -35,12 +35,12 @@ public class RecoveryZkTest extends FullSolrCloudTest {private StopableIndexingThread indexThread;private StopableIndexingThread indexThread2;@BeforeClass- public static void beforeSuperClass() throws Exception {+ public static void beforeSuperClass() {}@AfterClass- public static void afterSuperClass() throws Exception {+ public static void afterSuperClass() {}diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMultiCoreConfBootstrap.java b/solr/core/src/test/org/apache/solr/cloud/TestMultiCoreConfBootstrap.javaindex de06002988e..3d9ea8ac70c 100644--- a/solr/core/src/test/org/apache/solr/cloud/TestMultiCoreConfBootstrap.java+++ b/solr/core/src/test/org/apache/solr/cloud/TestMultiCoreConfBootstrap.java@@ -18,7 +18,6 @@package org.apache.solr.cloud;import java.io.File;-import java.io.IOException;import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.common.cloud.SolrZkClient;@@ -43,12 +42,12 @@ public class TestMultiCoreConfBootstrap extends SolrTestCaseJ4 {protected static String zkDir;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {createTempDir();}@AfterClass- public static void afterClass() throws IOException {+ public static void afterClass() {}diff --git a/solr/core/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java b/solr/core/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.javaindex e68ea750a5e..ed0e41d7848 100644--- a/solr/core/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java+++ b/solr/core/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java@@ -37,7 +37,7 @@ public class RAMDirectoryFactoryTest extends LuceneTestCase {final Directory directory = new RAMDirectory();RAMDirectoryFactory factory = new RAMDirectoryFactory() {@Override- protected Directory create(String path) throws IOException {+ protected Directory create(String path) {return directory;}};diff --git a/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java b/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.javaindex 559a259bf8e..2ca5c1b3b72 100644--- a/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java+++ b/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java@@ -49,12 +49,12 @@ public class TestArbitraryIndexDir extends AbstractSolrTestCase{// TODO: fix this test to not require FSDirectorystatic String savedFactory;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {savedFactory = System.getProperty("solr.DirectoryFactory");System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockFSDirectoryFactory");}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrXMLSerializer.java b/solr/core/src/test/org/apache/solr/core/TestSolrXMLSerializer.javaindex af3777a494e..5e6181086fb 100644--- a/solr/core/src/test/org/apache/solr/core/TestSolrXMLSerializer.java+++ b/solr/core/src/test/org/apache/solr/core/TestSolrXMLSerializer.java@@ -22,7 +22,6 @@ import java.io.ByteArrayInputStream;import java.io.File;import java.io.IOException;import java.io.StringWriter;-import java.io.UnsupportedEncodingException;import java.io.Writer;import java.util.ArrayList;import java.util.HashMap;@@ -90,8 +89,7 @@ public class TestSolrXMLSerializer extends LuceneTestCase {}private void assertResults(byte[] bytes)- throws ParserConfigurationException, UnsupportedEncodingException,- IOException, SAXException, XPathExpressionException {+ throws ParserConfigurationException, IOException, SAXException, XPathExpressionException {DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();BufferedInputStream is = new BufferedInputStream(new ByteArrayInputStream(bytes));Document document;diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.javaindex 734ac5dba65..3b396c07265 100644--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java@@ -18,13 +18,10 @@ package org.apache.solr.handler.component;*/import java.io.File;-import java.io.IOException;import org.apache.solr.BaseDistributedSearchTestCase;import org.apache.solr.common.SolrInputDocument;import org.apache.solr.common.params.CommonParams;-import org.apache.solr.util.FileUtils;-import org.junit.After;import org.junit.AfterClass;import org.junit.BeforeClass;@@ -44,13 +41,13 @@ public class DistributedQueryElevationComponentTest extends BaseDistributedSearc}@BeforeClass- public static void beforeClass() throws IOException {+ public static void beforeClass() {System.setProperty("elevate.data.file", "elevate.xml");File parent = new File(TEST_HOME(), "conf");}@AfterClass- public static void afterClass() throws IOException {+ public static void afterClass() {System.clearProperty("elevate.data.file");}diff --git a/solr/core/src/test/org/apache/solr/request/TestWriterPerf.java b/solr/core/src/test/org/apache/solr/request/TestWriterPerf.javaindex 71433c0e62f..5808ec9f47a 100755--- a/solr/core/src/test/org/apache/solr/request/TestWriterPerf.java+++ b/solr/core/src/test/org/apache/solr/request/TestWriterPerf.java@@ -86,7 +86,7 @@ public class TestWriterPerf extends AbstractSolrTestCase {/** make sure to close req after you are done using the response */- public SolrQueryResponse getResponse(SolrQueryRequest req) throws IOException, Exception {+ public SolrQueryResponse getResponse(SolrQueryRequest req) throws Exception {SolrQueryResponse rsp = new SolrQueryResponse();h.getCore().execute(h.getCore().getRequestHandler(null),req,rsp);if (rsp.getException() != null) {diff --git a/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java b/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.javaindex 2dd1fbb82d5..f19d0e045ff 100755--- a/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java+++ b/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java@@ -17,8 +17,6 @@package org.apache.solr.search;-import java.io.IOException;-import org.apache.solr.common.SolrException;import org.apache.solr.util.AbstractSolrTestCase;import org.junit.Test;@@ -430,7 +428,7 @@ public class TestExtendedDismaxParser extends AbstractSolrTestCase {}- public void testAliasing() throws IOException, Exception {+ public void testAliasing() throws Exception {String oner = "*[count(//doc)=1]";String twor = "*[count(//doc)=2]";String nor = "*[count(//doc)=0]";@@ -463,12 +461,12 @@ public class TestExtendedDismaxParser extends AbstractSolrTestCase {}- public void testAliasingBoost() throws IOException, Exception {+ public void testAliasingBoost() throws Exception {assertQ(req("defType","edismax", "q","Zapp Pig", "qf","myalias", "f.myalias.qf","name trait_ss^0.5"), "//result/doc[1]/str[@name='id']=42", "//result/doc[2]/str[@name='id']=47");//doc 42 should score higher than 46assertQ(req("defType","edismax", "q","Zapp Pig", "qf","myalias^100 name", "f.myalias.qf","trait_ss^0.5"), "//result/doc[1]/str[@name='id']=47", "//result/doc[2]/str[@name='id']=42");//Now the order should be inverse}- public void testCyclicAliasing() throws IOException, Exception {+ public void testCyclicAliasing() throws Exception {try {h.query(req("defType","edismax", "q","ignore_exception", "qf","who", "f.who.qf","name","f.name.qf","who"));fail("Simple cyclic alising");diff --git a/solr/core/src/test/org/apache/solr/search/TestFastLRUCache.java b/solr/core/src/test/org/apache/solr/search/TestFastLRUCache.javaindex 7f96121bf67..749e839f599 100644--- a/solr/core/src/test/org/apache/solr/search/TestFastLRUCache.java+++ b/solr/core/src/test/org/apache/solr/search/TestFastLRUCache.java@@ -83,7 +83,7 @@ public class TestFastLRUCache extends LuceneTestCase {doTestPercentageAutowarm(100, 0, new int[]{}, new int[]{1, 10, 25, 51, 55, 60, 70, 80, 99, 100, 200, 300});}- private void doTestPercentageAutowarm(int limit, int percentage, int[] hits, int[]misses) throws IOException {+ private void doTestPercentageAutowarm(int limit, int percentage, int[] hits, int[]misses) {FastLRUCache<Object, Object> fastCache = new FastLRUCache<Object, Object>();Map<String, String> params = new HashMap<String, String>();params.put("size", String.valueOf(limit));@@ -177,7 +177,7 @@ public class TestFastLRUCache extends LuceneTestCase {private CacheRegenerator createCodeRegenerator() {CacheRegenerator cr = new CacheRegenerator() {public boolean regenerateItem(SolrIndexSearcher newSearcher, SolrCache newCache,- SolrCache oldCache, Object oldKey, Object oldVal) throws IOException {+ SolrCache oldCache, Object oldKey, Object oldVal) {newCache.put(oldKey, oldVal);return true;}diff --git a/solr/core/src/test/org/apache/solr/search/TestLRUCache.java b/solr/core/src/test/org/apache/solr/search/TestLRUCache.javaindex aeb5240cea3..2bc886bce4b 100644--- a/solr/core/src/test/org/apache/solr/search/TestLRUCache.java+++ b/solr/core/src/test/org/apache/solr/search/TestLRUCache.java@@ -63,7 +63,7 @@ public class TestLRUCache extends LuceneTestCase {doTestPercentageAutowarm(10, 10, new int[]{10}, new int[]{1, 5, 9, 100, 200, 300, 400, 800, 899, 900});}- private void doTestPercentageAutowarm(int limit, int percentage, int[] hits, int[]misses) throws IOException {+ private void doTestPercentageAutowarm(int limit, int percentage, int[] hits, int[]misses) {LRUCache<Object, Object> lruCache = new LRUCache<Object, Object>();Map<String, String> params = new HashMap<String, String>();params.put("size", String.valueOf(limit));@@ -126,7 +126,7 @@ public class TestLRUCache extends LuceneTestCase {CacheRegenerator cr = new CacheRegenerator() {@SuppressWarnings("unchecked")public boolean regenerateItem(SolrIndexSearcher newSearcher, SolrCache newCache,- SolrCache oldCache, Object oldKey, Object oldVal) throws IOException {+ SolrCache oldCache, Object oldKey, Object oldVal) {newCache.put(oldKey, oldVal);return true;}diff --git a/solr/core/src/test/org/apache/solr/search/TestRecovery.java b/solr/core/src/test/org/apache/solr/search/TestRecovery.javaindex 0b54fbf6a7c..c631ec950b5 100644--- a/solr/core/src/test/org/apache/solr/search/TestRecovery.java+++ b/solr/core/src/test/org/apache/solr/search/TestRecovery.java@@ -17,24 +17,25 @@package org.apache.solr.search;-import org.apache.lucene.util.BytesRef;-import org.apache.noggit.JSONUtil;import org.apache.noggit.ObjectBuilder;import org.apache.solr.SolrTestCaseJ4;-import org.apache.solr.common.util.ByteUtils;import org.apache.solr.request.SolrQueryRequest;import org.apache.solr.update.DirectUpdateHandler2;import org.apache.solr.update.UpdateLog;import org.apache.solr.update.UpdateHandler;-import org.apache.solr.update.UpdateLog;import org.junit.AfterClass;import org.junit.BeforeClass;-import org.junit.Ignore;import org.junit.Test;import java.io.File;import java.io.RandomAccessFile;-import java.util.*;+import java.util.ArrayDeque;+import java.util.Arrays;+import java.util.Deque;+import java.util.LinkedList;+import java.util.List;+import java.util.Locale;+import java.util.Map;import java.util.concurrent.Future;import java.util.concurrent.Semaphore;import java.util.concurrent.TimeUnit;@@ -60,7 +61,7 @@ public class TestRecovery extends SolrTestCaseJ4 {}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {@@ -892,7 +893,7 @@ public class TestRecovery extends SolrTestCaseJ4 {// WARNING... assumes format of .00000n where n is less than 9long logNumber = Long.parseLong(fname.substring(fname.lastIndexOf(".") + 1));- String fname2 = String.format(Locale.ENGLISH,+ String fname2 = String.format(Locale.ENGLISH,UpdateLog.LOG_FILENAME_PATTERN,UpdateLog.TLOG_NAME,logNumber + 1);diff --git a/solr/core/src/test/org/apache/solr/search/TestSort.java b/solr/core/src/test/org/apache/solr/search/TestSort.javaindex 3461f79cc32..135eced4c04 100755--- a/solr/core/src/test/org/apache/solr/search/TestSort.java+++ b/solr/core/src/test/org/apache/solr/search/TestSort.java@@ -203,7 +203,7 @@ public class TestSort extends SolrTestCaseJ4 {for (int i=0; i<qiter; i++) {Filter filt = new Filter() {@Override- public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {+ public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) {return BitsFilteredDocIdSet.wrap(randSet(context.reader().maxDoc()), acceptDocs);}};diff --git a/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java b/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.javaindex d25e4210143..c7519f65482 100644--- a/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java+++ b/solr/core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java@@ -54,7 +54,7 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 {static SolrRequestParsers parser;@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {parser = null;}diff --git a/solr/core/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java b/solr/core/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.javaindex 1d318491b21..616b0f0b4ce 100644--- a/solr/core/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java+++ b/solr/core/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java@@ -54,7 +54,7 @@ public class FileBasedSpellCheckerTest extends SolrTestCaseJ4 {}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {queryConverter = null;}diff --git a/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java b/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.javaindex b9ece8376b6..a16dd6810bc 100644--- a/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java+++ b/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java@@ -76,7 +76,7 @@ public class IndexBasedSpellCheckerTest extends SolrTestCaseJ4 {}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {queryConverter = null;}diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java b/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.javaindex 30e4dcb343c..c4c55c46fce 100644--- a/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java@@ -43,7 +43,7 @@ public class SuggesterTest extends SolrTestCaseJ4 {}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {@@ -51,7 +51,7 @@ public class SuggesterTest extends SolrTestCaseJ4 {}}- public static void addDocs() throws Exception {+ public static void addDocs() {assertU(adoc("id", "1","text", "acceptable accidentally accommodate acquire"));diff --git a/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java b/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.javaindex 4411548566b..a2da229880a 100644--- a/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java+++ b/solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java@@ -18,7 +18,6 @@package org.apache.solr.update;import java.util.Arrays;-import java.util.Collections;import java.util.HashMap;import java.util.Map;@@ -51,7 +50,7 @@ public class DirectUpdateHandlerTest extends SolrTestCaseJ4 {}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {diff --git a/solr/core/src/test/org/apache/solr/update/TestIndexingPerformance.java b/solr/core/src/test/org/apache/solr/update/TestIndexingPerformance.javaindex 617391bad7a..4e9d16b41b9 100755--- a/solr/core/src/test/org/apache/solr/update/TestIndexingPerformance.java+++ b/solr/core/src/test/org/apache/solr/update/TestIndexingPerformance.java@@ -41,12 +41,12 @@ public class TestIndexingPerformance extends AbstractSolrTestCase {// TODO: fix this test to not require FSDirectorystatic String savedFactory;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {savedFactory = System.getProperty("solr.DirectoryFactory");System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockFSDirectoryFactory");}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {diff --git a/solr/core/src/test/org/apache/solr/util/DOMUtilTest.java b/solr/core/src/test/org/apache/solr/util/DOMUtilTest.javaindex e7c733361e6..8b4fc9c5e04 100644--- a/solr/core/src/test/org/apache/solr/util/DOMUtilTest.java+++ b/solr/core/src/test/org/apache/solr/util/DOMUtilTest.java@@ -19,7 +19,6 @@ package org.apache.solr.util;import org.apache.solr.common.util.NamedList;import org.apache.solr.common.util.SimpleOrderedMap;-import org.apache.solr.util.DOMUtilTestBase;public class DOMUtilTest extends DOMUtilTestBase {@@ -49,7 +48,7 @@ public class DOMUtilTest extends DOMUtilTestBase {assertTypeAndValue( namedList, "Boolean", false );}- private void assertTypeAndValue( NamedList<Object> namedList, String key, Object value ) throws Exception {+ private void assertTypeAndValue( NamedList<Object> namedList, String key, Object value ) {Object v = namedList.get( key );assertNotNull( v );assertEquals( key, v.getClass().getSimpleName() );diff --git a/solr/solrj/src/java/org/apache/noggit/CharArr.java b/solr/solrj/src/java/org/apache/noggit/CharArr.javaindex e5855618956..e86f58bfde9 100755--- a/solr/solrj/src/java/org/apache/noggit/CharArr.java+++ b/solr/solrj/src/java/org/apache/noggit/CharArr.java@@ -198,7 +198,7 @@ public class CharArr implements CharSequence, Appendable {return null;}- public final Appendable append(char c) throws IOException {+ public final Appendable append(char c) {write(c);return this;}diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BinaryRequestWriter.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BinaryRequestWriter.javaindex 71fadcfe471..2ada3d8344a 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BinaryRequestWriter.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BinaryRequestWriter.java@@ -84,11 +84,11 @@ public class BinaryRequestWriter extends RequestWriter {return new Long(baos.size());}- public InputStream getStream() throws IOException {+ public InputStream getStream() {return new ByteArrayInputStream(baos.getbuf(), 0, baos.size());}- public Reader getReader() throws IOException {+ public Reader getReader() {throw new RuntimeException("No reader available . this is a binarystream");}};diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.javaindex 1d90de79fd9..cc1e59f836a 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.java@@ -19,7 +19,6 @@ package org.apache.solr.client.solrj.impl;import java.io.IOException;import java.io.OutputStream;-import java.net.MalformedURLException;import java.util.LinkedList;import java.util.Queue;import java.util.concurrent.BlockingQueue;@@ -86,10 +85,9 @@ public class ConcurrentUpdateSolrServer extends SolrServer {* The buffer size before the documents are sent to the server* @param threadCount* The number of background threads used to empty the queue- * @throws MalformedURLException*/public ConcurrentUpdateSolrServer(String solrServerUrl, int queueSize,- int threadCount) throws MalformedURLException {+ int threadCount) {this(solrServerUrl, null, queueSize, threadCount);}@@ -99,8 +97,7 @@ public class ConcurrentUpdateSolrServer extends SolrServer {* ThreadSafeClientConnManager.*/public ConcurrentUpdateSolrServer(String solrServerUrl,- HttpClient client, int queueSize, int threadCount)- throws MalformedURLException {+ HttpClient client, int queueSize, int threadCount) {this.server = new HttpSolrServer(solrServerUrl, client);this.server.setFollowRedirects(false);queue = new LinkedBlockingQueue<UpdateRequest>(queueSize);diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/CloudState.java b/solr/solrj/src/java/org/apache/solr/common/cloud/CloudState.javaindex 37f0a68039c..c25a3330738 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/CloudState.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/CloudState.java@@ -240,7 +240,7 @@ public class CloudState implements JSONWriter.Writable {/*** Create CloudState from json string that is typically stored in zookeeper.*/- public static CloudState load(byte[] bytes, Set<String> liveNodes) throws KeeperException, InterruptedException {+ public static CloudState load(byte[] bytes, Set<String> liveNodes) {if (bytes == null || bytes.length == 0) {return new CloudState(liveNodes, Collections.<String, Map<String,Slice>>emptyMap());}diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.javaindex 634747be41e..9f25b0b96f2 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java@@ -17,7 +17,6 @@ package org.apache.solr.common.cloud;* limitations under the License.*/-import java.io.IOException;import java.util.concurrent.CountDownLatch;import java.util.concurrent.TimeoutException;@@ -83,7 +82,7 @@ class ConnectionManager implements Watcher {new ZkClientConnectionStrategy.ZkUpdate() {@Overridepublic void update(SolrZooKeeper keeper)- throws InterruptedException, TimeoutException, IOException {+ throws InterruptedException, TimeoutException {synchronized (connectionStrategy) {waitForConnected(SolrZkClient.DEFAULT_CLIENT_CONNECT_TIMEOUT);client.updateKeeper(keeper);@@ -118,7 +117,7 @@ class ConnectionManager implements Watcher {}public synchronized void waitForConnected(long waitForConnection)- throws InterruptedException, TimeoutException, IOException {+ throws InterruptedException, TimeoutException {long expire = System.currentTimeMillis() + waitForConnection;long left = waitForConnection;while (!connected && left > 0) {diff --git a/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java b/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.javaindex 87b5c1cb039..b0a8e169443 100755--- a/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java@@ -73,7 +73,7 @@ public abstract class ContentStreamBase implements ContentStream{private final URL url;- public URLStream( URL url ) throws IOException {+ public URLStream( URL url ) {this.url = url;sourceInfo = "url";}@@ -95,7 +95,7 @@ public abstract class ContentStreamBase implements ContentStream{private final File file;- public FileStream( File f ) throws IOException {+ public FileStream( File f ) {file = f;contentType = null; // ??diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java b/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.javaindex b39300b1d64..99344121e85 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java@@ -17,7 +17,6 @@package org.apache.solr.client.solrj;-import java.io.IOException;import java.util.ArrayList;import java.util.List;@@ -62,7 +61,7 @@ public abstract class LargeVolumeTestBase extends SolrJettyTestBaselog.info("done");}- private void query(int count) throws SolrServerException, IOException {+ private void query(int count) throws SolrServerException {SolrServer gserver = this.getSolrServer();SolrQuery query = new SolrQuery("*:*");QueryResponse response = gserver.query(query);diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.javaindex fc84e3ad3dc..476b6d4dd2d 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java@@ -540,8 +540,7 @@ abstract public class SolrExampleTests extends SolrJettyTestBase}private static Field getCUSSExceptionField(Object cs)- throws SecurityException, NoSuchFieldException, IllegalArgumentException,- IllegalAccessException {+ throws SecurityException, NoSuchFieldException, IllegalArgumentException {Field field = cs.getClass().getDeclaredField("lastError");field.setAccessible(true);return field;diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.javaindex a8946e13591..9dfb3c0bb94 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java@@ -54,13 +54,13 @@ public class TestLBHttpSolrServer extends LuceneTestCase {static String savedFactory;@BeforeClass- public static void beforeClass() throws Exception {+ public static void beforeClass() {savedFactory = System.getProperty("solr.DirectoryFactory");System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockFSDirectoryFactory");}@AfterClass- public static void afterClass() throws Exception {+ public static void afterClass() {if (savedFactory == null) {System.clearProperty("solr.directoryFactory");} else {diff --git a/solr/test-framework/src/java/org/apache/solr/JSONTestUtil.java b/solr/test-framework/src/java/org/apache/solr/JSONTestUtil.javaindex de38a032735..df02010c5c4 100644--- a/solr/test-framework/src/java/org/apache/solr/JSONTestUtil.java+++ b/solr/test-framework/src/java/org/apache/solr/JSONTestUtil.java@@ -87,7 +87,7 @@ public class JSONTestUtil {* @param expected expected JSON Object* @param delta tollerance allowed in comparing float/double values*/- public static String matchObj(String path, Object input, Object expected, double delta) throws Exception {+ public static String matchObj(String path, Object input, Object expected, double delta) {CollectionTester tester = new CollectionTester(input,delta);boolean reversed = path.startsWith("!");String positivePath = reversed ? path.substring(1) : path;diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.javaindex c7988bf6f68..a2ec882fce1 100755--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java@@ -67,7 +67,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {@BeforeClass@SuppressWarnings("unused")- private static void beforeClass() throws Exception {+ private static void beforeClass() {setupLogging();startTrackingSearchers();startTrackingZkClients();@@ -325,7 +325,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {log.info("####initCore end");}- public static void createCore() throws Exception {+ public static void createCore() {solrConfig = TestHarness.createConfig(testSolrHome, getSolrConfigFile());h = new TestHarness( dataDir.getAbsolutePath(),solrConfig,@@ -356,7 +356,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {* to delete dataDir, unless the system property "solr.test.leavedatadir"* is set.*/- public static void deleteCore() throws Exception {+ public static void deleteCore() {log.info("###deleteCore" );if (h != null) { h.close(); }if (dataDir != null) {diff --git a/solr/test-framework/src/java/org/apache/solr/util/AbstractSolrTestCase.java b/solr/test-framework/src/java/org/apache/solr/util/AbstractSolrTestCase.javaindex d188d171b2b..6d317741ca8 100644--- a/solr/test-framework/src/java/org/apache/solr/util/AbstractSolrTestCase.java+++ b/solr/test-framework/src/java/org/apache/solr/util/AbstractSolrTestCase.java@@ -105,12 +105,12 @@ public abstract class AbstractSolrTestCase extends LuceneTestCase {RuleChain.outerRule(new SystemPropertiesRestoreRule());@BeforeClass- public static void beforeClassAbstractSolrTestCase() throws Exception {+ public static void beforeClassAbstractSolrTestCase() {SolrTestCaseJ4.startTrackingSearchers();}@AfterClass- public static void afterClassAbstractSolrTestCase() throws Exception {+ public static void afterClassAbstractSolrTestCase() {SolrTestCaseJ4.endTrackingSearchers();}@@ -458,7 +458,7 @@ public abstract class AbstractSolrTestCase extends LuceneTestCase {}/** @see SolrTestCaseJ4#getFile */- public static File getFile(String name) throws IOException {+ public static File getFile(String name) {return SolrTestCaseJ4.getFile(name);}}diff --git a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.javaindex 82260c10024..946eac74cab 100644--- a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java+++ b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java@@ -294,7 +294,7 @@ public class TestHarness {* @see LocalSolrQueryRequest*/public String validateQuery(SolrQueryRequest req, String... tests)- throws IOException, Exception {+ throws Exception {String res = query(req);return validateXPath(res, tests);@@ -309,7 +309,7 @@ public class TestHarness {* @exception IOException if there is a problem writing the XML* @see LocalSolrQueryRequest*/- public String query(SolrQueryRequest req) throws IOException, Exception {+ public String query(SolrQueryRequest req) throws Exception {return query(req.getParams().get(CommonParams.QT), req);}@@ -323,7 +323,7 @@ public class TestHarness {* @exception IOException if there is a problem writing the XML* @see LocalSolrQueryRequest*/- public String query(String handler, SolrQueryRequest req) throws IOException, Exception {+ public String query(String handler, SolrQueryRequest req) throws Exception {try {SolrQueryResponse rsp = new SolrQueryResponse();SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req, rsp));