diff options
author | Jim Hahn <jrh3@att.com> | 2021-06-18 14:47:59 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-06-18 14:51:36 -0400 |
commit | 3dbcd3ceb1f71626d1e35da01fd3ecbaa7fb58d7 (patch) | |
tree | 509bcebb2bb91c66838b010ae9325127551724ed /policy-management/src | |
parent | d140a8d92f53bf4e51d4c69c570a68e2dc3c30fd (diff) |
Fix new checkstyle issues in drools-pdp
The new version of checkstyle identified new issues. Fixed those.
Also addressed sonar "var" issues.
Issue-ID: POLICY-3289
Change-Id: I3a18d3988202dca6f3c87f2aa1810bf803a9d14d
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-management/src')
-rw-r--r-- | policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java b/policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java index eee2a50e..88037bbb 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java +++ b/policy-management/src/main/java/org/onap/policy/drools/system/internal/LockManager.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019, 2021 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. @@ -143,14 +143,14 @@ public abstract class LockManager<T extends FeatureLockImpl> implements PolicyRe boolean waitForLock) { if (hasInstanceChanged()) { - AlwaysFailLock lock = new AlwaysFailLock(resourceId, ownerKey, holdSec, callback); + var lock = new AlwaysFailLock(resourceId, ownerKey, holdSec, callback); lock.notifyUnavailable(); return lock; } T lock = makeLock(LockState.WAITING, resourceId, ownerKey, holdSec, callback); - T existingLock = resource2lock.putIfAbsent(resourceId, lock); + var existingLock = resource2lock.putIfAbsent(resourceId, lock); if (existingLock == null) { logger.debug("added lock to map {}", lock); @@ -192,6 +192,6 @@ public abstract class LockManager<T extends FeatureLockImpl> implements PolicyRe * lost; must not be {@code null} * @return a new lock */ - protected abstract T makeLock(LockState waiting, String resourceId, String ownerKey, int holdSec, + protected abstract T makeLock(LockState state, String resourceId, String ownerKey, int holdSec, LockCallback callback); } |