From 1abe337d8a49ae2a8f2a56baa9a1f916cd3bcb00 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 5 Aug 2019 18:04:11 +0200 Subject: [PATCH] Move Decimal64.toInt() method 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 --- .../yangtools/yang/common/Decimal64.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Decimal64.java b/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Decimal64.java index e1039be4cf..db1a6b8bdd 100644 --- a/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Decimal64.java +++ b/yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Decimal64.java @@ -128,6 +128,13 @@ public class Decimal64 extends Number implements CanonicalValue { 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 SUPPORT = new Support(); @@ -387,11 +394,4 @@ public class Decimal64 extends Number implements CanonicalValue { 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'; - } } -- 2.36.6