diff --git a/shield/src/main/java/org/elasticsearch/shield/action/authc/cache/TransportClearRealmCacheAction.java b/shield/src/main/java/org/elasticsearch/shield/action/authc/cache/TransportClearRealmCacheAction.java index 31f754865be..dd146f64bff 100644 --- a/shield/src/main/java/org/elasticsearch/shield/action/authc/cache/TransportClearRealmCacheAction.java +++ b/shield/src/main/java/org/elasticsearch/shield/action/authc/cache/TransportClearRealmCacheAction.java @@ -5,7 +5,6 @@ */ package org.elasticsearch.shield.action.authc.cache; -import com.google.common.collect.Lists; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.nodes.TransportNodesAction; @@ -20,6 +19,7 @@ import org.elasticsearch.shield.authc.support.CachingUsernamePasswordRealm; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicReferenceArray; @@ -42,7 +42,7 @@ public class TransportClearRealmCacheAction extends TransportNodesAction nodes = Lists.newArrayList(); + final List nodes = new ArrayList<>(); for (int i = 0; i < responses.length(); i++) { Object resp = responses.get(i); if (resp instanceof ClearRealmCacheResponse.Node) { diff --git a/shield/src/main/java/org/elasticsearch/shield/authc/Realms.java b/shield/src/main/java/org/elasticsearch/shield/authc/Realms.java index 1e6969544c8..0a6433f2067 100644 --- a/shield/src/main/java/org/elasticsearch/shield/authc/Realms.java +++ b/shield/src/main/java/org/elasticsearch/shield/authc/Realms.java @@ -5,7 +5,6 @@ */ package org.elasticsearch.shield.authc; -import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.component.AbstractLifecycleComponent; @@ -69,7 +68,7 @@ public class Realms extends AbstractLifecycleComponent implements Iterab protected List initRealms() { Settings realmsSettings = settings.getAsSettings("shield.authc.realms"); Set internalTypes = Sets.newHashSet(); - List realms = Lists.newArrayList(); + List realms = new ArrayList<>(); for (String name : realmsSettings.names()) { Settings realmSettings = realmsSettings.getAsSettings(name); String type = realmSettings.get("type"); diff --git a/shield/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java b/shield/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java index 41286309bb8..62c8504a680 100644 --- a/shield/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java +++ b/shield/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java @@ -381,7 +381,7 @@ public class ESUsersTool extends CliTool { Path file = FileUserRolesStore.resolveFile(esusersSettings, env); Map userRoles = FileUserRolesStore.parseFile(file, null); - List roles = Lists.newArrayList(); + List roles = new ArrayList<>(); if (userRoles.get(username) != null) { roles.addAll(Arrays.asList(userRoles.get(username))); } diff --git a/shield/src/main/java/org/elasticsearch/shield/authz/indicesresolver/DefaultIndicesAndAliasesResolver.java b/shield/src/main/java/org/elasticsearch/shield/authz/indicesresolver/DefaultIndicesAndAliasesResolver.java index b933b062b33..e233bf9c729 100644 --- a/shield/src/main/java/org/elasticsearch/shield/authz/indicesresolver/DefaultIndicesAndAliasesResolver.java +++ b/shield/src/main/java/org/elasticsearch/shield/authz/indicesresolver/DefaultIndicesAndAliasesResolver.java @@ -6,7 +6,6 @@ package org.elasticsearch.shield.authz.indicesresolver; import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.elasticsearch.action.AliasesRequest; import org.elasticsearch.action.CompositeIndicesRequest; @@ -98,7 +97,7 @@ public class DefaultIndicesAndAliasesResolver implements IndicesAndAliasesResolv } private List loadAuthorizedAliases(List authorizedIndices, MetaData metaData) { - List authorizedAliases = Lists.newArrayList(); + List authorizedAliases = new ArrayList<>(); SortedMap existingAliases = metaData.getAliasAndIndexLookup(); for (String authorizedIndex : authorizedIndices) { AliasOrIndex aliasOrIndex = existingAliases.get(authorizedIndex); @@ -110,7 +109,7 @@ public class DefaultIndicesAndAliasesResolver implements IndicesAndAliasesResolv } private List replaceWildcardsWithAuthorizedAliases(String[] aliases, List authorizedAliases) { - List finalAliases = Lists.newArrayList(); + List finalAliases = new ArrayList<>(); //IndicesAliasesRequest doesn't support empty aliases (validation fails) but GetAliasesRequest does (in which case empty means _all) boolean matchAllAliases = aliases.length == 0;