Skip to content

Commit ff1e477

Browse files
committed
Switched tokenizer implementation's empty to consider also the unterminated token in the buffer
1 parent 5ca767e commit ff1e477

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: logstash-core/src/main/java/org/logstash/common/BufferedTokenizer.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ public String flush() {
120120
return flushed;
121121
}
122122

123+
// considered empty if caught up to the accumulator
124+
public synchronized boolean isBufferEmpty() {
125+
return currentIdx >= accumulator.length();
126+
}
127+
123128
@Override
124129
public synchronized String toString() {
125130
return "accumulator=" + accumulator + ", currentIdx=" + currentIdx;
@@ -171,6 +176,7 @@ public String toString() {
171176
}
172177

173178
public boolean isEmpty() {
174-
return !dataSplitter.hasNext();
179+
// return !dataSplitter.hasNext();
180+
return dataSplitter.isBufferEmpty();
175181
}
176182
}

0 commit comments

Comments
 (0)