Skip to content

Commit 72c2d61

Browse files
committed
Fixed license headers
1 parent 12e7d68 commit 72c2d61

File tree

6 files changed

+45
-24
lines changed

6 files changed

+45
-24
lines changed

logstash-core/benchmarks/src/main/java/org/logstash/benchmark/BufferedTokenizerBenchmark.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
package org.logstash.benchmark;
221

322
import org.logstash.common.BufferedTokenizer;

logstash-core/lib/logstash/file_watch.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

logstash-core/lib/logstash/util.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# under the License.
1717

1818
require "logstash/environment"
19-
require "logstash/file_watch"
2019

2120
module LogStash::Util
2221
UNAME = case RbConfig::CONFIG["host_os"]

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

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
package org.logstash.common;
220

321
import java.util.Iterator;
@@ -120,15 +138,12 @@ public Iterable<String> extract(String data) {
120138
}
121139

122140
private Iterable<String> setupIterable() {
123-
return new Iterable<String>() {
124-
@Override
125-
public Iterator<String> iterator() {
126-
Iterator<String> returnedIterator = dataSplitter;
127-
if (sizeLimit != null) {
128-
returnedIterator = new ValueLimitIteratorDecorator(returnedIterator, sizeLimit);
129-
}
130-
return returnedIterator;
141+
return () -> {
142+
Iterator<String> returnedIterator = dataSplitter;
143+
if (sizeLimit != null) {
144+
returnedIterator = new ValueLimitIteratorDecorator(returnedIterator, sizeLimit);
131145
}
146+
return returnedIterator;
132147
};
133148
}
134149

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,12 @@ public IRubyObject extract(final ThreadContext context, IRubyObject data) {
8383
Iterable<String> extractor = tokenizer.extract(data.asJavaString());
8484

8585
// return an iterator that does the encoding conversion
86-
IRubyObject rubyIterable = RubyUtil.toRubyObject(new Iterable<CharSequence>() {
86+
return RubyUtil.toRubyObject((Iterable<CharSequence>) () -> new BufferedTokenizer.IteratorDecorator<>(extractor.iterator()) {
8787
@Override
88-
public Iterator<CharSequence> iterator() {
89-
return new BufferedTokenizer.IteratorDecorator<>(extractor.iterator()) {
90-
@Override
91-
public CharSequence next() {
92-
return toEncodedRubyString(context, iterator.next());
93-
}
94-
};
88+
public CharSequence next() {
89+
return toEncodedRubyString(context, iterator.next());
9590
}
9691
});
97-
98-
return rubyIterable;
9992
}
10093

10194
private RubyString toEncodedRubyString(ThreadContext context, String input) {

logstash-core/src/test/java/org/logstash/common/BufferedTokenizerTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
import org.junit.Test;
2424

2525
import java.util.ArrayList;
26-
import java.util.Arrays;
2726
import java.util.List;
2827

2928
import static org.junit.Assert.assertEquals;
3029
import static org.junit.Assert.assertTrue;
31-
import static org.junit.Assert.fail;
3230

3331
public final class BufferedTokenizerTest {
3432

0 commit comments

Comments
 (0)