diff options
author | rama-huawei <rama.subba.reddy.s@huawei.com> | 2017-09-21 12:04:26 +0530 |
---|---|---|
committer | Rama SubbaReddy <rama.subba.reddy.s@huawei.com> | 2017-09-21 12:53:58 +0000 |
commit | 642936382b388b6d7574c21f04909abb42477c9d (patch) | |
tree | 79927c7bf61e93abdafcad846bcf6bb32a8a13ea /policy-endpoints/src/main/java/org/onap | |
parent | e6c6ba356dba76737914ec559fb34f12f67011da (diff) |
Removed useless parentheses
Added the diamond symbol on RHS side
Issue-ID: POLICY-239
Change-Id: I6f8516d4beedd94f4ff8801d51d368f436fe570c
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap')
4 files changed, 15 insertions, 14 deletions
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<String, UebTopicSource> uebTopicSources = - new HashMap<String, UebTopicSource>(); + new HashMap<>(); /** * {@inheritDoc} @@ -209,9 +209,9 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory { logger.info("{}: no topic for UEB Source", this); return new ArrayList<UebTopicSource>(); } - List<String> readTopicList = new ArrayList<String>(Arrays.asList(readTopics.split("\\s*,\\s*"))); + List<String> readTopicList = new ArrayList<>(Arrays.asList(readTopics.split("\\s*,\\s*"))); - List<UebTopicSource> newUebTopicSources = new ArrayList<UebTopicSource>(); + List<UebTopicSource> newUebTopicSources = new ArrayList<>(); synchronized(this) { for (String topic: readTopicList) { if (this.uebTopicSources.containsKey(topic)) { @@ -228,7 +228,7 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory { continue; } - List<String> serverList = new ArrayList<String>(Arrays.asList(servers.split("\\s*,\\s*"))); + List<String> 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<UebTopicSource> inventory() { List<UebTopicSource> readers = - new ArrayList<UebTopicSource>(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<String> dmaapServers = new ArrayList<String>(); + ArrayList<String> 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<String> dmaapServers = new ArrayList<String>(); + ArrayList<String> 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<String,String> 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<TopicListener> topicListeners = new ArrayList<TopicListener>(); + protected final ArrayList<TopicListener> 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<String> recentEvents = new CircularFifoQueue<String>(10); + protected CircularFifoQueue<String> 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<TopicListener> topicListeners = new ArrayList<TopicListener>(); + protected final ArrayList<TopicListener> topicListeners = new ArrayList<>(); /** * Instantiates a new Topic Base |