summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/java
diff options
context:
space:
mode:
authorrama-huawei <rama.subba.reddy.s@huawei.com>2017-09-20 18:54:26 +0530
committerRama SubbaReddy <rama.subba.reddy.s@huawei.com>2017-09-21 12:37:23 +0000
commit40da9dd1b2cee116acce3501af1976afecc853f1 (patch)
treee2df321f0ef593076cc79f1769fe8d2d49f5d422 /POLICY-SDK-APP/src/main/java
parentc85be0b2c683678dbc94637c93be506216f915e1 (diff)
String literal comparision on left side
Issue-ID: POLICY-239 Change-Id: Iee03160b28ffadb296f3926c7d7c5ac98fac535e Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/java')
-rw-r--r--POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java6
-rw-r--r--POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java12
2 files changed, 12 insertions, 6 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java
index d70f199f0..32f40b9e7 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java
@@ -59,5 +59,11 @@ public class HibernateSession{
public static Session getSession(){
return logSessionFactory.openSession();
}
+
+ public static void setSession(SessionFactory logSessionFactory1){
+ logSessionFactory = logSessionFactory1;
+ }
+ private HibernateSession(){
+ }
}
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
index f10041e38..392adf039 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
@@ -98,24 +98,24 @@ public class CreateClosedLoopPMController{
String attributeId = designator.getAttributeId();
// First match in the target is OnapName, so set that value.
- if (attributeId.equals("ONAPName")) {
+ if ("ONAPName".equals(attributeId)) {
policyAdapter.setOnapName(value);
}
- if (attributeId.equals("RiskType")){
+ if ("RiskType".equals(attributeId)){
policyAdapter.setRiskType(value);
}
- if (attributeId.equals("RiskLevel")){
+ if ("RiskLevel".equals(attributeId)){
policyAdapter.setRiskLevel(value);
}
- if (attributeId.equals("guard")){
+ if ("guard".equals(attributeId)){
policyAdapter.setGuard(value);
}
- if (attributeId.equals("TTLDate") && !value.contains("NA")){
+ if ("TTLDate".equals(attributeId) && !value.contains("NA")){
PolicyController controller = new PolicyController();
String newDate = controller.convertDate(value);
policyAdapter.setTtlDate(newDate);
}
- if (attributeId.equals("ServiceType")){
+ if ("ServiceType".equals(attributeId)){
LinkedHashMap<String, String> serviceTypePolicyName1 = new LinkedHashMap<>();
String key = "serviceTypePolicyName";
serviceTypePolicyName1.put(key, value);