SOLR-1283: fix numRead counter that caused mark invalid exceptions

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1063920 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2011-01-26 23:40:08 +00:00
parent add8aecd99
commit 51dc4159e6
2 changed files with 2 additions and 1 deletions

View File

@ -101,6 +101,7 @@ public class HTMLStripCharFilter extends BaseCharFilter {
if (len>0) {
return pushed.charAt(len-1);
}
numRead++;
int ch = input.read();
push(ch);
return ch;

View File

@ -169,7 +169,7 @@ public class HTMLStripCharFilterTest extends LuceneTestCase {
public void testBufferOverflow() throws Exception {
StringBuilder testBuilder = new StringBuilder(HTMLStripCharFilter.DEFAULT_READ_AHEAD + 50);
testBuilder.append("ah<?> ");
testBuilder.append("ah<?> ??????");
appendChars(testBuilder, HTMLStripCharFilter.DEFAULT_READ_AHEAD + 500);
processBuffer(testBuilder.toString(), "Failed on pseudo proc. instr.");//processing instructions