mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-05 11:50:58 +01:00
Fix put to cache check
putIfAbsent should return null, whenever there was no value for the key before it was put with the call. But however this does not seem to work with the concurrent hash map (liskov?)
This commit is contained in:
@@ -79,7 +79,8 @@ public class CachingAllWorkdirProvider implements CacheSupportingWorkdirProvider
|
||||
@Override
|
||||
public void contextClosed(CreateWorkdirContext<?, ?, ?> createWorkdirContext, File workdir) throws IOException {
|
||||
String id = createWorkdirContext.getScmRepository().getId();
|
||||
if (workdirs.putIfAbsent(id, workdir) != null) {
|
||||
File putResult = workdirs.putIfAbsent(id, workdir);
|
||||
if (putResult != null && putResult != workdir) {
|
||||
deleteWorkdir(workdir);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user