diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2020-02-18 10:10:19 -0600 |
---|---|---|
committer | jhh <jorge.hernandez-herrero@att.com> | 2020-02-18 10:27:08 -0600 |
commit | 6aad6f374b8e239e7cd4a468fce0d85d90637857 (patch) | |
tree | 733b5e6a2cce2bb3b69227beffdc66a784c4de2d /feature-lifecycle/src/main/java/org/onap | |
parent | 01c834a0ebf12bad80b9931060931503368e33e5 (diff) |
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 <jorge.hernandez-herrero@att.com>
Change-Id: If4e11f37a74fcc763517bc08c4a8e13c1a6561df
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'feature-lifecycle/src/main/java/org/onap')
2 files changed, 10 insertions, 1 deletions
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) { |