Skip to content

Commit b7f52b2

Browse files
committed
Commented code cleanup
1 parent 30d94ce commit b7f52b2

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

logstash-core/src/main/java/org/logstash/common/BufferedTokenizer.java

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020

2121
import java.util.Iterator;
2222
import java.util.NoSuchElementException;
23-
import java.util.function.BiFunction;
2423
import java.util.function.IntPredicate;
2524

2625
public class BufferedTokenizer {
2726

2827
private final DataSplitter dataSplitter;
2928
private final Iterable<String> iterable;
30-
// private Integer sizeLimit;
3129

3230
static abstract class IteratorDecorator<T> implements Iterator<T> {
3331
protected final Iterator<String> iterator;
@@ -42,29 +40,11 @@ public boolean hasNext() {
4240
}
4341
}
4442

45-
// static class ValueLimitIteratorDecorator extends IteratorDecorator<String> {
46-
// private final int limit;
47-
//
48-
// ValueLimitIteratorDecorator(Iterator<String> iterator, int sizeLimit) {
49-
// super(iterator);
50-
// this.limit = sizeLimit;
51-
// }
52-
//
53-
// @Override
54-
// public String next() {
55-
// String value = iterator.next();
56-
// if (value.length() > limit) {
57-
// throw new IllegalStateException("input buffer full, consumed token which exceeded the sizeLimit " + limit);
58-
// }
59-
// return value;
60-
// }
61-
// }
62-
6343
static class DataSplitter implements Iterator<String> {
6444
private final String separator;
6545
private final IntPredicate sizeChecker;
66-
private int currentIdx = 0;
6746
private final StringBuilder accumulator = new StringBuilder();
47+
private int currentIdx = 0;
6848
private boolean dropNextPartialFragments = false;
6949

7050
DataSplitter(String separator) {
@@ -147,7 +127,6 @@ public BufferedTokenizer() {
147127
public BufferedTokenizer(String separator) {
148128
this.dataSplitter = new DataSplitter(separator);
149129
this.iterable = () -> dataSplitter;
150-
// this.iterable = setupIterable();
151130
}
152131

153132
public BufferedTokenizer(String separator, int sizeLimit) {
@@ -156,9 +135,7 @@ public BufferedTokenizer(String separator, int sizeLimit) {
156135
}
157136

158137
this.dataSplitter = new DataSplitter(separator, tokenSize -> tokenSize > sizeLimit);
159-
// this.sizeLimit = sizeLimit;
160138
this.iterable = () -> dataSplitter;
161-
// this.iterable = setupIterable();
162139
}
163140

164141
public Iterable<String> extract(String data) {
@@ -167,16 +144,6 @@ public Iterable<String> extract(String data) {
167144
return iterable;
168145
}
169146

170-
// private Iterable<String> setupIterable() {
171-
// return () -> {
172-
// Iterator<String> returnedIterator = dataSplitter;
173-
// if (sizeLimit != null) {
174-
// returnedIterator = new ValueLimitIteratorDecorator(returnedIterator, sizeLimit);
175-
// }
176-
// return returnedIterator;
177-
// };
178-
// }
179-
180147
public String flush() {
181148
return dataSplitter.flush();
182149
}

0 commit comments

Comments
 (0)