summaryrefslogtreecommitdiffstats
path: root/gson/src
diff options
context:
space:
mode:
Diffstat (limited to 'gson/src')
-rw-r--r--gson/src/main/java/org/onap/policy/common/gson/MapDoubleAdapterFactory.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/gson/src/main/java/org/onap/policy/common/gson/MapDoubleAdapterFactory.java b/gson/src/main/java/org/onap/policy/common/gson/MapDoubleAdapterFactory.java
index 3892a07f..e56f9dd3 100644
--- a/gson/src/main/java/org/onap/policy/common/gson/MapDoubleAdapterFactory.java
+++ b/gson/src/main/java/org/onap/policy/common/gson/MapDoubleAdapterFactory.java
@@ -55,7 +55,7 @@ public class MapDoubleAdapterFactory implements TypeAdapterFactory {
TypeAdapter<T> delegate = gson.getDelegateAdapter(this, type);
- return new MapAdapter<T>(delegate);
+ return new MapAdapter<>(delegate);
}
/**
@@ -134,7 +134,7 @@ public class MapDoubleAdapterFactory implements TypeAdapterFactory {
Double num = (Double) obj;
long longval = num.longValue();
- if (num.doubleValue() == longval) {
+ if (Double.compare(num.doubleValue(), longval) == 0) {
// it's integral - determine if it's an integer or a long
int intval = (int) longval;