From c8a6fd059dfe662400e6dc91d7f1467ea8329ffd Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Mon, 3 Dec 2018 15:50:26 +0530 Subject: fixed sonar issues in PolicyReader.java fixed sonar issues Issue-ID: CCSDK-525 Change-Id: Ieeb51a0c2671c07687ddc189564aa5b44237ec38 Signed-off-by: Sandeep J --- .../org/onap/ccsdk/apps/ms/neng/core/policy/PolicyReader.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ms') diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyReader.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyReader.java index 09a6e49b..181bb7a3 100644 --- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyReader.java +++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyReader.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -95,7 +97,7 @@ public abstract class PolicyReader implements PolicyFinder { Map theModel = null; if (namingModels != null) { for (Map model : namingModels) { - Object val = model.get("naming-type"); + Object val = model.get(NAMING_TYPE); if (val != null) { if (namingType.equalsIgnoreCase(val.toString())) { theModel = model; @@ -106,7 +108,7 @@ public abstract class PolicyReader implements PolicyFinder { if (theModel == null) { namingType = relaxedNamingType(namingType); for (Map model : namingModels) { - Object val = model.get("naming-type"); + Object val = model.get(NAMING_TYPE); if (val != null) { String relaxedVal = relaxedNamingType(val.toString()); if (namingType.equalsIgnoreCase(relaxedVal)) { @@ -124,8 +126,6 @@ public abstract class PolicyReader implements PolicyFinder { * Finds the naming-operation from the given naming-model. */ public static String namingOperation(Map namimgModel) { - //String propValue = value(namimgModel, "name-operation"); - //return propValue; return value(namimgModel, "name-operation"); } @@ -162,7 +162,7 @@ public abstract class PolicyReader implements PolicyFinder { * Finds the naming-type from the given naming-model. */ public static String namingType(Map namimgModelOrElement) { - return value(namimgModelOrElement, "naming-type"); + return value(namimgModelOrElement, NAMING_TYPE); } /** @@ -299,7 +299,6 @@ public abstract class PolicyReader implements PolicyFinder { Map getPolicy(String jsonString) throws Exception { ObjectMapper mapper = new ObjectMapper(); - // Map jsonObject = mapper.readValue(jsonString, new TypeReference>() {}); return mapper.readValue(jsonString, new TypeReference>() {}); } -- cgit 1.2.3-korg