Fixes compile error in Eclipse in ClusterRerouteRequestTests (#21400)

Before this change Eclipse (4.6.1) would show compile errors in `ClusterRerouteRequestTests` for the elements in `RANDOM_COMMAND_GENERATORS`. This seems to be because the eclipse compiler does not recognised that the elements in the list are all `Supplier`s of bjects that are subclasses of `AllocationCommand`.

This change fixes the problem by adding a generics hint to the `Arrays.toList()` call.
This commit is contained in:
Colin Goodheart-Smithe 2016-11-08 10:26:55 +00:00 committed by GitHub
parent cd34eed03e
commit 6614cc73cc
1 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,8 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueMillis;
*/
public class ClusterRerouteRequestTests extends ESTestCase {
private static final int ROUNDS = 30;
private final List<Supplier<AllocationCommand>> RANDOM_COMMAND_GENERATORS = unmodifiableList(Arrays.asList(
private final List<Supplier<AllocationCommand>> RANDOM_COMMAND_GENERATORS = unmodifiableList(
Arrays.<Supplier<AllocationCommand>> asList(
() -> new AllocateReplicaAllocationCommand(randomAsciiOfLengthBetween(2, 10), between(0, 1000),
randomAsciiOfLengthBetween(2, 10)),
() -> new AllocateEmptyPrimaryAllocationCommand(randomAsciiOfLengthBetween(2, 10), between(0, 1000),