From b7239e0e2859d998d5f8448879409eb30c3bc658 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 30 Sep 2020 14:32:56 -0400 Subject: Fix new sonars in drools-pdp Addressed the following sonar issues: - extract common test method - too many assertions in test method - don't always return the same value Issue-ID: POLICY-2616 Change-Id: Iab836cdcd667b35e2db9db7d6ffc7896df33e1c8 Signed-off-by: Jim Hahn --- .../src/main/java/org/onap/policy/drools/core/PolicyContainer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'policy-core') diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java index 6547ca73..5bce3505 100644 --- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java +++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java @@ -537,7 +537,12 @@ public class PolicyContainer implements Startable { * {@inheritDoc}. */ @Override - public synchronized boolean start() { + public synchronized boolean start() { // NOSONAR + /* + * disabling sonar about returning the same value, because we prefer the code to + * be structured this way + */ + if (isStarted) { return true; } -- cgit 1.2.3-korg