diff options
author | Jim Hahn <jrh3@att.com> | 2018-02-19 16:56:06 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2018-02-20 09:59:15 -0500 |
commit | a45f8909871dc1ddb75845f067a602951afc8d11 (patch) | |
tree | fa72aff7ceede971d4e6922f62a503a8ee8924d5 /policy-core/src | |
parent | 1708e9a45cb88571613c10b68d392811b2b3f0f4 (diff) |
Sonar fixes to drools-pdp
Fixed most of the instances of the following sonar issues:
Moved array designator
Used diamond operator
Changed System.out/err to use a logger
Changed several Thread.sleep() in test code to a single sleep()
Useless assignments
Replaced comparison with "" to string.isEmpty()
Merged if's
Replaced ArrayList with List in method returns
Reordered type modifiers
Reordered constructor methods
Defined constants for literals, or replaced them with method calls
Removed "throws Xxx" for subclasses of RuntimeException
Combined identical "catch" blocks
Re-interrupted the current thread after catching an InterruptedException
Removed tests against the literal "false"
Fix indentation of new makeTopicOperError() method.
Fix exception variable name in new methods, logNoUebEncoder()
and logNoDmaapEncoder().
Change-Id: Iddae5210553662f733b67333b372dec8c3fe2c94
Issue-ID: POLICY-336
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-core/src')
3 files changed, 12 insertions, 13 deletions
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 7dc53ce2..4806df04 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 @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * policy-core * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -350,7 +350,6 @@ public class PolicyContainer implements Startable * with this name */ public PolicySession adoptKieSession(String name, KieSession kieSession) - throws IllegalArgumentException, IllegalStateException { if(name == null){ 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 984ff47f..431050f5 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 @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * policy-core * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ public class PolicySession private ThreadModel threadModel = null; // supports 'getCurrentSession()' method - private static ThreadLocal<PolicySession> policySession = + private static ThreadLocal<PolicySession> policySess = new ThreadLocal<>(); /** @@ -194,7 +194,7 @@ public class PolicySession public void setPolicySession() { // this sets a 'ThreadLocal' variable - policySession.set(this); + policySess.set(this); } /** @@ -204,7 +204,7 @@ public class PolicySession */ public static PolicySession getCurrentSession() { - return policySession.get(); + return policySess.get(); } /** diff --git a/policy-core/src/main/java/org/onap/policy/drools/properties/Startable.java b/policy-core/src/main/java/org/onap/policy/drools/properties/Startable.java index e0f03bb1..6fa2e58b 100644 --- a/policy-core/src/main/java/org/onap/policy/drools/properties/Startable.java +++ b/policy-core/src/main/java/org/onap/policy/drools/properties/Startable.java @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * policy-core * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ public interface Startable { * @throws IllegalStateException. if the element is in a state that * conflicts with the start operation. */ - public boolean start() throws IllegalStateException; + public boolean start(); /** * Stop operation. The entity can be restarted again by invoking @@ -46,7 +46,7 @@ public interface Startable { * @throws IllegalStateException. if the element is in a state that * conflicts with the stop operation. */ - public boolean stop()throws IllegalStateException; + public boolean stop(); /** * shutdown operation. The terminate operation yields the entity @@ -55,7 +55,7 @@ public interface Startable { * @throws IllegalStateException. if the element is in a state that * conflicts with the stop operation. */ - public void shutdown()throws IllegalStateException; + public void shutdown(); /** * is it alive? |