aboutsummaryrefslogtreecommitdiffstats
path: root/models-pdp/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'models-pdp/src/main/java')
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java19
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java12
2 files changed, 15 insertions, 16 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java
index 7faf19748..8f647a4ee 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -119,10 +119,11 @@ public class PdpGroupFilter implements PfObjectFilter<PdpGroup> {
}
for (PdpSubGroup pdpSubGroup : pdpGroup.getPdpSubgroups()) {
- if (matchPolicyTypesExactly && areListsIdentical(pdpSubGroup.getSupportedPolicyTypes(), typeFilter)) {
- return true;
- } else if (!matchPolicyTypesExactly
- && findSupportedPolicyType(pdpSubGroup.getSupportedPolicyTypes(), typeFilter)) {
+ if (matchPolicyTypesExactly) {
+ if (areListsIdentical(pdpSubGroup.getSupportedPolicyTypes(), typeFilter)) {
+ return true;
+ }
+ } else if (findSupportedPolicyType(pdpSubGroup.getSupportedPolicyTypes(), typeFilter)) {
return true;
}
}
@@ -172,9 +173,11 @@ public class PdpGroupFilter implements PfObjectFilter<PdpGroup> {
}
for (PdpSubGroup pdpSubGroup : pdpGroup.getPdpSubgroups()) {
- if (matchPoliciesExactly && areListsIdentical(pdpSubGroup.getPolicies(), policyFilter)) {
- return true;
- } else if (!matchPoliciesExactly && findSingleElement(pdpSubGroup.getPolicies(), policyFilter)) {
+ if (matchPoliciesExactly) {
+ if (areListsIdentical(pdpSubGroup.getPolicies(), policyFilter)) {
+ return true;
+ }
+ } else if (findSingleElement(pdpSubGroup.getPolicies(), policyFilter)) {
return true;
}
}
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java
index 0df620bcf..67458cf5f 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP Policy Model
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -239,7 +239,7 @@ public class JpaPdpGroup extends PfConcept implements PfAuthorative<PdpGroup> {
}
if (properties != null) {
- result = validateProperties(result);
+ validateProperties(result);
}
if (pdpSubGroups == null) {
@@ -257,11 +257,9 @@ public class JpaPdpGroup extends PfConcept implements PfAuthorative<PdpGroup> {
/**
* Validate the properties.
*
- * @param resultIn the incoming validation results so far
- * @return the revalidation results including the property validation results
+ * @param result where to place any new validation results
*/
- private PfValidationResult validateProperties(PfValidationResult resultIn) {
- PfValidationResult result = resultIn;
+ private void validateProperties(PfValidationResult result) {
for (Entry<String, String> propertyEntry : properties.entrySet()) {
if (!ParameterValidationUtils.validateStringParameter(propertyEntry.getKey())) {
@@ -273,8 +271,6 @@ public class JpaPdpGroup extends PfConcept implements PfAuthorative<PdpGroup> {
"a property value may not be null or blank"));
}
}
-
- return result;
}
@Override