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 --- .../policy/drools/http/client/HttpClientFactory.java | 8 ++++---- .../drools/http/server/HttpServletServerFactory.java | 16 ++++++++-------- .../drools/http/server/internal/JettyServletServer.java | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'policy-endpoints/src/main/java/org') 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