Removed useless parentheses 27/14127/5
authorrama-huawei <rama.subba.reddy.s@huawei.com>
Thu, 21 Sep 2017 06:34:26 +0000 (12:04 +0530)
committerRama SubbaReddy <rama.subba.reddy.s@huawei.com>
Thu, 21 Sep 2017 12:53:58 +0000 (12:53 +0000)
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>
policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSourceFactory.java
policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusPublisher.java
policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java
policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/TopicBase.java

index d84ef35..6f3bd35 100644 (file)
@@ -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;
        }
 
index 46d6b60..10bc832 100644 (file)
@@ -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);
index 5243838..b7df8ca 100644 (file)
@@ -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) {             
index 0c8bf6a..b1b2980 100644 (file)
@@ -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