Source:
<code>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)){ <START> if (sqlService.markObjectDeleted(key, bucketName, elementFilter.getVersion(), elementFilter.getVersionChecksum(), elementFilter.getTag()) == 0) <END> 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(); } }</code><technical_language>This is hard read long markObjectDeleted call if statement. I extract previous line (and save result a local variable)</technical_language>

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(); } }