SOLR-1660 -- CapitalizationFilter crashes if you use the maxWordCountOption

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@891596 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-12-17 09:19:06 +00:00
parent 8b450730d3
commit 3d3d390db9
2 changed files with 4 additions and 0 deletions

View File

@ -142,6 +142,9 @@ Bug Fixes
* SOLR-1651: Fixed Incorrect dataimport handler package name in SolrResourceLoader
(Akshay Ukey via shalin)
* SOLR-1660: CapitalizationFilter crashes if you use the maxWordCountOption
(Robert Muir via shalin)
Other Changes
----------------------

View File

@ -206,6 +206,7 @@ class CapitalizationFilter extends TokenFilter {
char[] backup = null;
if (factory.maxWordCount < CapitalizationFilterFactory.DEFAULT_MAX_WORD_COUNT) {
//make a backup in case we exceed the word count
backup = new char[termBufferLength];
System.arraycopy(termBuffer, 0, backup, 0, termBufferLength);
}
if (termBufferLength < factory.maxTokenLength) {