Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / services / CsvServiceImpl.java
index c34bf4e..6ba1522 100644 (file)
@@ -165,7 +165,7 @@ public class CsvServiceImpl implements CsvService{
      * @throws IllegalAccessException
      * @throws InstantiationException
      */
-    private <T, E> T putJson(T json, String key, E values) throws IllegalAccessException, InstantiationException {
+    private <T, E> T putJson(T json, String key, E values) {
         if (json instanceof JSONArray){
             JSONArray currentJson= ((JSONArray)json);
             if (values == null) //array of strings (for last item)
@@ -176,11 +176,8 @@ public class CsvServiceImpl implements CsvService{
                 if (keyExistsOrFirstElement(currentJson, key)) {
                     currentJson.put(new JSONObject().put(key, values));
                 } else {
-                    JSONObject lastItem = lastItemInArray(currentJson);
-                    if(lastItem != null){
-                        lastItem.put(key, values);
-                    }
-
+                JSONObject lastItem = lastItemInArray(currentJson);
+                    lastItem.put(key, values);
                 }
             }
         }