summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-12-03 15:50:26 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-12-03 15:51:03 +0530
commitc8a6fd059dfe662400e6dc91d7f1467ea8329ffd (patch)
tree1ff4c028194afbae189c662f6103fcc4ea63c715
parent409a44b5b0b510af613e2036712c340486bae410 (diff)
fixed sonar issues in PolicyReader.java
fixed sonar issues Issue-ID: CCSDK-525 Change-Id: Ieeb51a0c2671c07687ddc189564aa5b44237ec38 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyReader.java11
1 files changed, 5 insertions, 6 deletions
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<String, ?> theModel = null;
if (namingModels != null) {
for (Map<String, ?> 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<String, ?> 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<String, ?> 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<String, ?> namimgModelOrElement) {
- return value(namimgModelOrElement, "naming-type");
+ return value(namimgModelOrElement, NAMING_TYPE);
}
/**
@@ -299,7 +299,6 @@ public abstract class PolicyReader implements PolicyFinder {
Map<String, Object> getPolicy(String jsonString) throws Exception {
ObjectMapper mapper = new ObjectMapper();
- // Map<String, Object> jsonObject = mapper.readValue(jsonString, new TypeReference<Map<String, Object>>() {});
return mapper.readValue(jsonString, new TypeReference<Map<String, Object>>() {});
}