Move Decimal64.toInt() method 05/83405/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 5 Aug 2019 16:04:11 +0000 (18:04 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 6 Aug 2019 08:30:45 +0000 (08:30 +0000)
This utility is only used in nested class, move it to keep SpotBugs
happy under Java 11.

Change-Id: I405718bf3db9ebcdd972ae5a71c47570c424f730
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Decimal64.java

index e1039be4cfbe193c46d841ce08bb66f16cfe8fda..db1a6b8bdd9f3ba07a0d7d56d35d977322d6941d 100644 (file)
@@ -128,6 +128,13 @@ public class Decimal64 extends Number implements CanonicalValue<Decimal64> {
 
             return Variant.ofFirst(new Decimal64(fracLen, intPart, fracPart, negative));
         }
+
+        private static int toInt(final char ch, final int index) {
+            if (ch < '0' || ch > '9') {
+                throw new NumberFormatException("Illegal character at offset " + index);
+            }
+            return ch - '0';
+        }
     }
 
     private static final CanonicalValueSupport<Decimal64> SUPPORT = new Support();
@@ -387,11 +394,4 @@ public class Decimal64 extends Number implements CanonicalValue<Decimal64> {
     private long fracPart() {
         return Math.abs(value % SCALE[scaleOffset]);
     }
-
-    private static int toInt(final char ch, final int index) {
-        if (ch < '0' || ch > '9') {
-            throw new NumberFormatException("Illegal character at offset " + index);
-        }
-        return ch - '0';
-    }
 }