Index: modules/analysis/common/src/java/org/apache/lucene/analysis/en/KStemFilter.java =================================================================== --- modules/analysis/common/src/java/org/apache/lucene/analysis/en/KStemFilter.java (revision 1134263) +++ modules/analysis/common/src/java/org/apache/lucene/analysis/en/KStemFilter.java (working copy) @@ -55,8 +55,11 @@ char[] term = termAttribute.buffer(); int len = termAttribute.length(); if ((!keywordAtt.isKeyword()) && stemmer.stem(term, len)) { - char[] chars = stemmer.asString().toCharArray(); - termAttribute.copyBuffer(chars, 0, chars.length); + String result = stemmer.asString(); + int stemLen = result.length(); + termAttribute.resizeBuffer(stemLen); + termAttribute.setLength(stemLen); + result.getChars(0, stemLen, termAttribute.buffer(), 0); } return true;