Source:
public void deleteObject(String bucketName, String key, ElementFilter elementFilter, Status status ) throws RepoException { Lock writeLock = this.rwLocks.get(bucketName + key).writeLock(); writeLock.lock(); boolean rollback = false; try { sqlService.getConnection(); if (key == null) throw new RepoException(RepoException.Type.NoKeyEntered); if ((elementFilter == null || elementFilter.isEmpty())) { throw new RepoException(RepoException.Type.NoFilterEntered); } rollback = true; if (elementFilter.getTag() != null & elementFilter.getVersionChecksum() == null & elementFilter.getVersion() == null){ if (sqlService.listObjects(bucketName, 0, 10, false, false, elementFilter.getTag()).size() > 1){ throw new RepoException(RepoException.Type.MoreThanOneTaggedObject); } } RepoObject repoObject = sqlService.getObject(bucketName, key, elementFilter.getVersion(), elementFilter.getVersionChecksum(), elementFilter.getTag(), true, false); if (repoObject == null) { throw new RepoException(RepoException.Type.ObjectNotFound); } if (Status.DELETED.equals(status)){ if (sqlService.markObjectDeleted(key, bucketName, elementFilter.getVersion(), elementFilter.getVersionChecksum(), elementFilter.getTag()) == 0) throw new RepoException(RepoException.Type.ObjectNotFound); }else if (Status.PURGED.equals(status)){ purgeObjectContentAndDb(repoObject, elementFilter); } sqlService.transactionCommit(); rollback = false; } catch (SQLException e) { throw new RepoException(e); } finally { if (rollback) { sqlRollback("object " + bucketName + ", " + key + ", " + elementFilter); } sqlReleaseConnection(); writeLock.unlock(); } }

Target:
public void deleteObject(String bucketName, String key, ElementFilter elementFilter, Status status ) throws RepoException { Lock writeLock = this.rwLocks.get(bucketName + key).writeLock(); writeLock.lock(); boolean rollback = false; try { if (key == null) throw new RepoException(RepoException.Type.NoKeyEntered); if ((elementFilter == null || elementFilter.isEmpty())) { throw new RepoException(RepoException.Type.NoFilterEntered); } sqlService.getConnection(); rollback = true; if (elementFilter.getTag() != null & elementFilter.getVersionChecksum() == null & elementFilter.getVersion() == null){ if (sqlService.listObjects(bucketName, 0, 10, false, false, elementFilter.getTag()).size() > 1){ throw new RepoException(RepoException.Type.MoreThanOneTaggedObject); } } RepoObject repoObject = sqlService.getObject(bucketName, key, elementFilter.getVersion(), elementFilter.getVersionChecksum(), elementFilter.getTag(), true, false); if (repoObject == null) { throw new RepoException(RepoException.Type.ObjectNotFound); } if (Status.DELETED.equals(status)){ int objectDeteled = sqlService.markObjectDeleted(key, bucketName, elementFilter.getVersion(), elementFilter.getVersionChecksum(), elementFilter.getTag()); if (objectDeteled == 0) throw new RepoException(RepoException.Type.ObjectNotFound); } else if (Status.PURGED.equals(status)){ purgeObjectContentAndDb(repoObject, elementFilter); } sqlService.transactionCommit(); rollback = false; } catch (SQLException e) { throw new RepoException(e); } finally { if (rollback) { sqlRollback("object " + bucketName + ", " + key + ", " + elementFilter); } sqlReleaseConnection(); writeLock.unlock(); } }