Skip to content

Commit 07d8dc7

Browse files
committed
checkstyle
1 parent 364cdea commit 07d8dc7

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private class BuildNode {
103103
private final Map<String, BuildNode> children;
104104
private final boolean isFinalNode;
105105

106-
public BuildNode(boolean isFinalNode) {
106+
BuildNode(boolean isFinalNode) {
107107
children = new HashMap<>();
108108
this.isFinalNode = isFinalNode;
109109
}

libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import org.elasticsearch.test.ESTestCase;
1717

1818
import java.util.Arrays;
19-
import java.util.Collections;
20-
import java.util.HashSet;
2119
import java.util.stream.Collectors;
2220

2321
import static org.hamcrest.Matchers.equalTo;
@@ -151,8 +149,12 @@ public void testExclusiveFilters() throws Exception {
151149
assertResult(SAMPLE, "**.*2", false, "{'a':0,'b':true,'c':'c_value','d':[0,1,2],'e':[{'f1':'f1_value'}," +
152150
"{'g1':'g1_value'}],'h':{'i':{'j':{'k':{'l':'l_value'}}}}}");
153151

154-
assertResult(SAMPLE, "h.i.j.k.l,h.i.j.k.l.m", false, "{'a':0,'b':true,'c':'c_value','d':[0,1,2],'e':[{'f1':'f1_value','f2':'f2_value'}," +
155-
"{'g1':'g1_value','g2':'g2_value'}]}");
152+
assertResult(
153+
SAMPLE,
154+
"h.i.j.k.l,h.i.j.k.l.m",
155+
false,
156+
"{'a':0,'b':true,'c':'c_value','d':[0,1,2],'e':[{'f1':'f1_value','f2':'f2_value'}," + "{'g1':'g1_value','g2':'g2_value'}]}"
157+
);
156158

157159
assertResult(SAMPLE, "a,b,c,d,e.f1,e.f2,e.g1,e.g2,h.i.j.k.l", false, "");
158160
}
@@ -169,8 +171,14 @@ public void testExclusiveFiltersWithDots() throws Exception {
169171

170172
private void assertResult(String input, String filter, boolean inclusive, String expected) throws Exception {
171173
try (BytesStreamOutput os = new BytesStreamOutput()) {
172-
try (FilteringGeneratorDelegate generator = new FilteringGeneratorDelegate(JSON_FACTORY.createGenerator(os),
173-
new FilterPathBasedFilter(Arrays.asList(filter.split(",")).stream().collect(Collectors.toSet()), inclusive), true, true)) {
174+
try (
175+
FilteringGeneratorDelegate generator = new FilteringGeneratorDelegate(
176+
JSON_FACTORY.createGenerator(os),
177+
new FilterPathBasedFilter(Arrays.asList(filter.split(",")).stream().collect(Collectors.toSet()), inclusive),
178+
true,
179+
true
180+
)
181+
) {
174182
try (JsonParser parser = JSON_FACTORY.createParser(replaceQuotes(input))) {
175183
while (parser.nextToken() != null) {
176184
generator.copyCurrentStructure(parser);

0 commit comments

Comments
 (0)