Source:
<code>public void runJob() { log.debug("Creating content AIPS for deposit {}", getDepositPID()); Model model = getReadOnlyModel(); log.debug("Ingesting content for deposit containing objects", getDepositPID()); Map<String, String> depositStatus = getDepositStatus(); String destinationPath = depositStatus.get(DepositField.containerId.name()); PID destinationPid = PIDs.get(destinationPath); if (destinationPid == null) { failJob("Invalid destination URI", "The provide destination uri " + destinationPath + " was not a valid repository path"); } ContentObject destObj = repository.getContentObject(PIDs.get( depositStatus.get(DepositField.containerId.name()))); if (!(destObj instanceof ContentContainerObject)) { failJob("Cannot add children to destination", "Cannot deposit to destination " + destObj.getPid().getRepositoryPath() + ", types does not support children"); } String groups = depositStatus.get(DepositField.permissionGroups.name()); <START> aclService.assertHasAccess( <END> "Depositor does not have permissions to ingest to destination " + destObj.getPid(), destObj.getPid(), new AccessGroupSet(groups), Permission.ingest); Bag depositBag = model.getBag(getDepositPID().getRepositoryPath()); calculateWorkRemaining(depositBag); if (!resumed) { getDepositStatusFactory().setIngestInprogress(getDepositUUID(), true); } try { ingestChildren((ContentContainerObject) destObj, depositBag); addIngestionEventForContainer((ContentContainerObject) destObj, depositBag.asResource()); } catch (DepositException | FedoraException | IOException e) { failJob(e, "Failed to ingest content for deposit {0}", getDepositPID().getQualifiedId()); } }</code><technical_language>A small thing, store destObj.getPid() in a variable avoid duplicate calls</technical_language>

Target:
public void runJob() { log.debug("Creating content AIPS for deposit {}", getDepositPID()); Model model = getReadOnlyModel(); log.debug("Ingesting content for deposit containing objects", getDepositPID()); Map<String, String> depositStatus = getDepositStatus(); String destinationPath = depositStatus.get(DepositField.containerId.name()); PID destinationPid = PIDs.get(destinationPath); if (destinationPid == null) { failJob("Invalid destination URI", "The provide destination uri " + destinationPath + " was not a valid repository path"); } PID destPid = PIDs.get(depositStatus.get(DepositField.containerId.name())); ContentObject destObj = repository.getContentObject(destPid); if (!(destObj instanceof ContentContainerObject)) { failJob("Cannot add children to destination", "Cannot deposit to destination " + destPid + ", types does not support children"); } String groups = depositStatus.get(DepositField.permissionGroups.name()); aclService.assertHasAccess( "Depositor does not have permissions to ingest to destination " + destPid, destPid, new AccessGroupSet(groups), Permission.ingest); Bag depositBag = model.getBag(getDepositPID().getRepositoryPath()); calculateWorkRemaining(depositBag); if (!resumed) { getDepositStatusFactory().setIngestInprogress(getDepositUUID(), true); } try { ingestChildren((ContentContainerObject) destObj, depositBag); addIngestionEventForContainer((ContentContainerObject) destObj, depositBag.asResource()); } catch (DepositException | FedoraException | IOException e) { failJob(e, "Failed to ingest content for deposit {0}", getDepositPID().getQualifiedId()); } }