Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Fix exception message typo and remove duplicate strings

Erik Hatcher2126cc24f3e4
diff --git a/solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java
index 610a043ca33..dd74fe9dc45 100644
--- a/solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java
@@ -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;
}