diff options
Diffstat (limited to 'gson')
-rw-r--r-- | gson/pom.xml | 2 | ||||
-rw-r--r-- | gson/src/main/java/org/onap/policy/common/gson/MapDoubleAdapterFactory.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/gson/pom.xml b/gson/pom.xml index 7d7797a2..1d65ebc7 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.onap.policy.common</groupId> <artifactId>common-modules</artifactId> - <version>1.4.0-SNAPSHOT</version> + <version>1.4.1-SNAPSHOT</version> </parent> <artifactId>gson</artifactId> 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; |