Fix compilation error peculiar to eclipse2018-09 (#34798)

Fix compilation error peculiar to eclipse2018-09.
Added generics to make eclipse compiler happy
This commit is contained in:
markharwood 2018-10-24 16:58:31 +01:00 committed by GitHub
parent d73768f812
commit f7a6fb288f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -1126,9 +1126,11 @@ public class IndicesAndAliasesResolverTests extends ESTestCase {
public void testRemotableRequestsAllowRemoteIndices() {
IndicesOptions options = IndicesOptions.fromOptions(true, false, false, false);
Tuple<TransportRequest, String> tuple = randomFrom(
new Tuple<>(new SearchRequest("remote:foo").indicesOptions(options), SearchAction.NAME),
new Tuple<>(new FieldCapabilitiesRequest().indices("remote:foo").indicesOptions(options), FieldCapabilitiesAction.NAME),
new Tuple<>(new GraphExploreRequest().indices("remote:foo").indicesOptions(options), GraphExploreAction.NAME)
new Tuple<TransportRequest, String>(new SearchRequest("remote:foo").indicesOptions(options), SearchAction.NAME),
new Tuple<TransportRequest, String>(new FieldCapabilitiesRequest().indices("remote:foo").indicesOptions(options),
FieldCapabilitiesAction.NAME),
new Tuple<TransportRequest, String>(new GraphExploreRequest().indices("remote:foo").indicesOptions(options),
GraphExploreAction.NAME)
);
final TransportRequest request = tuple.v1();
ResolvedIndices resolved = resolveIndices(request, buildAuthorizedIndices(user, tuple.v2()));
@ -1143,9 +1145,9 @@ public class IndicesAndAliasesResolverTests extends ESTestCase {
public void testNonRemotableRequestDoesNotAllowRemoteIndices() {
IndicesOptions options = IndicesOptions.fromOptions(true, false, false, false);
Tuple<TransportRequest, String> tuple = randomFrom(
new Tuple<>(new CloseIndexRequest("remote:foo").indicesOptions(options), CloseIndexAction.NAME),
new Tuple<>(new DeleteIndexRequest("remote:foo").indicesOptions(options), DeleteIndexAction.NAME),
new Tuple<>(new PutMappingRequest("remote:foo").indicesOptions(options), PutMappingAction.NAME)
new Tuple<TransportRequest, String>(new CloseIndexRequest("remote:foo").indicesOptions(options), CloseIndexAction.NAME),
new Tuple<TransportRequest, String>(new DeleteIndexRequest("remote:foo").indicesOptions(options), DeleteIndexAction.NAME),
new Tuple<TransportRequest, String>(new PutMappingRequest("remote:foo").indicesOptions(options), PutMappingAction.NAME)
);
IndexNotFoundException e = expectThrows(IndexNotFoundException.class,
() -> resolveIndices(tuple.v1(), buildAuthorizedIndices(user, tuple.v2())).getLocal());
@ -1155,9 +1157,9 @@ public class IndicesAndAliasesResolverTests extends ESTestCase {
public void testNonRemotableRequestDoesNotAllowRemoteWildcardIndices() {
IndicesOptions options = IndicesOptions.fromOptions(randomBoolean(), true, true, true);
Tuple<TransportRequest, String> tuple = randomFrom(
new Tuple<>(new CloseIndexRequest("*:*").indicesOptions(options), CloseIndexAction.NAME),
new Tuple<>(new DeleteIndexRequest("*:*").indicesOptions(options), DeleteIndexAction.NAME),
new Tuple<>(new PutMappingRequest("*:*").indicesOptions(options), PutMappingAction.NAME)
new Tuple<TransportRequest, String>(new CloseIndexRequest("*:*").indicesOptions(options), CloseIndexAction.NAME),
new Tuple<TransportRequest, String>(new DeleteIndexRequest("*:*").indicesOptions(options), DeleteIndexAction.NAME),
new Tuple<TransportRequest, String>(new PutMappingRequest("*:*").indicesOptions(options), PutMappingAction.NAME)
);
final ResolvedIndices resolved = resolveIndices(tuple.v1(), buildAuthorizedIndices(user, tuple.v2()));
assertNoIndices((IndicesRequest.Replaceable) tuple.v1(), resolved);