summaryrefslogtreecommitdiffstats
path: root/policy-core
diff options
context:
space:
mode:
authorMagnusen, Drew (dm741q) <dm741q@att.com>2018-04-13 13:53:49 -0500
committerJorge Hernandez <jh1730@att.com>2018-04-14 00:01:17 +0000
commitec1f090c8f41edff7d4f9a571b3489dfe54d44cb (patch)
treec807e04364e5430fbf122bfc41afff79003cbf28 /policy-core
parent99652c48d8153aaa21a70307c0833950bc6142ca (diff)
Sonar cleanup
Sonar cleanup for distributed-locking Issue-ID: POLICY-728 Change-Id: I52523a0149436805509706a4a732d1da8a1b4511 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
Diffstat (limited to 'policy-core')
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java2
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java15
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java3
3 files changed, 9 insertions, 11 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java b/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java
index 9f42936d..d4e7bee9 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockFeatureAPI.java
@@ -64,7 +64,7 @@ public interface PolicyResourceLockFeatureAPI extends OrderedService {
/**
* Result of a requested operation.
*/
- public static enum OperResult {
+ public enum OperResult {
/**
* The implementer accepted the request; no additional locking logic should be
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java b/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java
index a9305e51..97e7242d 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/lock/PolicyResourceLockManager.java
@@ -130,11 +130,11 @@ public class PolicyResourceLockManager extends SimpleLockManager {
}
- return doBoolIntercept(impl -> impl.beforeIsLocked(resourceId), () -> {
+ return doBoolIntercept(impl -> impl.beforeIsLocked(resourceId), () ->
// implementer didn't do the work - defer to the superclass
- return super.isLocked(resourceId);
- });
+ super.isLocked(resourceId)
+ );
}
/**
@@ -151,11 +151,11 @@ public class PolicyResourceLockManager extends SimpleLockManager {
throw makeNullArgException(MSG_NULL_OWNER);
}
- return doBoolIntercept(impl -> impl.beforeIsLockedBy(resourceId, owner), () -> {
+ return doBoolIntercept(impl -> impl.beforeIsLockedBy(resourceId, owner), () ->
// implementer didn't do the work - defer to the superclass
- return super.isLockedBy(resourceId, owner);
- });
+ super.isLockedBy(resourceId, owner)
+ );
}
/**
@@ -210,6 +210,8 @@ public class PolicyResourceLockManager extends SimpleLockManager {
*/
private static class Singleton {
+ private static final PolicyResourceLockManager instance = new PolicyResourceLockManager();
+
/**
* Not invoked.
*/
@@ -217,7 +219,6 @@ public class PolicyResourceLockManager extends SimpleLockManager {
super();
}
- private static final PolicyResourceLockManager instance = new PolicyResourceLockManager();
}
/**
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java b/policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java
index 14cffaab..c2d58b85 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/lock/SimpleLockManager.java
@@ -49,9 +49,6 @@ public class SimpleLockManager {
super();
}
- // TODO: for ease of use by clients, should we always invoke the callback, even though
- // this is synchronous?
-
/**
* Attempts to lock a resource. This method ignores the callback and always returns a
* {@link CompletedLockRequest}.