aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/Policy.java
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2017-08-28 10:11:33 +0000
committerGuo Ruijing <ruijing.guo@intel.com>2017-08-29 08:46:09 +0000
commitfb298650669ecc864d95154cbad2aec6ebb0679a (patch)
treeec519e9c19481fb643e3169ccab5a574a0ec7b08 /ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/Policy.java
parented3acdbb2d22e819218eea730932950d69d985fe (diff)
Fix critical sonar for ONAP-PAP-REST
This patch is to fix sonar issue for ONAP-PAP-REST. Change-Id: I91e9da0edbd5bb261a5c7491f6612c1136af561c Issue-Id: POLICY-174 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/Policy.java')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/Policy.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/Policy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/Policy.java
index 6d0a0c79b..130b2e55a 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/Policy.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/Policy.java
@@ -115,9 +115,9 @@ public abstract class Policy {
public static final String EMPTY_STRING = "";
private static final String String = null;
- public static String CONFIG_HOME = null;
- public static String ACTION_HOME = null;
- public static String CONFIG_URL = null;
+ protected static String CONFIG_HOME = null;
+ protected static String ACTION_HOME = null;
+ protected static String CONFIG_URL = null;
protected Map<String, String> performer = new HashMap<>();
@@ -213,7 +213,7 @@ public abstract class Policy {
protected static boolean isJSONValid(String data) {
JsonReader jsonReader = null;
try {
- new JSONObject(data);
+ JSONObject j = new JSONObject(data);
InputStream stream = new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8));
jsonReader = Json.createReader(stream);
LOGGER.info("Json Value is: " + jsonReader.read().toString() );
@@ -276,8 +276,6 @@ public abstract class Policy {
fileName = policyType + "_" + "PM" + "_" +java.lang.String.format(policyFileName) + "." +version +".xml";
}else if(policyConfigType.equals("ClosedLoop_Fault")){
fileName = policyType + "_" + "Fault" + "_" +java.lang.String.format(policyFileName) + "." + version + ".xml";
- }else if(policyConfigType.equals("ClosedLoop_Fault")){
- fileName = policyType + "_" + "Fault" + "_" +java.lang.String.format(policyFileName) + "." + version + ".xml";
}else if(policyConfigType.equals("Micro Service")){
fileName = policyType + "_" + "MS" + "_" + java.lang.String.format(policyFileName) + "." + version + ".xml";
}
@@ -336,6 +334,7 @@ public abstract class Policy {
try {
loadWebapps();
} catch (Exception e) {
+ LOGGER.debug(e);
return null;
}
return configHome;
@@ -345,6 +344,7 @@ public abstract class Policy {
try {
loadWebapps();
} catch (Exception e) {
+ LOGGER.debug(e);
return null;
}
return actionHome;