Small refactor

This commit is contained in:
George Kalampokis 2020-02-14 10:37:24 +02:00
parent a8fa0312d1
commit c50cae7f6c
1 changed files with 2 additions and 4 deletions

View File

@ -57,9 +57,7 @@ public class LockManager {
this.createOrUpdate(new Lock().fromDataModel(lock), principal);
return false;
}
if (this.forceUnlock(targetId) > 0){
return true;
}
return this.forceUnlock(targetId) > 0;
} else if (availableLocks > 1) {
this.forceUnlock(targetId);
return this.isLocked(targetId, principal);
@ -71,7 +69,7 @@ public class LockManager {
LockCriteria criteria = new LockCriteria();
criteria.setTarget(UUID.fromString(targetId));
Long availableLocks = this.apiContext.getOperationsContext().getDatabaseRepository().getLockDao().getWithCriteria(criteria).count();
Long deletedLocks = 0L;
long deletedLocks = 0L;
if (availableLocks > 0) {
List<eu.eudat.data.entities.Lock> locks = this.apiContext.getOperationsContext().getDatabaseRepository().getLockDao().getWithCriteria(criteria).toList();
for (eu.eudat.data.entities.Lock lock : locks) {