Small refactor
This commit is contained in:
parent
a8fa0312d1
commit
c50cae7f6c
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue