summaryrefslogtreecommitdiffstats
path: root/controller-server/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'controller-server/src/main/java')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java3
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporter.java15
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/ControllerAuthorizationFilter.java5
4 files changed, 11 insertions, 16 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
index 1956a56a6a5..61226d51166 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
@@ -45,7 +45,6 @@ import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -646,7 +645,7 @@ public class InternalStepRunner implements StepRunner {
}
private void log(String... messages) {
- log(Arrays.asList(messages));
+ log(List.of(messages));
}
private void log(List<String> messages) {
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporter.java
index 2ae38fabb94..07680fc8b72 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporter.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporter.java
@@ -20,7 +20,6 @@ import com.yahoo.vespa.hosted.controller.rotation.RotationLock;
import java.time.Clock;
import java.time.Duration;
import java.time.Instant;
-import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -80,15 +79,15 @@ public class MetricsReporter extends Maintainer {
query += " AND hosted_system:" + system;
}
PartialNodeResult nodeResult = chefClient.partialSearchNodes(query,
- Arrays.asList(
+ List.of(
AttributeMapping.simpleMapping("fqdn"),
AttributeMapping.simpleMapping("ohai_time"),
- AttributeMapping.deepMapping("tenant", Arrays.asList("hosted", "owner", "tenant")),
- AttributeMapping.deepMapping("application", Arrays.asList("hosted", "owner", "application")),
- AttributeMapping.deepMapping("instance", Arrays.asList("hosted", "owner", "instance")),
- AttributeMapping.deepMapping("environment", Arrays.asList("hosted", "environment")),
- AttributeMapping.deepMapping("region", Arrays.asList("hosted", "region")),
- AttributeMapping.deepMapping("system", Arrays.asList("hosted", "system"))
+ AttributeMapping.deepMapping("tenant", List.of("hosted", "owner", "tenant")),
+ AttributeMapping.deepMapping("application", List.of("hosted", "owner", "application")),
+ AttributeMapping.deepMapping("instance", List.of("hosted", "owner", "instance")),
+ AttributeMapping.deepMapping("environment", List.of("hosted", "environment")),
+ AttributeMapping.deepMapping("region", List.of("hosted", "region")),
+ AttributeMapping.deepMapping("system", List.of("hosted", "system"))
));
// The above search will return a correct list if the system is CD. However for main, it will
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java
index ae1102e2cef..2f10dce0e0a 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java
@@ -39,9 +39,7 @@ import java.net.URI;
import java.security.cert.X509Certificate;
import java.time.Duration;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -60,7 +58,7 @@ public class ConfigServerRestExecutorImpl implements ConfigServerRestExecutor {
private static final Logger log = Logger.getLogger(ConfigServerRestExecutorImpl.class.getName());
private static final Duration PROXY_REQUEST_TIMEOUT = Duration.ofSeconds(10);
- private static final Set<String> HEADERS_TO_COPY = new HashSet<>(Arrays.asList("X-HTTP-Method-Override", "Content-Type"));
+ private static final Set<String> HEADERS_TO_COPY = Set.of("X-HTTP-Method-Override", "Content-Type");
private final ZoneRegistry zoneRegistry;
private final ServiceIdentityProvider sslContextProvider;
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/ControllerAuthorizationFilter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/ControllerAuthorizationFilter.java
index b8e868ed8a4..77e626509b3 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/ControllerAuthorizationFilter.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/ControllerAuthorizationFilter.java
@@ -17,8 +17,8 @@ import com.yahoo.vespa.athenz.api.AthenzUser;
import com.yahoo.vespa.athenz.client.zms.ZmsClientException;
import com.yahoo.vespa.hosted.controller.Controller;
import com.yahoo.vespa.hosted.controller.TenantController;
-import com.yahoo.vespa.hosted.controller.athenz.ApplicationAction;
import com.yahoo.vespa.hosted.controller.api.integration.athenz.AthenzClientFactory;
+import com.yahoo.vespa.hosted.controller.athenz.ApplicationAction;
import com.yahoo.vespa.hosted.controller.athenz.impl.ZmsClientFacade;
import com.yahoo.vespa.hosted.controller.tenant.AthenzTenant;
import com.yahoo.vespa.hosted.controller.tenant.Tenant;
@@ -30,7 +30,6 @@ import javax.ws.rs.ForbiddenException;
import javax.ws.rs.InternalServerErrorException;
import javax.ws.rs.NotAuthorizedException;
import javax.ws.rs.WebApplicationException;
-import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@@ -52,7 +51,7 @@ import static com.yahoo.vespa.hosted.controller.athenz.HostedAthenzIdentities.SC
@Provides("ControllerAuthorizationFilter")
public class ControllerAuthorizationFilter extends CorsRequestFilterBase {
- private static final List<Method> WHITELISTED_METHODS = Arrays.asList(GET, OPTIONS, HEAD);
+ private static final List<Method> WHITELISTED_METHODS = List.of(GET, OPTIONS, HEAD);
private static final Logger log = Logger.getLogger(ControllerAuthorizationFilter.class.getName());