aboutsummaryrefslogtreecommitdiffstats
path: root/gson/src/main/java/org/onap/policy/common/gson/DoubleConverter.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-06 11:28:53 -0400
committerJim Hahn <jrh3@att.com>2021-05-06 15:26:24 -0400
commit1d0aaaa5b31719c1718700bb0d1a99c413fd513c (patch)
treebd2687f1d38f3e3c4e53a68695c8c91c6866468e /gson/src/main/java/org/onap/policy/common/gson/DoubleConverter.java
parent3b00f1c32b89282dcbb74d3d3645e263f005319e (diff)
Fix sonars in policy-common
Fixed sonars: - use "var" instead of actual type name - re-interrupt threads - use rej2 split() instead of String split() Issue-ID: POLICY-3285 Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'gson/src/main/java/org/onap/policy/common/gson/DoubleConverter.java')
-rw-r--r--gson/src/main/java/org/onap/policy/common/gson/DoubleConverter.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/gson/src/main/java/org/onap/policy/common/gson/DoubleConverter.java b/gson/src/main/java/org/onap/policy/common/gson/DoubleConverter.java
index 81803ff2..cbf5d0e7 100644
--- a/gson/src/main/java/org/onap/policy/common/gson/DoubleConverter.java
+++ b/gson/src/main/java/org/onap/policy/common/gson/DoubleConverter.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019, 2021 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.
@@ -98,7 +98,7 @@ public class DoubleConverter {
}
Double num = (Double) value;
- long longval = num.longValue();
+ var longval = num.longValue();
if (Double.compare(num.doubleValue(), longval) != 0) {
// it isn't integral - return unchanged value
@@ -106,7 +106,7 @@ public class DoubleConverter {
}
// it's integral - determine if it's an integer or a long
- int intval = (int) longval;
+ var intval = (int) longval;
if (intval == longval) {
return intval;