Skip to content

Commit b98d2bf

Browse files
author
Christoph Büscher
authored
Backporting Eclipse IDE fixes (#44332)
Backports two code changes needed for Eclipse IDEs compile for correct type inference. These changes are already on the 7.x branches but haven't been backported to 6.8 so far.
1 parent 57e9a87 commit b98d2bf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

server/src/test/java/org/elasticsearch/BuildTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ public void testSerialization() {
119119
EqualsHashCodeTestUtils.checkEqualsAndHashCode(new WriteableBuild(new Build(
120120
randomFrom(Build.Flavor.values()), randomFrom(Build.Type.values()),
121121
randomAlphaOfLength(6), randomAlphaOfLength(6), randomBoolean())),
122-
b -> copyWriteable(b, writableRegistry(), WriteableBuild::new, Version.CURRENT),
123-
b -> {
122+
// Note: the cast of the Copy- and MutateFunction is needed for some IDE (specifically Eclipse 4.10.0) to infer the right type
123+
(WriteableBuild b) -> copyWriteable(b, writableRegistry(), WriteableBuild::new, Version.CURRENT),
124+
(WriteableBuild b) -> {
124125
switch (randomIntBetween(1, 5)) {
125126
case 1:
126127
return new WriteableBuild(new Build(

x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/QuerierTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public void testAggSorting_Randomized() {
7575
for (int j = 0; j < noColumns; j++) {
7676
boolean order = randomBoolean();
7777
ordering[j] = order;
78-
tuples.add(new Tuple<>(j, order ? Comparator.naturalOrder() : Comparator.reverseOrder()));
78+
Comparator comp = order ? Comparator.naturalOrder() : Comparator.reverseOrder();
79+
tuples.add(new Tuple<>(j, comp));
7980
}
8081

8182
// Insert random no of documents (rows) with random 0/1 values for each field

0 commit comments

Comments
 (0)