mirror of https://github.com/apache/lucene.git
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:
parent
041f9077c2
commit
02b8907124
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -895,7 +895,7 @@ public class DocTermOrds implements Accountable {
|
|||
try {
|
||||
return getOrdTermsEnum(reader);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -113,7 +113,7 @@ public class FileDictionary implements Dictionary {
|
|||
try {
|
||||
return new FileIterator();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2681,7 +2681,7 @@ public abstract class BaseDocValuesFormatTestCase extends BaseIndexFileFormatTes
|
|||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -103,7 +103,7 @@ public class RegexRulesPasswordProvider implements PasswordProvider {
|
|||
}
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return rules;
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ public class AnalyzingInfixLookupFactory extends LookupFactory {
|
|||
}
|
||||
};
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue