LUCENE-6378: Fix all RuntimeExceptions to throw the underlying root cause

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1670453 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Varun Thacker 2015-03-31 19:54:37 +00:00
parent 041f9077c2
commit 02b8907124
13 changed files with 18 additions and 14 deletions

View File

@ -48,6 +48,10 @@ Optimizations
faster IndexWriter.deleteAll in that case (Robert Muir, Adrien
Grand, Mike McCandless)
Bug Fixes
* LUCENE-6378: Fix all RuntimeExceptions to throw the underlying root cause.
(Varun Thacker, Adrien Grand, Mike McCandless)
======================= Lucene 5.1.0 =======================
New Features

View File

@ -172,7 +172,7 @@ public class TestFieldsReader extends LuceneTestCase {
try {
i.seek(getFilePointer());
} catch (IOException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
return i;
}

View File

@ -215,7 +215,7 @@ public class RandomSamplingFacetsCollector extends FacetsCollector {
return new MatchingDocs(docs.context, new BitDocIdSet(sampleDocs), docs.totalHits, null);
} catch (IOException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}

View File

@ -895,7 +895,7 @@ public class DocTermOrds implements Accountable {
try {
return getOrdTermsEnum(reader);
} catch (IOException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}
}

View File

@ -145,7 +145,7 @@ public class DocumentValueSourceDictionary extends DocumentDictionary {
try {
currentWeightValues = weightsValueSource.getValues(new HashMap<String, Object>(), leaves.get(currentLeafIndex));
} catch (IOException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}
return currentWeightValues.longVal(docId - starts[subIndex]);

View File

@ -113,7 +113,7 @@ public class FileDictionary implements Dictionary {
try {
return new FileIterator();
} catch (IOException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}

View File

@ -2681,7 +2681,7 @@ public abstract class BaseDocValuesFormatTestCase extends BaseIndexFileFormatTes
}
}
} catch (Throwable e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}
};

View File

@ -103,7 +103,7 @@ public class RegexRulesPasswordProvider implements PasswordProvider {
}
is.close();
} catch (IOException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
return rules;
}

View File

@ -1494,7 +1494,7 @@ public class ExtendedDismaxQParser extends QParser {
try {
queryFields = DisMaxQParser.parseQueryFields(req.getSchema(), solrParams); // req.getSearcher() here causes searcher refcount imbalance
} catch (SyntaxError e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
// Phrase slop array
int pslop[] = new int[4];

View File

@ -99,7 +99,7 @@ public class DocumentExpressionDictionaryFactory extends DictionaryFactory {
try {
expression = JavascriptCompiler.compile(weightExpression);
} catch (ParseException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
SimpleBindings bindings = new SimpleBindings();
for (SortField sortField : sortFields) {

View File

@ -55,7 +55,7 @@ public class FileDictionaryFactory extends DictionaryFactory {
return new FileDictionary(new InputStreamReader(
core.getResourceLoader().openResource(sourceLocation), StandardCharsets.UTF_8), fieldDelimiter);
} catch (IOException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}

View File

@ -135,7 +135,7 @@ public class AnalyzingInfixLookupFactory extends LookupFactory {
}
};
} catch (IOException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}

View File

@ -518,7 +518,7 @@ public class SimplePostTool {
Thread.sleep(delay * 1000);
filesPosted++;
} catch (InterruptedException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}
return filesPosted;
@ -610,7 +610,7 @@ public class SimplePostTool {
} catch (IOException e) {
warn("Caught exception when trying to open connection to "+u+": "+e.getMessage());
} catch (InterruptedException e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
}
if(!subStack.isEmpty()) {
@ -1209,7 +1209,7 @@ public class SimplePostTool {
} catch (IOException e) {
warn("IOException opening URL "+url+": "+e.getMessage());
} catch (Exception e) {
throw new RuntimeException();
throw new RuntimeException(e);
}
return l;
}