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%2FCreatePolicyController.java;h=be9910c24efa23a2279cacb50000226c2c00f356;hp=af4f8cfc3a90ddf699ea40597186d7f9613733a2;hb=4e6615528e03f1a6f7808e28481bd55fe39ed572;hpb=f36e53a3637e1204a42491ec0eeed7b3c763f681 diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java index af4f8cfc3..be9910c24 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java @@ -80,26 +80,28 @@ public class CreatePolicyController extends RestrictedBaseController { policyAdapter.setPolicyDescription(description); // Get the target data under policy. TargetType target = policy.getTarget(); - if (target != null && target.getAnyOf() != null) { + // + // NOTE: target.getAnyOf() will NEVER return null + // + if (target != null) { // Under target we have AnyOFType List anyOfList = target.getAnyOf(); Iterator iterAnyOf = anyOfList.iterator(); while (iterAnyOf.hasNext()) { AnyOfType anyOf = iterAnyOf.next(); // Under AnyOFType we have AllOFType + // + // NOTE: anyOf.getAllOf() will NEVER return null + // List allOfList = anyOf.getAllOf(); - if (allOfList == null) { - continue; - } Iterator iterAllOf = allOfList.iterator(); int index = 0; while (iterAllOf.hasNext()) { AllOfType allOf = iterAllOf.next(); // Under AllOFType we have Match + // NOTE: allOf.getMatch() will NEVER be NULL + // List matchList = allOf.getMatch(); - if (matchList == null) { - continue; - } Iterator iterMatch = matchList.iterator(); while (iterMatch.hasNext()) { MatchType match = iterMatch.next();