Help Eclipse infering lambda parameter types (#40747)

The Eclipse compiler (4.10, Photon) cannot build this test because it cannot
correctly infer the type arguments of the functions. Explicitely adding them
helps in this case.
This commit is contained in:
Christoph Büscher 2019-04-03 17:50:42 +02:00
parent 3844da318f
commit 89389197b3
1 changed files with 3 additions and 2 deletions

View File

@ -162,8 +162,9 @@ public class BuildTests extends ESTestCase {
EqualsHashCodeTestUtils.checkEqualsAndHashCode(new WriteableBuild(new Build( EqualsHashCodeTestUtils.checkEqualsAndHashCode(new WriteableBuild(new Build(
randomFrom(Build.Flavor.values()), randomFrom(Build.Type.values()), randomFrom(Build.Flavor.values()), randomFrom(Build.Type.values()),
randomAlphaOfLength(6), randomAlphaOfLength(6), randomBoolean(), randomAlphaOfLength(6))), randomAlphaOfLength(6), randomAlphaOfLength(6), randomBoolean(), randomAlphaOfLength(6))),
b -> copyWriteable(b, writableRegistry(), WriteableBuild::new, Version.CURRENT), // Note: the cast of the Copy- and MutateFunction is needed for some IDE (specifically Eclipse 4.10.0) to infer the right type
b -> { (WriteableBuild b) -> copyWriteable(b, writableRegistry(), WriteableBuild::new, Version.CURRENT),
(WriteableBuild b) -> {
switch (randomIntBetween(1, 6)) { switch (randomIntBetween(1, 6)) {
case 1: case 1:
return new WriteableBuild(new Build( return new WriteableBuild(new Build(