summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-07-21 08:43:43 -0500
committerJorge Hernandez <jh1730@att.com>2017-07-21 08:43:43 -0500
commit1ad88d1ce542a10fb57d1205ac10c8882d103723 (patch)
tree943200ef955c88a44c2671d5e8712c3a13b1cf45
parent76ec9035351877aa5993bbefef63fcc73941d2f2 (diff)
[POLICY-8] clean pdp-d from sonar blockers
Change-Id: I25427a0505e2fdd2b0b939f652452cb4f9f07f02 Signed-off-by: Jorge Hernandez <jh1730@att.com>
-rw-r--r--policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java6
-rw-r--r--policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java2
-rw-r--r--policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/JsonProtocolFilter.java2
-rw-r--r--policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/ProtocolCoderToolset.java7
4 files changed, 10 insertions, 7 deletions
diff --git a/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java
index 34988d32..65bd5470 100644
--- a/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java
+++ b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java
@@ -352,8 +352,14 @@ public class PolicyContainer implements Startable
if(name == null){
logger.warn("adoptKieSession:input name is null");
+ throw(new IllegalArgumentException
+ ("KieSession input name is null "
+ + getName()));
}else if(kieSession == null){
logger.warn("adoptKieSession:input kieSession is null");
+ throw(new IllegalArgumentException
+ ("KieSession '" + name + "' is null "
+ + getName()));
}else {
logger.info("adoptKieSession:name: " + name + " kieSession: " + kieSession);
}
diff --git a/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java
index 4eb088c5..431d166d 100644
--- a/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java
+++ b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java
@@ -565,7 +565,7 @@ public class PolicySession
// if we fall through, it means 'KieSession.halt()' was called,
// but this may be a result of 'KieScanner' doing an update
}
- catch (Throwable e)
+ catch (Exception | LinkageError e)
{
logger.error("startThread error in kieSession.fireUntilHalt", e);
}
diff --git a/policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/JsonProtocolFilter.java b/policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/JsonProtocolFilter.java
index d6146a30..7831e7b8 100644
--- a/policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/JsonProtocolFilter.java
+++ b/policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/JsonProtocolFilter.java
@@ -189,7 +189,7 @@ public class JsonProtocolFilter {
}
try {
- if (json == null || !json.isJsonObject()) {
+ if (!json.isJsonObject()) {
return false;
}
diff --git a/policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/ProtocolCoderToolset.java b/policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/ProtocolCoderToolset.java
index fb3f95d3..bf7a43f3 100644
--- a/policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/ProtocolCoderToolset.java
+++ b/policy-management/src/main/java/org/openecomp/policy/drools/protocol/coders/ProtocolCoderToolset.java
@@ -642,13 +642,10 @@ class GsonProtocolCoderToolset extends ProtocolCoderToolset {
throws IllegalArgumentException, UnsupportedOperationException {
DroolsController droolsController =
- DroolsController.factory.get(groupId, artifactId, "");
+ DroolsController.factory.get(groupId, artifactId, null);
if (droolsController == null) {
logger.info("{}: no drools-controller to process {} (continue)", this, event);
- if (this.customCoder != null) {
- logger.warn("{}: no drools-controller to process {}", this, event);
- throw new IllegalStateException("custom-coder but no drools-controller");
- }
+ throw new IllegalStateException("custom-coder but no drools-controller");
}
if (this.customCoder != null) {