ListEndpoints fix 54/101654/1
authorMatej Babej <matej.babej@tieto.com>
Tue, 11 Feb 2020 13:23:17 +0000 (14:23 +0100)
committerMatej Babej <matej.babej@tieto.com>
Thu, 13 Feb 2020 08:31:24 +0000 (09:31 +0100)
Fixing 4 code smells

Issue-ID: AAI-2794
Change-Id: Ica204021dd343ec7deac01587287e361efda4643
Signed-off-by: Matej Babej <matej.babej@tieto.com>
aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java

index aed61e7..dcfd58a 100644 (file)
@@ -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<String> endpoints = new ArrayList<>();
-    private Map<String, String> endpointToLogicalName = new HashMap<String, String>();
+    private Map<String, String> 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<String> 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");
         }
     }