SOLR-5019: don't modify original filter list

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1500903 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2013-07-08 19:39:42 +00:00
parent f092795fe9
commit 5b257ac4df
2 changed files with 6 additions and 3 deletions

View File

@ -265,6 +265,10 @@ Bug Fixes
* SOLR-4978: Time is stripped from datetime column when imported into Solr date field * SOLR-4978: Time is stripped from datetime column when imported into Solr date field
if convertType=true. (Bill Au, shalin) if convertType=true. (Bill Au, shalin)
* SOLR-5019: spurious ConcurrentModificationException when spell check component
was in use with filters. (yonik)
Optimizations Optimizations
---------------------- ----------------------

View File

@ -152,9 +152,8 @@ public class QueryComponent extends SearchComponent
String[] fqs = req.getParams().getParams(CommonParams.FQ); String[] fqs = req.getParams().getParams(CommonParams.FQ);
if (fqs!=null && fqs.length!=0) { if (fqs!=null && fqs.length!=0) {
List<Query> filters = rb.getFilters(); List<Query> filters = rb.getFilters();
if (filters==null) { // if filters already exists, make a copy instead of modifying the original
filters = new ArrayList<Query>(fqs.length); filters = filters == null ? new ArrayList<Query>(fqs.length) : new ArrayList<Query>(filters);
}
for (String fq : fqs) { for (String fq : fqs) {
if (fq != null && fq.trim().length()!=0) { if (fq != null && fq.trim().length()!=0) {
QParser fqp = QParser.getParser(fq, null, req); QParser fqp = QParser.getParser(fq, null, req);