X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateDcaeMicroServiceController.java;h=431482d40b40ffbf7d25383ae6b46c39a9997408;hb=401b48bc573561f097960a9ca7abe6d788456f28;hp=e2db78c6ca895c2ad7334e8cb47b8e77da133346;hpb=9df8b88412f6e890320bc446ba1c83a13e99822d;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java index e2db78c6c..431482d40 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java @@ -892,52 +892,28 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { } node.put(key.substring(key.indexOf('.')+1), value); } - }else if(node.size()!=0){ - if(nodeKey.contains("@")){ - if(arryKey==null){ - arryKey = nodeKey.substring(0,nodeKey.indexOf('@')); - } - if(nodeKey.endsWith("@0")){ - isArray = true; - jsonArray = new JSONArray(); - } - if(jsonArray != null && arryKey.equals(nodeKey.substring(0,nodeKey.indexOf('@')))){ - jsonArray.put(decodeContent(node)); - } - jsonResult.put(arryKey, jsonArray); - jsonArray = new JSONArray(); - arryKey = nodeKey.substring(0,nodeKey.indexOf('@')); - }else{ - isArray = false; - jsonResult.put(nodeKey, decodeContent(node)); - } - node = nodeFactory.objectNode(); - if(key.contains("@")){ - isArray = true; - if(key.endsWith("@0")|| jsonArray==null){ + }else { + if(node.size()!=0){ + if(nodeKey.contains("@")){ + if(arryKey==null){ + arryKey = nodeKey.substring(0,nodeKey.indexOf('@')); + } + if(nodeKey.endsWith("@0")){ + isArray = true; + jsonArray = new JSONArray(); + } + if(jsonArray != null && arryKey.equals(nodeKey.substring(0,nodeKey.indexOf('@')))){ + jsonArray.put(decodeContent(node)); + } + jsonResult.put(arryKey, jsonArray); jsonArray = new JSONArray(); - } - }else if(!key.contains("@")){ - isArray = false; - } - if(isArray){ - if(oldValue==null){ - oldValue = key.substring(0,key.indexOf('@')); - } - if(oldValue!=prevKey){ - oldValue = key.substring(0,key.indexOf('@')); - } - if(oldValue.equals(key.substring(0,key.indexOf('@')))){ - jsonArray.put(value); + arryKey = nodeKey.substring(0,nodeKey.indexOf('@')); }else{ - jsonResult.put(oldValue, jsonArray); - jsonArray = new JSONArray(); + isArray = false; + jsonResult.put(nodeKey, decodeContent(node)); } - oldValue = key.substring(0,key.indexOf('@')); - }else{ - jsonResult.put(key, value); + node = nodeFactory.objectNode(); } - }else{ if(key.contains("@")){ isArray = true; if(key.endsWith("@0")|| jsonArray==null){ @@ -1726,7 +1702,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { private void retreiveDependency(String workingFile, Boolean modelClass) { MSModelUtils utils = new MSModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName()); - HashMap tempMap; + Map tempMap; tempMap = utils.processEpackage(workingFile, MODEL_TYPE.XMI);