From 642936382b388b6d7574c21f04909abb42477c9d Mon Sep 17 00:00:00 2001 From: rama-huawei Date: Thu, 21 Sep 2017 12:04:26 +0530 Subject: Removed useless parentheses Added the diamond symbol on RHS side Issue-ID: POLICY-239 Change-Id: I6f8516d4beedd94f4ff8801d51d368f436fe570c Signed-off-by: rama-huawei --- .../policy/drools/event/comm/bus/UebTopicSourceFactory.java | 10 +++++----- .../policy/drools/event/comm/bus/internal/BusPublisher.java | 9 +++++---- .../event/comm/bus/internal/SingleThreadedBusTopicSource.java | 6 +++--- .../onap/policy/drools/event/comm/bus/internal/TopicBase.java | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) (limited to 'policy-endpoints/src/main/java/org/onap') diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSourceFactory.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSourceFactory.java index d84ef355..6f3bd350 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSourceFactory.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSourceFactory.java @@ -153,7 +153,7 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory { * UEB Topic Name Index */ protected HashMap uebTopicSources = - new HashMap(); + new HashMap<>(); /** * {@inheritDoc} @@ -209,9 +209,9 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory { logger.info("{}: no topic for UEB Source", this); return new ArrayList(); } - List readTopicList = new ArrayList(Arrays.asList(readTopics.split("\\s*,\\s*"))); + List readTopicList = new ArrayList<>(Arrays.asList(readTopics.split("\\s*,\\s*"))); - List newUebTopicSources = new ArrayList(); + List newUebTopicSources = new ArrayList<>(); synchronized(this) { for (String topic: readTopicList) { if (this.uebTopicSources.containsKey(topic)) { @@ -228,7 +228,7 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory { continue; } - List serverList = new ArrayList(Arrays.asList(servers.split("\\s*,\\s*"))); + List serverList = new ArrayList<>(Arrays.asList(servers.split("\\s*,\\s*"))); String apiKey = properties.getProperty(PolicyProperties.PROPERTY_UEB_SOURCE_TOPICS + "." + topic + @@ -378,7 +378,7 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory { @Override public synchronized List inventory() { List readers = - new ArrayList(this.uebTopicSources.values()); + new ArrayList<>(this.uebTopicSources.values()); return readers; } diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusPublisher.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusPublisher.java index 46d6b60f..10bc8325 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusPublisher.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusPublisher.java @@ -183,7 +183,7 @@ public interface BusPublisher { if (servers == null || servers.isEmpty()) throw new IllegalArgumentException("No DMaaP servers or DME2 partner provided"); - ArrayList dmaapServers = new ArrayList(); + ArrayList dmaapServers = new ArrayList<>(); if(useHttps){ for (String server: servers) { dmaapServers.add(server + ":3905"); @@ -205,7 +205,7 @@ public interface BusPublisher { this.publisher.setProtocolFlag(ProtocolTypeConstants.AAF_AUTH.getValue()); } else if (protocol == ProtocolTypeConstants.DME2) { - ArrayList dmaapServers = new ArrayList(); + ArrayList dmaapServers = new ArrayList<>(); dmaapServers.add("0.0.0.0:3904"); this.publisher = @@ -377,8 +377,9 @@ public interface BusPublisher { props.setProperty("TransportType", "DME2"); props.setProperty("MethodType", "POST"); - for (String key : additionalProps.keySet()) { - String value = additionalProps.get(key); + for (Map.Entry entry : additionalProps.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); if (value != null) props.setProperty(key, value); diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java index 52438381..b7df8ca3 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java @@ -87,7 +87,7 @@ public abstract class SingleThreadedBusTopicSource /** * All my subscribers for new message notifications */ - protected final ArrayList topicListeners = new ArrayList(); + protected final ArrayList topicListeners = new ArrayList<>(); /** @@ -168,10 +168,10 @@ public abstract class SingleThreadedBusTopicSource @Override public void unregister(TopicListener topicListener) { - boolean stop = false; + boolean stop; synchronized (this) { super.unregister(topicListener); - stop = (this.topicListeners.isEmpty()); + stop = this.topicListeners.isEmpty(); } if (stop) { diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/TopicBase.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/TopicBase.java index 0c8bf6a6..b1b29808 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/TopicBase.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/TopicBase.java @@ -49,7 +49,7 @@ public abstract class TopicBase implements Topic { /** * event cache */ - protected CircularFifoQueue recentEvents = new CircularFifoQueue(10); + protected CircularFifoQueue recentEvents = new CircularFifoQueue<>(10); /** * Am I running? @@ -71,7 +71,7 @@ public abstract class TopicBase implements Topic { /** * All my subscribers for new message notifications */ - protected final ArrayList topicListeners = new ArrayList(); + protected final ArrayList topicListeners = new ArrayList<>(); /** * Instantiates a new Topic Base -- cgit 1.2.3-korg