aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-adapters-rest-interface/src/main/java/org
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2017-09-30 08:09:04 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-30 08:09:04 +0000
commit7aa3b1cf0edeae8c7564e71526930d4dfa09c545 (patch)
treeaa4294db36d62943e4a52be46bc9495f58789083 /adapters/mso-adapters-rest-interface/src/main/java/org
parentb68efe5ab7522f830bcdb5aea586aa195224fe9f (diff)
parent26606eb22e59fae9df5759ec5f53420a4bac8847 (diff)
Merge "Repalced StringBuffer with StringBuilder"
Diffstat (limited to 'adapters/mso-adapters-rest-interface/src/main/java/org')
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java4
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java7
2 files changed, 6 insertions, 5 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
index 6d3f8f7b1c..f51cb0dd64 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
@@ -55,7 +55,7 @@ public class MapDeserializer extends JsonDeserializer<Map<String, String>> {
ObjectMapper mapper = new ObjectMapper();
JsonNode tree = mapper.readTree(parser);
- Map<String, String> map = new LinkedHashMap<String, String>();
+ Map<String, String> map = new LinkedHashMap<>();
Iterator<JsonNode> iterator = tree.iterator();
while (iterator.hasNext()) {
@@ -71,4 +71,4 @@ public class MapDeserializer extends JsonDeserializer<Map<String, String>> {
return map;
}
-} \ No newline at end of file
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java
index 1db69f41ab..c2ea8242c3 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java
@@ -53,8 +53,9 @@ public class MapSerializer extends JsonSerializer<Map<String, String>> {
jsonGenerator.writeStartObject();
jsonGenerator.writeArrayFieldStart("entry");
- for (String key : map.keySet()) {
- String value = map.get(key);
+ for (Map.Entry<String,String> entry : map.entrySet()) {
+ String key = entry.getKey();
+ String value = entry.getValue();
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("key", key);
jsonGenerator.writeStringField("value", value);
@@ -64,4 +65,4 @@ public class MapSerializer extends JsonSerializer<Map<String, String>> {
jsonGenerator.writeEndArray();
jsonGenerator.writeEndObject();
}
-} \ No newline at end of file
+}