From f9023e161b8af6bddcdea5f52c2644608e7aa8c8 Mon Sep 17 00:00:00 2001 From: Matej Babej Date: Tue, 11 Feb 2020 14:23:17 +0100 Subject: ListEndpoints fix Fixing 4 code smells Issue-ID: AAI-2794 Change-Id: Ica204021dd343ec7deac01587287e361efda4643 Signed-off-by: Matej Babej --- aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'aai-core/src/main/java') diff --git a/aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java b/aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java index aed61e7a..dcfd58a5 100644 --- a/aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java +++ b/aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java @@ -38,7 +38,6 @@ import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; import org.onap.aai.config.SpringContextAware; -import org.onap.aai.db.props.AAIProperties; import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.LoaderFactory; @@ -56,11 +55,11 @@ public class ListEndpoints { private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(ListEndpoints.class); - private final String start = "inventory"; - private final String[] blacklist = {"search", "aai-internal"}; + private static final String START = "inventory"; + private static final String[] blacklist = {"search", "aai-internal"}; private List endpoints = new ArrayList<>(); - private Map endpointToLogicalName = new HashMap(); + private Map endpointToLogicalName = new HashMap<>(); /** * The main method. @@ -97,11 +96,11 @@ public class ListEndpoints { Loader loader = SpringContextAware.getBean(LoaderFactory.class).createLoaderForVersion(ModelType.MOXY, version); try { - final Introspector start = loader.introspectorFromName(this.start); + final Introspector start = loader.introspectorFromName(this.START); Set startMap = new HashSet<>(); beginAudit(start, basePath + "/" + version, startMap); } catch (AAIUnknownObjectException e) { - throw new RuntimeException("Failed to find object " + this.start + ", cannot run ListEndpoints audit"); + throw new RuntimeException("Failed to find object " + this.START + ", cannot run ListEndpoints audit"); } } -- cgit 1.2.3-korg