summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-service/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'sparkybe-onap-service/src/main/java/org')
-rw-r--r--sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java10
-rw-r--r--sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java6
-rw-r--r--sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java9
-rw-r--r--sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/NodeUtils.java2
4 files changed, 13 insertions, 14 deletions
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java
index 7c91cd2..8e9d2f5 100644
--- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java
+++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java
@@ -29,8 +29,8 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class ObjectIdCollection {
- protected ConcurrentHashMap<String, String> importedObjectIds =
- new ConcurrentHashMap<String, String>();
+ private ConcurrentHashMap<String, String> importedObjectIds =
+ new ConcurrentHashMap<>();
public Collection<String> getImportedObjectIds() {
return importedObjectIds.values();
@@ -58,11 +58,7 @@ public class ObjectIdCollection {
if (items == null) {
return;
}
-
- items.stream().forEach((item) -> {
- importedObjectIds.putIfAbsent(item, item);
- });
-
+ items.forEach(it -> importedObjectIds.putIfAbsent(it, it));
}
/**
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java
index 0bf00a3..df24a7f 100644
--- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java
+++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java
@@ -25,6 +25,8 @@ package org.onap.aai.sparky.util;
*/
public class ErrorUtil {
+ private ErrorUtil() {}
+
/**
* Extract stack trace elements.
*
@@ -46,8 +48,8 @@ public class ErrorUtil {
int numFramesToExtract = Math.min(maxNumberOfElementsToCapture, stackTraceElements.length);
- for (int x = 0; x < numFramesToExtract; x++) {
- sb.append(stackTraceElements[x]).append("\n");
+ for (int index = 0; index < numFramesToExtract; index++) {
+ sb.append(stackTraceElements[index]).append("\n");
}
}
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java
index e42aa8d..e3de990 100644
--- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java
+++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java
@@ -30,6 +30,8 @@ import org.json.XML;
*/
public class JsonXmlConverter {
+ private JsonXmlConverter() {}
+
/**
* Checks if is valid json.
*
@@ -56,10 +58,9 @@ public class JsonXmlConverter {
* @param jsonText the json text
* @return the string
*/
- public static String convertJsontoXml(String jsonText) {
+ public static String convertJsonToXml(String jsonText) {
JSONObject jsonObj = new JSONObject(jsonText);
- String xmlText = XML.toString(jsonObj);
- return xmlText;
+ return XML.toString(jsonObj);
}
/**
@@ -68,7 +69,7 @@ public class JsonXmlConverter {
* @param xmlText the xml text
* @return the string
*/
- public static String convertXmltoJson(String xmlText) {
+ public static String convertXmlToJson(String xmlText) {
JSONObject jsonObj = XML.toJSONObject(xmlText);
return jsonObj.toString();
}
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/NodeUtils.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/NodeUtils.java
index 8772afa..25aa8b4 100644
--- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/NodeUtils.java
+++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/NodeUtils.java
@@ -623,7 +623,7 @@ public class NodeUtils {
return null;
}
- return JsonXmlConverter.convertJsontoXml(jsonOutput);
+ return JsonXmlConverter.convertJsonToXml(jsonOutput);
}