mirror of https://github.com/apache/lucene.git
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:
parent
add8aecd99
commit
51dc4159e6
|
@ -101,6 +101,7 @@ public class HTMLStripCharFilter extends BaseCharFilter {
|
||||||
if (len>0) {
|
if (len>0) {
|
||||||
return pushed.charAt(len-1);
|
return pushed.charAt(len-1);
|
||||||
}
|
}
|
||||||
|
numRead++;
|
||||||
int ch = input.read();
|
int ch = input.read();
|
||||||
push(ch);
|
push(ch);
|
||||||
return ch;
|
return ch;
|
||||||
|
|
|
@ -169,7 +169,7 @@ public class HTMLStripCharFilterTest extends LuceneTestCase {
|
||||||
|
|
||||||
public void testBufferOverflow() throws Exception {
|
public void testBufferOverflow() throws Exception {
|
||||||
StringBuilder testBuilder = new StringBuilder(HTMLStripCharFilter.DEFAULT_READ_AHEAD + 50);
|
StringBuilder testBuilder = new StringBuilder(HTMLStripCharFilter.DEFAULT_READ_AHEAD + 50);
|
||||||
testBuilder.append("ah<?> ");
|
testBuilder.append("ah<?> ??????");
|
||||||
appendChars(testBuilder, HTMLStripCharFilter.DEFAULT_READ_AHEAD + 500);
|
appendChars(testBuilder, HTMLStripCharFilter.DEFAULT_READ_AHEAD + 500);
|
||||||
processBuffer(testBuilder.toString(), "Failed on pseudo proc. instr.");//processing instructions
|
processBuffer(testBuilder.toString(), "Failed on pseudo proc. instr.");//processing instructions
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue