From 6372b62fcd8813d7d49fb279b933ffe2e4637048 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 10 May 2021 09:53:23 -0400 Subject: Fix sonars in policy-models impls & simulators Fixed: - use "var" Issue-ID: POLICY-3094 Change-Id: I65da54cae5a58966f21f981c6cea1259bfdf4239 Signed-off-by: Jim Hahn simulators Change-Id: I1144568485e62e0c72194caaf21ebf1ba88a6fef Signed-off-by: Jim Hahn --- .../sdnr/src/main/java/org/onap/policy/sdnr/PciResponseCode.java | 3 ++- .../sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'models-interactions/model-impl/sdnr') diff --git a/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/PciResponseCode.java b/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/PciResponseCode.java index 35a85d779..90864d42c 100644 --- a/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/PciResponseCode.java +++ b/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/PciResponseCode.java @@ -5,6 +5,7 @@ * Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved. * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd. * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 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. @@ -59,7 +60,7 @@ public class PciResponseCode implements Serializable { * @return the string value equivalent of the SDNR response code */ public static String toResponseValue(int code) { - StatusCodeEnum statusCodeEnum = StatusCodeEnum.fromStatusCode(code); + var statusCodeEnum = StatusCodeEnum.fromStatusCode(code); return (statusCodeEnum != null) ? statusCodeEnum.toString() : null; } } diff --git a/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java b/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java index a5e4336da..90aea71ee 100644 --- a/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java +++ b/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java @@ -57,7 +57,7 @@ public final class Serialization { @Override public JsonElement serialize(PciRequest src, Type typeOfSrc, JsonSerializationContext context) { JsonElement requestJson = gsonPretty.toJsonTree(src, PciRequest.class); - JsonObject input = new JsonObject(); + var input = new JsonObject(); input.add("input", requestJson); return input; @@ -74,7 +74,7 @@ public final class Serialization { @Override public JsonElement serialize(PciResponse src, Type typeOfSrc, JsonSerializationContext context) { JsonElement responseJson = gsonPretty.toJsonTree(src, PciResponse.class); - JsonObject output = new JsonObject(); + var output = new JsonObject(); output.add("output", responseJson); return output; } -- cgit 1.2.3-korg