diff options
author | a.sreekumar <ajith.sreekumar@est.tech> | 2019-07-31 13:25:29 +0000 |
---|---|---|
committer | a.sreekumar <ajith.sreekumar@est.tech> | 2019-07-31 13:25:29 +0000 |
commit | 9f5537344f03df1cd1738baa3cf9c7545a73afd7 (patch) | |
tree | fb52b754c92e6990a273b5644ca19f3d0cf03e00 /common-parameters/src | |
parent | 63d5702986d5dc63eb3d0ed2e3b57ce3b529966f (diff) |
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 <ajith.sreekumar@est.tech>
Diffstat (limited to 'common-parameters/src')
-rw-r--r-- | common-parameters/src/main/java/org/onap/policy/common/parameters/GroupValidationResult.java | 7 |
1 files changed, 6 insertions, 1 deletions
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 |