aboutsummaryrefslogtreecommitdiffstats
path: root/policy-core/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-08-25 17:05:37 -0400
committerJim Hahn <jrh3@att.com>2020-08-25 18:47:23 -0400
commit72cf248dced4e272e69a8c48f5ee24c9d345f41d (patch)
treeb09ed0f9b7ee7aac6493119d950d78d50ae08da1 /policy-core/src/main
parent5c71b5a62f4208030b3c3cd18b3f42398a0a86e5 (diff)
Address more sonars in drools-pdp
Addressed the following sonars: - either log or rethrow - call "remove()" for thread-local-storage - use assertEquals - only one method call in exception test - swap arguments in assertEquals - add assertion to assertThatThrownBy() - explain @Ignore Also addressed eclipse warnings: - unused fields and methods Issue-ID: POLICY-2616 Change-Id: I6590c0d2b103885bc933014d48bf5fd92401cd80 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-core/src/main')
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
index 49ff7bb8..389d5b37 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
@@ -190,6 +190,16 @@ public class PolicySession
}
/**
+ * Unset this 'PolicySession' instance as the one associated with the
+ * currently-running thread.
+ */
+ public void removePolicySession() {
+ if (policySess.get() == this) {
+ policySess.remove();
+ }
+ }
+
+ /**
* Get current session.
*
* @return the 'PolicySession' instance associated with the current thread
@@ -498,6 +508,8 @@ public class PolicySession
logger.error("startThread error in kieSession1.fireUntilHalt", e);
}
}
+
+ session.removePolicySession();
logger.info("fireUntilHalt() returned");
}
}