From 3d3d390db909c09aff7709c298774635efde0412 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Thu, 17 Dec 2009 09:19:06 +0000 Subject: [PATCH] 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 --- CHANGES.txt | 3 +++ .../org/apache/solr/analysis/CapitalizationFilterFactory.java | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 8e09f30cb39..3190879cc12 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 ---------------------- diff --git a/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java b/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java index 693ddec734b..1aa6b439398 100644 --- a/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java +++ b/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java @@ -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) {