summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2017-09-22 13:30:26 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-22 13:30:26 +0000
commit064fae794bb274284e32a289de46d60e867734b0 (patch)
tree625f8f109829b3119bf5be30ec6f3db2c5cace17
parent4c8c2b47bc9db02d829da185420ee4ae2f18b09b (diff)
parente6c6ba356dba76737914ec559fb34f12f67011da (diff)
Merge "Removed useless parentheses"
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmx.java7
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java5
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java12
3 files changed, 16 insertions, 8 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmx.java b/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmx.java
index d3cf2e9d..19f6afb4 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmx.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmx.java
@@ -31,16 +31,21 @@ public class PdpJmx implements PdpJmxMBean {
public static PdpJmx getInstance() {
return instance;
}
-
+
+ @Override
public long getUpdates(){
return updates.longValue();
}
+
+ @Override
public long getRulesFired(){
return actions.longValue();
}
+
public void updateOccured(){
updates.incrementAndGet();
}
+
public void ruleFired(){
actions.incrementAndGet();
}
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java b/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java
index ceb7049e..9136defb 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java
@@ -36,7 +36,10 @@ import org.slf4j.LoggerFactory;
public class PdpJmxListener {
public static final Logger logger = LoggerFactory.getLogger(PdpJmxListener.class);
-
+
+ private PdpJmxListener() {
+ }
+
public static void stop() {
final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
try {
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java
index d8aceca5..13808329 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java
@@ -217,7 +217,7 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
* DMaaP Topic Name Index
*/
protected HashMap<String, DmaapTopicSource> dmaapTopicSources =
- new HashMap<String, DmaapTopicSource>();
+ new HashMap<>();
/**
* {@inheritDoc}
@@ -322,11 +322,11 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
String readTopics = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS);
if (readTopics == null || readTopics.isEmpty()) {
logger.info("{}: no topic for DMaaP Source", this);
- return new ArrayList<DmaapTopicSource>();
+ return new ArrayList<>();
}
- List<String> readTopicList = new ArrayList<String>(Arrays.asList(readTopics.split("\\s*,\\s*")));
+ List<String> readTopicList = new ArrayList<>(Arrays.asList(readTopics.split("\\s*,\\s*")));
- List<DmaapTopicSource> dmaapTopicSource_s = new ArrayList<DmaapTopicSource>();
+ List<DmaapTopicSource> dmaapTopicSource_s = new ArrayList<>();
synchronized(this) {
for (String topic: readTopicList) {
if (this.dmaapTopicSources.containsKey(topic)) {
@@ -339,7 +339,7 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
PolicyProperties.PROPERTY_TOPIC_SERVERS_SUFFIX);
List<String> serverList;
- if (servers != null && !servers.isEmpty()) serverList = new ArrayList<String>(Arrays.asList(servers.split("\\s*,\\s*")));
+ if (servers != null && !servers.isEmpty()) serverList = new ArrayList<>(Arrays.asList(servers.split("\\s*,\\s*")));
else serverList = new ArrayList<>();
String apiKey = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
@@ -572,7 +572,7 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
@Override
public synchronized List<DmaapTopicSource> inventory() {
List<DmaapTopicSource> readers =
- new ArrayList<DmaapTopicSource>(this.dmaapTopicSources.values());
+ new ArrayList<>(this.dmaapTopicSources.values());
return readers;
}