summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-04-13 16:13:01 -0400
committerPamela Dragosh <pdragosh@research.att.com>2020-04-13 16:13:08 -0400
commit0cd930cf733d33662ada0da13d226b82bcc13684 (patch)
treefedc8fabe9a02a0fdd513b4133c7fdb977baaabb
parent3b93d5a8a6f8aeec9990c79e4b4b81fbe62ef947 (diff)
Fix integer converted to double
Use policy/common map double converter to ensure integers saved in policy content do not get converted to doubles. Issue-ID: POLICY-2486 Change-Id: I887c6b5c337e2594c425b645af4b2668d06715bd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapObligation.java7
-rw-r--r--pom.xml4
2 files changed, 7 insertions, 4 deletions
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapObligation.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapObligation.java
index da2e7f10..c1a949f3 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapObligation.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/OnapObligation.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * 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.
@@ -26,6 +26,7 @@ import com.att.research.xacml.api.AttributeAssignment;
import com.att.research.xacml.api.Identifier;
import com.att.research.xacml.api.Obligation;
import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
import java.util.Map;
import lombok.AccessLevel;
import lombok.Getter;
@@ -35,6 +36,7 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObjectFactory;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionType;
+import org.onap.policy.common.gson.MapDoubleAdapterFactory;
@Getter
@ToString
@@ -44,7 +46,8 @@ public class OnapObligation {
private static final ObjectFactory factory = new ObjectFactory();
@Getter(AccessLevel.NONE)
- private static final Gson gson = new Gson();
+ private static final Gson gson =
+ new GsonBuilder().registerTypeAdapterFactory(new MapDoubleAdapterFactory()).create();
private String policyId;
private String policyType;
diff --git a/pom.xml b/pom.xml
index 6b5820e9..eb5cb4bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,8 +39,8 @@
<description>This code implements the XACML PDP engine</description>
<properties>
- <policy.common.version>1.6.3</policy.common.version>
- <policy.models.version>2.2.3</policy.models.version>
+ <policy.common.version>1.6.4-SNAPSHOT</policy.common.version>
+ <policy.models.version>2.2.4-SNAPSHOT</policy.models.version>
</properties>
<modules>