X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateClosedLoopPMController.java;h=1ca027b9c3db7cc1c1b7292431ab2fc202789377;hb=4e6615528e03f1a6f7808e28481bd55fe39ed572;hp=4862efd06766c6f25b6e5070b78d884925e5cf30;hpb=dfd9c0a09c35e4b5b4b61be08b8424e4a3d0d500;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java index 4862efd06..1ca027b9c 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java @@ -64,7 +64,7 @@ public class CreateClosedLoopPMController { setPolicyAdapterNameValueAndDescription(policyAdapter, policy); // Set PolicyAdapter JsonBodyData - setClosedLoopJSONFile(policyAdapter, entity); + setClosedLoopJsonFile(policyAdapter, entity); // Get the target data under policy. TargetType target = policy.getTarget(); @@ -95,11 +95,10 @@ public class CreateClosedLoopPMController { policyAdapter.setPolicyDescription(description); } - private void setClosedLoopJSONFile(PolicyRestAdapter policyAdapter, PolicyEntity entity) { - ObjectMapper mapper = new ObjectMapper(); + private void setClosedLoopJsonFile(PolicyRestAdapter policyAdapter, PolicyEntity entity) { try { ClosedLoopPMBody closedLoopBody = - mapper.readValue(entity.getConfigurationData().getConfigBody(), ClosedLoopPMBody.class); + new ObjectMapper().readValue(entity.getConfigurationData().getConfigBody(), ClosedLoopPMBody.class); policyAdapter.setJsonBodyData(closedLoopBody); } catch (IOException e) { LOGGER.error("Exception Occured" + e);