mirror of https://github.com/apache/lucene.git
SOLR-839: in XmlQParserPlugin replace "UTF8" with StandardCharsets.UTF_8 as suggested by LUCENE-5560.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1724318 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e0679e028c
commit
4ca99387a3
|
@ -305,7 +305,7 @@ New Features
|
|||
</BooleanQuery>
|
||||
</Clause>
|
||||
</BooleanQuery>
|
||||
(Erik Hatcher, Karl Wettin, Daniel Collins, Nathan Visagan, Christine Poerschke)
|
||||
(Erik Hatcher, Karl Wettin, Daniel Collins, Nathan Visagan, Ahmet Arslan, Christine Poerschke)
|
||||
|
||||
Bug Fixes
|
||||
----------------------
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.apache.solr.search;
|
|||
*/
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.queryparser.xml.ParserException;
|
||||
|
@ -35,8 +35,6 @@ public class XmlQParserPlugin extends QParserPlugin {
|
|||
|
||||
private class XmlQParser extends QParser {
|
||||
|
||||
private final String contentEncoding = "UTF8";
|
||||
|
||||
public XmlQParser(String qstr, SolrParams localParams,
|
||||
SolrParams params, SolrQueryRequest req) {
|
||||
super(qstr, localParams, params, req);
|
||||
|
@ -52,9 +50,7 @@ public class XmlQParserPlugin extends QParserPlugin {
|
|||
final Analyzer analyzer = schema.getQueryAnalyzer();
|
||||
final SolrCoreParser solrParser = new SolrCoreParser(defaultField, analyzer, req);
|
||||
try {
|
||||
return solrParser.parse(new ByteArrayInputStream(qstr.getBytes(contentEncoding)));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new SyntaxError(e.getMessage() + " in " + req.toString());
|
||||
return solrParser.parse(new ByteArrayInputStream(qstr.getBytes(StandardCharsets.UTF_8)));
|
||||
} catch (ParserException e) {
|
||||
throw new SyntaxError(e.getMessage() + " in " + req.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue