From ba6267f5bd58dd7a3a0d6363e7ac4c27705e9f40 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 14 Jun 2019 19:20:55 -0400 Subject: Fix sonar issues in models: sdc to vfc sdc sdnc snr so vfc Still haven't done the "rest" project yet, as still awaiting removal of www.examples.org. Change-Id: Icc4948799e2423bd4568232ee5629b88b7ecb996 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn --- .../sdnc/src/main/java/org/onap/policy/sdnc/SdncManager.java | 3 ++- .../src/main/java/org/onap/policy/sdnc/util/Serialization.java | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'models-interactions/model-impl/sdnc/src/main/java') diff --git a/models-interactions/model-impl/sdnc/src/main/java/org/onap/policy/sdnc/SdncManager.java b/models-interactions/model-impl/sdnc/src/main/java/org/onap/policy/sdnc/SdncManager.java index 3679625ec..7612eeb3f 100644 --- a/models-interactions/model-impl/sdnc/src/main/java/org/onap/policy/sdnc/SdncManager.java +++ b/models-interactions/model-impl/sdnc/src/main/java/org/onap/policy/sdnc/SdncManager.java @@ -49,6 +49,7 @@ public final class SdncManager implements Runnable { // The REST manager used for processing REST calls for this Sdnc manager private RestManager restManager; + @FunctionalInterface public interface SdncCallback { public void onCallback(SdncResponse response); } @@ -133,7 +134,7 @@ public final class SdncManager implements Runnable { logger.info(body); response.setRequestId(sdncRequest.getRequestId().toString()); - if (!response.getResponseOutput().getResponseCode().equals("200")) { + if (!"200".equals(response.getResponseOutput().getResponseCode())) { logger.info( "Sdnc Heal Restcall failed with http error code {} {}", httpDetails.first, httpDetails.second ); diff --git a/models-interactions/model-impl/sdnc/src/main/java/org/onap/policy/sdnc/util/Serialization.java b/models-interactions/model-impl/sdnc/src/main/java/org/onap/policy/sdnc/util/Serialization.java index cfaa46fd0..090b4f9b6 100644 --- a/models-interactions/model-impl/sdnc/src/main/java/org/onap/policy/sdnc/util/Serialization.java +++ b/models-interactions/model-impl/sdnc/src/main/java/org/onap/policy/sdnc/util/Serialization.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Huawei. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 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. @@ -23,11 +24,12 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; public final class Serialization { - private Serialization() { - } - + public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping() .setPrettyPrinting() .create(); + private Serialization() { + + } } -- cgit 1.2.3-korg