RepositoryCache: declare schedulerLock final

This fixes errorprone error [SynchronizeOnNonFinalField]: Synchronizing
on non-final fields is not safe: if the field is ever updated, different
threads may end up locking on different objects.

Change-Id: I42fe5bde825151693e2da2d5b6cd6e1d34038dbc
This commit is contained in:
Matthias Sohn 2020-12-28 02:21:17 +01:00
parent d9143287b7
commit 74d5a1c172
1 changed files with 1 additions and 1 deletions

View File

@ -202,7 +202,7 @@ static void reconfigure(RepositoryCacheConfig repositoryCacheConfig) {
private volatile long expireAfter;
private Object schedulerLock = new Lock();
private final Object schedulerLock = new Lock();
private RepositoryCache() {
cacheMap = new ConcurrentHashMap<>();