aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/pom.xml1
-rw-r--r--common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java4
-rw-r--r--common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java12
-rw-r--r--common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java4
-rw-r--r--common/src/main/java/org/openecomp/mso/utils/CheckResults.java2
-rw-r--r--common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java2
-rw-r--r--common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryTest.java4
7 files changed, 11 insertions, 18 deletions
diff --git a/common/pom.xml b/common/pom.xml
index 48518aea31..c83f7d344a 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -7,7 +7,6 @@
<version>1.2.0-SNAPSHOT</version>
</parent>
- <groupId>org.onap.so</groupId>
<artifactId>common</artifactId>
<name>MSO Common classes</name>
<description>MSO Common classes:- Logger</description>
diff --git a/common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java b/common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java
index 7b9c6a5166..b2b8d0aa33 100644
--- a/common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java
+++ b/common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java
@@ -162,8 +162,8 @@ public class MsoAlarmLogger implements ServletContextListener {
encoder.setPattern(logPattern);
encoder.setContext(context);
encoder.start();
- RollingFileAppender<ILoggingEvent> fileAppender=new RollingFileAppender<ILoggingEvent>();
- TimeBasedRollingPolicy<ILoggingEvent> rollingPolicy=new TimeBasedRollingPolicy<ILoggingEvent>();
+ RollingFileAppender<ILoggingEvent> fileAppender= new RollingFileAppender<>();
+ TimeBasedRollingPolicy<ILoggingEvent> rollingPolicy= new TimeBasedRollingPolicy<>();
rollingPolicy.setContext(context);
rollingPolicy.setFileNamePattern(msoAlarmFile + ".%d");
rollingPolicy.setParent(fileAppender);
diff --git a/common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java b/common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java
index 8da155fe08..ec0b54a14f 100644
--- a/common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java
+++ b/common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java
@@ -159,15 +159,9 @@ public class MsoJsonProperties extends AbstractMsoProperties {
@Override
public String toString() {
- StringBuilder response = new StringBuilder();
- response.append("Config file ").append(propertiesFileName).append("(Timer:").append(automaticRefreshInMinutes)
- .append("mins):").append(System.getProperty("line.separator"));
- response.append(this.jsonRootNode.toString());
- response.append(System.getProperty("line.separator"));
- response.append(System.getProperty("line.separator"));
- return response.toString();
-
+ return "Config file " + propertiesFileName + "(Timer:" + automaticRefreshInMinutes + "mins):" + System
+ .getProperty("line.separator") + this.jsonRootNode.toString() + System.getProperty("line.separator")
+ + System.getProperty("line.separator");
}
-
}
diff --git a/common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java b/common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java
index cf69cf92c8..3f81734796 100644
--- a/common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java
+++ b/common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java
@@ -78,7 +78,7 @@ public class MsoPropertiesFactory implements Serializable {
// Hardcode if nothing is received
prefixMsoPropertiesPath = "";
}
- msoPropertiesCache = new ConcurrentHashMap <String, MsoPropertiesParameters> ();
+ msoPropertiesCache = new ConcurrentHashMap<>();
}
private static final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock ();
@@ -268,7 +268,7 @@ public class MsoPropertiesFactory implements Serializable {
*/
public List <AbstractMsoProperties> getAllMsoProperties () {
- List <AbstractMsoProperties> resultList = new LinkedList <AbstractMsoProperties> ();
+ List <AbstractMsoProperties> resultList = new LinkedList<>();
rwl.readLock ().lock ();
try {
diff --git a/common/src/main/java/org/openecomp/mso/utils/CheckResults.java b/common/src/main/java/org/openecomp/mso/utils/CheckResults.java
index 75337f0cf1..ad0344d028 100644
--- a/common/src/main/java/org/openecomp/mso/utils/CheckResults.java
+++ b/common/src/main/java/org/openecomp/mso/utils/CheckResults.java
@@ -36,7 +36,7 @@ public class CheckResults {
private List <CheckResult> results;
public CheckResults () {
- results = new ArrayList <CheckResult> ();
+ results = new ArrayList<>();
}
public List <CheckResult> getResults () {
diff --git a/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java b/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java
index f038cbc851..a814c4ea9c 100644
--- a/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java
+++ b/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java
@@ -146,7 +146,7 @@ public class MsoPropertiesFactoryConcurrencyTest {
public final void testGetMsoProperties()
throws MsoPropertiesException, InterruptedException, ExecutionException, FileNotFoundException {
- List<Future<Integer>> list = new ArrayList<Future<Integer>>();
+ List<Future<Integer>> list = new ArrayList<>();
ExecutorService executor = Executors.newFixedThreadPool(20);
for (int i = 0; i <= 100000; i++) {
diff --git a/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryTest.java b/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryTest.java
index 7b559dfbcb..db58c5a49e 100644
--- a/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryTest.java
+++ b/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryTest.java
@@ -598,8 +598,8 @@ public class MsoPropertiesFactoryTest {
assertFalse(msoProperties.equals(msoProperties2));
assertTrue(msoProperties.equals(msoProperties));
assertFalse(msoProperties.equals(null));
- assertFalse(msoProperties.equals(new String()));
-
+ assertFalse(msoProperties.toString().isEmpty());
+
// Test a reload with timer set to 1 in PATH_MSO_JSON_PROP2
msoPropertiesFactory.changeMsoPropertiesFilePath(MSO_JSON_PROP_ID, PATH_MSO_JSON_PROP);