From 1d0aaaa5b31719c1718700bb0d1a99c413fd513c Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 6 May 2021 11:28:53 -0400 Subject: 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 --- .../java/org/onap/policy/common/utils/validation/Version.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'utils/src/main/java/org/onap/policy/common/utils/validation/Version.java') diff --git a/utils/src/main/java/org/onap/policy/common/utils/validation/Version.java b/utils/src/main/java/org/onap/policy/common/utils/validation/Version.java index 527113dd..46e006bd 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/validation/Version.java +++ b/utils/src/main/java/org/onap/policy/common/utils/validation/Version.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP COMMON * ================================================================================ - * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,6 @@ package org.onap.policy.common.utils.validation; -import com.google.re2j.Matcher; import com.google.re2j.Pattern; import lombok.Data; import lombok.NoArgsConstructor; @@ -56,7 +55,7 @@ public class Version implements Comparable { * @param versionString the version string */ public Version(@NonNull final String versionString) { - Version newVersion = makeVersion("String", "constructor", versionString); + var newVersion = makeVersion("String", "constructor", versionString); if (newVersion != null) { this.major = newVersion.major; @@ -79,7 +78,7 @@ public class Version implements Comparable { * that does not match the major.minor.patch form) */ public static Version makeVersion(String type, String name, String versionText) { - Matcher matcher = VERSION_PAT.matcher(versionText); + var matcher = VERSION_PAT.matcher(versionText); if (!matcher.matches()) { logger.info("invalid version for {} {}: {}", type, name, versionText); return null; @@ -113,7 +112,7 @@ public class Version implements Comparable { @Override public int compareTo(Version other) { - int result = Integer.compare(major, other.major); + var result = Integer.compare(major, other.major); if (result != 0) { return result; } -- cgit 1.2.3-korg