aboutsummaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java
diff options
context:
space:
mode:
Diffstat (limited to 'POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java')
-rw-r--r--POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java16
1 files changed, 9 insertions, 7 deletions
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<AnyOfType> anyOfList = target.getAnyOf();
Iterator<AnyOfType> iterAnyOf = anyOfList.iterator();
while (iterAnyOf.hasNext()) {
AnyOfType anyOf = iterAnyOf.next();
// Under AnyOFType we have AllOFType
+ //
+ // NOTE: anyOf.getAllOf() will NEVER return null
+ //
List<AllOfType> allOfList = anyOf.getAllOf();
- if (allOfList == null) {
- continue;
- }
Iterator<AllOfType> 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<MatchType> matchList = allOf.getMatch();
- if (matchList == null) {
- continue;
- }
Iterator<MatchType> iterMatch = matchList.iterator();
while (iterMatch.hasNext()) {
MatchType match = iterMatch.next();