[spotbugs] Don't use class from java.util.concurrent for locking
Use a dedicated Lock object to lock the scheduler in RepositoryCache#configureEviction to fix spotbugs warning JLM_JSR166_UTILCONCURRENT_MONITORENTER. Change-Id: I003dcf0ed1a0a3f4eea5d8a2f51a07473d28a928 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
50f0347ea3
commit
13e0ffbd3d
|
@ -201,6 +201,8 @@ static void reconfigure(RepositoryCacheConfig repositoryCacheConfig) {
|
|||
|
||||
private volatile long expireAfter;
|
||||
|
||||
private Object schedulerLock = new Lock();
|
||||
|
||||
private RepositoryCache() {
|
||||
cacheMap = new ConcurrentHashMap<>();
|
||||
openLocks = new Lock[4];
|
||||
|
@ -214,7 +216,7 @@ private void configureEviction(
|
|||
RepositoryCacheConfig repositoryCacheConfig) {
|
||||
expireAfter = repositoryCacheConfig.getExpireAfter();
|
||||
ScheduledThreadPoolExecutor scheduler = WorkQueue.getExecutor();
|
||||
synchronized (scheduler) {
|
||||
synchronized (schedulerLock) {
|
||||
if (cleanupTask != null) {
|
||||
cleanupTask.cancel(false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue