summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java2
-rw-r--r--gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java3
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java8
3 files changed, 7 insertions, 6 deletions
diff --git a/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java b/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java
index 37d24177..75d58f2f 100644
--- a/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java
+++ b/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java
@@ -85,7 +85,7 @@ public class GsonMessageBodyHandler implements MessageBodyReader<Object>, Messag
* @return the configured builder
*/
public static GsonBuilder configBuilder(GsonBuilder builder) {
- return builder.registerTypeAdapterFactory(new MapDoubleAdapterFactory());
+ return builder.disableHtmlEscaping().registerTypeAdapterFactory(new MapDoubleAdapterFactory());
}
@Override
diff --git a/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java b/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java
index 6df5ad2e..420fbdb2 100644
--- a/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java
+++ b/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java
@@ -61,6 +61,7 @@ public class JacksonHandler extends GsonMessageBodyHandler {
return builder.registerTypeAdapterFactory(new JacksonFieldAdapterFactory())
.registerTypeAdapterFactory(new JacksonMethodAdapterFactory())
.registerTypeAdapterFactory(new MapDoubleAdapterFactory())
- .setExclusionStrategies(new JacksonExclusionStrategy());
+ .setExclusionStrategies(new JacksonExclusionStrategy())
+ .disableHtmlEscaping();
}
}
diff --git a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java
index c3f2d993..e84a92f2 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java
@@ -41,7 +41,7 @@ import java.nio.charset.StandardCharsets;
import lombok.AccessLevel;
import lombok.Getter;
import org.onap.policy.common.gson.DoubleConverter;
-import org.onap.policy.common.gson.MapDoubleAdapterFactory;
+import org.onap.policy.common.gson.GsonMessageBodyHandler;
/**
* JSON encoder and decoder using the "standard" mechanism, which is currently gson.
@@ -52,9 +52,9 @@ public class StandardCoder implements Coder {
* Gson object used to encode and decode messages.
*/
@Getter(AccessLevel.PROTECTED)
- private static final Gson GSON =
- new GsonBuilder().registerTypeAdapter(StandardCoderObject.class, new StandardTypeAdapter())
- .registerTypeAdapterFactory(new MapDoubleAdapterFactory()).create();
+ private static final Gson GSON = GsonMessageBodyHandler.configBuilder(
+ new GsonBuilder().registerTypeAdapter(StandardCoderObject.class, new StandardTypeAdapter()))
+ .create();
/**
* Constructs the object.