From 59f4f54cdf4c1a5c155360239272da690e8c4a72 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 25 Aug 2020 12:30:29 -0400 Subject: Address more sonar issues in policy-models Addressed sonar issues: - diamond operator Also removed a number of the "NOSONAR" comments now that we know how to address them without disabling sonar. Issue-ID: POLICY-2714 Change-Id: I440f4fa955968fd911616c2b6ee61b4b4d013821 Signed-off-by: Jim Hahn --- .../main/java/org/onap/policy/models/base/PfConceptContainer.java | 2 +- .../src/main/java/org/onap/policy/models/base/Validated.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'models-base/src/main/java/org/onap') diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java index 144d6e61d..b8f2ed6cb 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java @@ -106,7 +106,7 @@ public class PfConceptContainer ex * @param key the concept key */ public PfConceptContainer(@NonNull final PfConceptKey key) { - this(key, new TreeMap()); + this(key, new TreeMap<>()); } /** diff --git a/models-base/src/main/java/org/onap/policy/models/base/Validated.java b/models-base/src/main/java/org/onap/policy/models/base/Validated.java index 26a8a5260..d79d58f13 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/Validated.java +++ b/models-base/src/main/java/org/onap/policy/models/base/Validated.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 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. @@ -70,14 +70,13 @@ public class Validated { * @param result where to place the result * @return the result */ - @SuppressWarnings("java:S3252") // squelch sonar warning for using PkConceptKey instead of PfKeyImpl public PfValidationResult validateNotNull(@NonNull PfConceptKey value, @NonNull PfValidationResult result) { - if (PfConceptKey.NULL_KEY_NAME.equals(value.getName())) { + if (PfKey.NULL_KEY_NAME.equals(value.getName())) { addError(value, "name", result, "null"); } - if (PfConceptKey.NULL_KEY_VERSION.equals(value.getVersion())) { + if (PfKey.NULL_KEY_VERSION.equals(value.getVersion())) { addError(value, "version", result, "null"); } -- cgit 1.2.3-korg 305086d71a36d0'/>
blob: 74cc76efaccb6936911019cd5abb2f42143bf8ed (plain)
1
2
3
4