From f104828c79f132688ee05555c309730e6ffc4186 Mon Sep 17 00:00:00 2001 From: burdziak Date: Wed, 21 Mar 2018 10:21:56 +0100 Subject: Fixes in ListEndpoints Change-Id: I2d67b7bc75da1c42f830368e75c5d166c310848b Issue-ID: AAI-911 Signed-off-by: burdziak --- .../src/main/java/org/onap/aai/audit/ListEndpoints.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 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 bfa8748c..52a014a5 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 @@ -53,8 +53,8 @@ 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 final static String start = "inventory"; + private final static String[] blacklist = { "search", "aai-internal" }; private List endpoints = new ArrayList<>(); private Map endpointToLogicalName = new HashMap(); @@ -99,20 +99,18 @@ public class ListEndpoints { String currentUri = ""; - if (!obj.getDbName().equals("inventory")) { + if (!obj.getDbName().equals(start)) { currentUri = uri + obj.getGenericURI(); } else { currentUri = uri; } - if (obj.getName().equals("relationship-data") || obj.getName().equals("related-to-property")) { + if ("relationship-data".equals(obj.getName()) || "related-to-property".equals(obj.getName())) { return; } if (!obj.isContainer()) { endpoints.add(currentUri); } - String dbName = obj.getDbName(); - populateLogicalName(obj, uri, currentUri); Set properties = obj.getProperties(); @@ -179,7 +177,7 @@ public class ListEndpoints { */ private void populateLogicalName(Introspector obj, String uri, String currentUri) { - if (obj.getDbName().equals("inventory") || currentUri.split("/").length <= 4 || currentUri.endsWith("relationship-list")) { + if (obj.getDbName().equals(start) || currentUri.split("/").length <= 4 || currentUri.endsWith("relationship-list")) { return; } @@ -251,7 +249,7 @@ public class ListEndpoints { List result = new ArrayList<>(); Pattern p = null; Matcher m = null; - if (!filterOut.equals("")) { + if (!filterOut.isEmpty()) { p = Pattern.compile(filterOut); m = null; } -- cgit 1.2.3-korg