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>
private volatile long expireAfter;
+ private Object schedulerLock = new Lock();
+
private RepositoryCache() {
cacheMap = new ConcurrentHashMap<>();
openLocks = new Lock[4];
RepositoryCacheConfig repositoryCacheConfig) {
expireAfter = repositoryCacheConfig.getExpireAfter();
ScheduledThreadPoolExecutor scheduler = WorkQueue.getExecutor();
- synchronized (scheduler) {
+ synchronized (schedulerLock) {
if (cleanupTask != null) {
cleanupTask.cancel(false);
}