Fixed Sonar blockers/criticals 57/17257/1
authorHockla, Ali (ah999m) <ah999m@att.com>
Wed, 4 Oct 2017 16:58:13 +0000 (11:58 -0500)
committerHockla, Ali (ah999m) <ah999m@att.com>
Wed, 4 Oct 2017 16:58:28 +0000 (11:58 -0500)
Issue-ID: POLICY-292

Change-Id: Id53e9d3b6ba23b20d7e45d4d3b39f8092f126333
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java
controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
controlloop/common/msb/src/main/java/org/onap/policy/msb/client/MSBServiceFactory.java

index 9ee6f23..57f5208 100644 (file)
@@ -408,9 +408,9 @@ public class PIPEngineGetHistory extends StdConfigurableEngine{
                                + " and endtime between '" + new Timestamp(diff) + "' and '" + new Timestamp(now) + "'";
 
                Query nq = em.createNativeQuery(sql);
-               nq.setParameter(1, actor);
-               nq.setParameter(2, operation);
-               nq.setParameter(3, target);
+               nq.setParameter(0, actor);
+               nq.setParameter(1, operation);
+               nq.setParameter(2, target);
 
                int ret = -1;
                try{
index f5a93d8..908a3af 100644 (file)
@@ -234,9 +234,9 @@ public class PolicyGuardXacmlHelper {
                        //
                        // Connection may have failed, return Indeterminate
                        //
-                       if(response == null || "".equals(response)){
+                       if(response == null || response.isEmpty()){
                                return Util.INDETERMINATE;
-                       }
+                       }       
                }
                
                rawDecision = new JSONObject(response).getString("decision");
index 68550ef..5332c0d 100644 (file)
@@ -37,7 +37,7 @@ public class MSBServiceFactory implements Serializable {
     private static final String msbPropertyFile = "msb.policy.properties";\r
     private static final String MSB_IP = "msb.ip";\r
     private static final String MSB_PORT = "msb.port";\r
-    private MSBServiceClient msbClient;\r
+    private transient MSBServiceClient msbClient;\r
     private Properties properties;\r
 \r
     public MSBServiceFactory() throws MSBServiceException,IOException{\r