From 5a928151f308602fb091a728c739c0aea2106c8b Mon Sep 17 00:00:00 2001 From: rama-huawei Date: Thu, 21 Sep 2017 14:56:51 +0530 Subject: Added diamond symbol on RHS Removed useless parentheses Issue-ID: POLICY-239 Change-Id: Icad445f49cc619d71f71ef913f2592d5c7ebf29c Signed-off-by: rama-huawei --- .../org/onap/policy/drools/healthcheck/HealthCheck.java | 5 +++-- .../drools/persistence/DroolsPersistenceProperties.java | 2 ++ .../policy/drools/http/client/HttpClientFactory.java | 8 ++++---- .../drools/http/server/HttpServletServerFactory.java | 16 ++++++++-------- .../drools/http/server/internal/JettyServletServer.java | 4 ++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java index 5cbcf555..cc6f02e0 100644 --- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java +++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java @@ -144,6 +144,7 @@ class HealthCheckMonitor implements HealthCheck { /** * {@inheritDoc} */ + @Override public Reports healthCheck() { Reports reports = new Reports(); reports.healthy = PolicyEngine.manager.isAlive(); @@ -152,8 +153,8 @@ class HealthCheckMonitor implements HealthCheck { engineReport.healthy = PolicyEngine.manager.isAlive(); engineReport.name = "PDP-D"; engineReport.url = "self"; - engineReport.code = (PolicyEngine.manager.isAlive()) ? 200 : 500; - engineReport.message = (PolicyEngine.manager.isAlive()) ? "alive" : "not alive"; + engineReport.code = PolicyEngine.manager.isAlive() ? 200 : 500; + engineReport.message = PolicyEngine.manager.isAlive() ? "alive" : "not alive"; reports.details.add(engineReport); for (HttpClient client : clients) { diff --git a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java index fabcbc03..1c935b0c 100644 --- a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java +++ b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java @@ -21,6 +21,8 @@ package org.onap.policy.drools.persistence; public class DroolsPersistenceProperties { + private DroolsPersistenceProperties() { + } /* * feature-session-persistence.properties parameter key values */ diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java b/policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java index aa0a8e6b..06aa4630 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java @@ -85,7 +85,7 @@ class IndexedHttpClientFactory implements HttpClientFactory { */ private static Logger logger = LoggerFactory.getLogger(IndexedHttpClientFactory.class); - protected HashMap clients = new HashMap(); + protected HashMap clients = new HashMap<>(); @Override public synchronized HttpClient build(String name, boolean https, boolean selfSignedCerts, @@ -108,7 +108,7 @@ class IndexedHttpClientFactory implements HttpClientFactory { @Override public synchronized ArrayList build(Properties properties) throws KeyManagementException, NoSuchAlgorithmException { - ArrayList clientList = new ArrayList(); + ArrayList clientList = new ArrayList<>(); String clientNames = properties.getProperty(PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES); if (clientNames == null || clientNames.isEmpty()) { @@ -116,7 +116,7 @@ class IndexedHttpClientFactory implements HttpClientFactory { } List clientNameList = - new ArrayList(Arrays.asList(clientNames.split("\\s*,\\s*"))); + new ArrayList<>(Arrays.asList(clientNames.split("\\s*,\\s*"))); for (String clientName : clientNameList) { String httpsString = properties.getProperty(PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." + @@ -189,7 +189,7 @@ class IndexedHttpClientFactory implements HttpClientFactory { @Override public synchronized List inventory() { - return new ArrayList(this.clients.values()); + return new ArrayList<>(this.clients.values()); } @Override diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java index 56e9ccdd..b6366d00 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java @@ -100,7 +100,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { /** * servers index */ - protected HashMap servers = new HashMap(); + protected HashMap servers = new HashMap<>(); @Override public synchronized HttpServletServer build(String name, String host, int port, @@ -122,7 +122,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { public synchronized ArrayList build(Properties properties) throws IllegalArgumentException { - ArrayList serviceList = new ArrayList(); + ArrayList serviceList = new ArrayList<>(); String serviceNames = properties.getProperty(PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES); if (serviceNames == null || serviceNames.isEmpty()) { @@ -131,7 +131,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { } List serviceNameList = - new ArrayList(Arrays.asList(serviceNames.split("\\s*,\\s*"))); + new ArrayList<>(Arrays.asList(serviceNames.split("\\s*,\\s*"))); for (String serviceName : serviceNameList) { String servicePortString = properties.getProperty(PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + @@ -206,14 +206,14 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { if (restClasses != null && !restClasses.isEmpty()) { List restClassesList = - new ArrayList(Arrays.asList(restClasses.split("\\s*,\\s*"))); + new ArrayList<>(Arrays.asList(restClasses.split("\\s*,\\s*"))); for (String restClass : restClassesList) service.addServletClass(restUriPath, restClass); } if (restPackages != null && !restPackages.isEmpty()) { List restPackageList = - new ArrayList(Arrays.asList(restPackages.split("\\s*,\\s*"))); + new ArrayList<>(Arrays.asList(restPackages.split("\\s*,\\s*"))); for (String restPackage : restPackageList) service.addServletPackage(restUriPath, restPackage); } @@ -236,7 +236,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { @Override public synchronized List inventory() { - return new ArrayList(this.servers.values()); + return new ArrayList<>(this.servers.values()); } @Override @@ -252,8 +252,8 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { @Override public synchronized void destroy() throws IllegalArgumentException, IllegalStateException { - List servers = this.inventory(); - for (HttpServletServer server: servers) { + List httpServletServers = this.inventory(); + for (HttpServletServer server: httpServletServers) { server.shutdown(); } diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java index 55d058f5..e0a46173 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java @@ -243,7 +243,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable } } - return (this.jettyServer.isRunning()); + return this.jettyServer.isRunning(); } } @@ -373,7 +373,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable public String toString() { StringBuilder builder = new StringBuilder(); builder.append("JettyServer [name=").append(name).append(", host=").append(host).append(", port=").append(port) - .append(", user=").append(user).append(", password=").append((password != null)).append(", contextPath=") + .append(", user=").append(user).append(", password=").append(password != null).append(", contextPath=") .append(contextPath).append(", jettyServer=").append(jettyServer).append(", context=").append(this.context) .append(", connector=").append(connector).append(", jettyThread=").append(jettyThread) .append("]"); -- cgit 1.2.3-korg