From 85a60551b6cf1a89e6717c52ffd99570a0809ed5 Mon Sep 17 00:00:00 2001 From: shrek2000 Date: Mon, 8 Jan 2018 16:08:42 +0200 Subject: sonar fix - Stack Stack is thread safe. For this code block ArrayDeque is good enough. Issue-ID: SDC-888 Change-Id: Ieddb750ae08626ba73f1e5c92f630a0ba7fe447c Signed-off-by: shrek2000 --- .../src/main/java/org/openecomp/config/ConfigurationUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'common/openecomp-common-configuration-management') diff --git a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java index 8a12d0cfcb..e8dc16efb6 100644 --- a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java +++ b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/ConfigurationUtils.java @@ -50,7 +50,6 @@ import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.SortedSet; -import java.util.Stack; import java.util.TreeSet; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentLinkedQueue; @@ -64,10 +63,10 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; +import static com.google.common.collect.ImmutableMap.builder; import static org.openecomp.config.api.Hint.EXTERNAL_LOOKUP; import static org.openecomp.config.api.Hint.LATEST_LOOKUP; import static org.openecomp.config.api.Hint.NODE_SPECIFIC; -import static com.google.common.collect.ImmutableMap.*; /** * The type Configuration utils. @@ -982,7 +981,7 @@ public class ConfigurationUtils { * @return the configuration repository key */ public static String getConfigurationRepositoryKey(String[] array) { - Stack stack = new Stack<>(); + Deque stack = new ArrayDeque<>(); stack.push(Constants.DEFAULT_TENANT); for (String element : array) { stack.push(element); -- cgit 1.2.3-korg