X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateClosedLoopPMController.java;h=1ca027b9c3db7cc1c1b7292431ab2fc202789377;hp=4862efd06766c6f25b6e5070b78d884925e5cf30;hb=f36e53a3637e1204a42491ec0eeed7b3c763f681;hpb=b86c95c99240e8ed0ef91932a70ebed313dbd60c 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);