From cfbf99e5c9c673b35989aa09a6551b226b59688c Mon Sep 17 00:00:00 2001 From: "Hockla, Ali (ah999m)" Date: Wed, 4 Oct 2017 11:58:13 -0500 Subject: Fixed Sonar blockers/criticals Issue-ID: POLICY-292 Change-Id: Id53e9d3b6ba23b20d7e45d4d3b39f8092f126333 Signed-off-by: Hockla, Ali (ah999m) --- .../src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java | 6 +++--- .../src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java | 4 ++-- .../src/main/java/org/onap/policy/msb/client/MSBServiceFactory.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'controlloop/common') diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java index 9ee6f2310..57f520894 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java @@ -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{ diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java index f5a93d8be..908a3aff9 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java @@ -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"); diff --git a/controlloop/common/msb/src/main/java/org/onap/policy/msb/client/MSBServiceFactory.java b/controlloop/common/msb/src/main/java/org/onap/policy/msb/client/MSBServiceFactory.java index 68550ef8b..5332c0df2 100644 --- a/controlloop/common/msb/src/main/java/org/onap/policy/msb/client/MSBServiceFactory.java +++ b/controlloop/common/msb/src/main/java/org/onap/policy/msb/client/MSBServiceFactory.java @@ -37,7 +37,7 @@ public class MSBServiceFactory implements Serializable { private static final String msbPropertyFile = "msb.policy.properties"; private static final String MSB_IP = "msb.ip"; private static final String MSB_PORT = "msb.port"; - private MSBServiceClient msbClient; + private transient MSBServiceClient msbClient; private Properties properties; public MSBServiceFactory() throws MSBServiceException,IOException{ -- cgit 1.2.3-korg