From c712bf1a35dd7ea433fb4318ed91f2b314d19c72 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 26 Jul 2022 12:20:11 +0300 Subject: [PATCH] Use Java 11 construct for creating Map --- .../ContainerImageCapabilitiesUtil.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageCapabilitiesUtil.java b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageCapabilitiesUtil.java index d7591e4824036..6a42d6c13cc76 100644 --- a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageCapabilitiesUtil.java +++ b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageCapabilitiesUtil.java @@ -1,6 +1,5 @@ package io.quarkus.container.image.deployment; -import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Optional; @@ -11,14 +10,12 @@ public final class ContainerImageCapabilitiesUtil { - public final static Map CAPABILITY_TO_EXTENSION_NAME = new HashMap<>(); - static { - CAPABILITY_TO_EXTENSION_NAME.put(Capability.CONTAINER_IMAGE_JIB, "quarkus-container-image-jib"); - CAPABILITY_TO_EXTENSION_NAME.put(Capability.CONTAINER_IMAGE_DOCKER, "quarkus-container-image-docker"); - CAPABILITY_TO_EXTENSION_NAME.put(Capability.CONTAINER_IMAGE_S2I, "quarkus-container-image-s2i"); - CAPABILITY_TO_EXTENSION_NAME.put(Capability.CONTAINER_IMAGE_OPENSHIFT, "quarkus-container-image-openshift"); - CAPABILITY_TO_EXTENSION_NAME.put(Capability.CONTAINER_IMAGE_BUILDPACK, "quarkus-container-image-buildpack"); - } + public final static Map CAPABILITY_TO_EXTENSION_NAME = Map.of( + Capability.CONTAINER_IMAGE_JIB, "quarkus-container-image-jib", + Capability.CONTAINER_IMAGE_DOCKER, "quarkus-container-image-docker", + Capability.CONTAINER_IMAGE_S2I, "quarkus-container-image-s2i", + Capability.CONTAINER_IMAGE_OPENSHIFT, "quarkus-container-image-openshift", + Capability.CONTAINER_IMAGE_BUILDPACK, "quarkus-container-image-buildpack"); private ContainerImageCapabilitiesUtil() { }