mirror of https://github.com/apache/lucene.git
Fix exception message typo and remove duplicate strings
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1189719 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bcd8fc6522
commit
2126cc24f3
|
@ -345,19 +345,17 @@ public class DocumentAnalysisRequestHandler extends AnalysisRequestHandlerBase {
|
|||
*/
|
||||
private ContentStream extractSingleContentStream(SolrQueryRequest req) {
|
||||
Iterable<ContentStream> streams = req.getContentStreams();
|
||||
String exceptionMsg = "DocumentAnalysisRequestHandler expects a single content stream with documents to analyze";
|
||||
if (streams == null) {
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
|
||||
"DocumentAnlysisRequestHandler expects a single content stream with documents to analyze");
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, exceptionMsg);
|
||||
}
|
||||
Iterator<ContentStream> iter = streams.iterator();
|
||||
if (!iter.hasNext()) {
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
|
||||
"DocumentAnlysisRequestHandler expects a single content stream with documents to analyze");
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, exceptionMsg);
|
||||
}
|
||||
ContentStream stream = iter.next();
|
||||
if (iter.hasNext()) {
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
|
||||
"DocumentAnlysisRequestHandler expects a single content stream with documents to analyze");
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, exceptionMsg);
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue