diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2017-09-22 13:30:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-22 13:30:34 +0000 |
commit | b607cda1c5304b23ee9326cd24cae3f615813b10 (patch) | |
tree | ea369f5f73c7353645f11b4277e6b5cbbc6ec6d2 | |
parent | 064fae794bb274284e32a289de46d60e867734b0 (diff) | |
parent | 642936382b388b6d7574c21f04909abb42477c9d (diff) |
Merge "Removed useless parentheses"
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 |