From 9f5537344f03df1cd1738baa3cf9c7545a73afd7 Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Wed, 31 Jul 2019 13:25:29 +0000 Subject: Change to fix issues in overridden validations of ParameterGroups Currently, for validation of nested ParameterGroup classes, a new GroupValidationResult is directly created instead of calling the validate method of nested classes. Thus any overridden validate methods won't work. This is fixed. Change-Id: I8ee9265b295cb68d67926128b5b68c217f341034 Issue-ID: POLICY-1744 Signed-off-by: a.sreekumar --- .../org/onap/policy/common/parameters/GroupValidationResult.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/GroupValidationResult.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/GroupValidationResult.java index ad2eb695..fd680451 100644 --- a/common-parameters/src/main/java/org/onap/policy/common/parameters/GroupValidationResult.java +++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/GroupValidationResult.java @@ -109,7 +109,12 @@ public class GroupValidationResult extends CommonGroupValidationResult { // Nested parameter groups are allowed if (ParameterGroup.class.isAssignableFrom(fieldType)) { - return new GroupValidationResult((ParameterGroup) fieldObject); + if (null != fieldObject) { + return ((ParameterGroup) fieldObject).validate(); + } + else { + return new GroupValidationResult((ParameterGroup) fieldObject); + } } // Nested maps of parameter groups are allowed -- cgit 1.2.3-korg