From 6aad6f374b8e239e7cd4a468fce0d85d90637857 Mon Sep 17 00:00:00 2001 From: jhh Date: Tue, 18 Feb 2020 10:10:19 -0600 Subject: Ignore fsm field in policies for serialization When printing lifecycle fsm state information with telemetry, fsm causes a stack overflow, because of the pointer back to the fsm parent object. This will correct this situation. Issue-ID: POLICY-2345 Signed-off-by: jhh Change-Id: If4e11f37a74fcc763517bc08c4a8e13c1a6561df Signed-off-by: jhh --- .../onap/policy/drools/lifecycle/PolicyTypeNativeController.java | 5 +++++ .../org/onap/policy/drools/lifecycle/PolicyTypeRulesController.java | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'feature-lifecycle/src/main/java/org/onap') diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeController.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeController.java index 87128e43..ebc44e9b 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeController.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeController.java @@ -20,7 +20,9 @@ package org.onap.policy.drools.lifecycle; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Getter; +import org.onap.policy.common.gson.annotation.GsonJsonIgnore; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier; @@ -28,6 +30,9 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifi public class PolicyTypeNativeController implements PolicyTypeController { protected final ToscaPolicyTypeIdentifier policyType; + + @GsonJsonIgnore + @JsonIgnore protected final LifecycleFsm fsm; public PolicyTypeNativeController(LifecycleFsm fsm, ToscaPolicyTypeIdentifier policyType) { diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeRulesController.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeRulesController.java index 7dd0d7ae..8e928aa8 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeRulesController.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeRulesController.java @@ -20,8 +20,9 @@ package org.onap.policy.drools.lifecycle; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Getter; - +import org.onap.policy.common.gson.annotation.GsonJsonIgnore; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier; @@ -29,6 +30,9 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifi public class PolicyTypeRulesController implements PolicyTypeController { protected final ToscaPolicyTypeIdentifier policyType; + + @GsonJsonIgnore + @JsonIgnore protected final LifecycleFsm fsm; public PolicyTypeRulesController(LifecycleFsm fsm, ToscaPolicyTypeIdentifier policyType) { -- cgit 1.2.3-korg