Source:
private void setContainerDependencies(final PublisherFilter publisherFilter) { try { List<Container> containerList = new ArrayList<>(); for (String id : containersSet) { Container c = APILocator.getContainerAPI().getWorkingContainerById(id, user, false); if(publisherFilter.acceptExcludeDependencyClasses(PusheableAsset.SITE.getType())) { Host h = APILocator.getContainerAPI().getParentHost(c, user, false); hosts.addOrClean(APILocator.getContainerAPI().getParentHost(c, user, false) .getIdentifier(), h.getModDate()); } containerList.clear(); if(publisherFilter.acceptExcludeDependencyClasses(PusheableAsset.CONTENT_TYPE.getType())) { Container workingContainer = APILocator.getContainerAPI() .getWorkingContainerById(id, user, false); if (workingContainer != null) { containerList.add(workingContainer); } Container liveContainer = APILocator.getContainerAPI() .getLiveContainerById(id, user, false); if (liveContainer != null) { containerList.add(liveContainer); } for (Container container : containerList) { List<ContainerStructure> csList = APILocator.getContainerAPI() .getContainerStructures(container); for (ContainerStructure containerStructure : csList) { Structure st = CacheLocator.getContentTypeCache() .getStructureByInode(containerStructure.getStructureId()); contentTypes.addOrClean(containerStructure.getStructureId(), st.getModDate()); contentTypesSet.add(containerStructure.getStructureId()); } } } } final List<Folder> folders = collectFileAssetContainer().stream() .map(this::collectFileAssetContainerDependencies).flatMap(Collection::stream) .collect(Collectors.toList()); setFolderListDependencies(folders, publisherFilter); } catch (DotSecurityException e) { Logger.error(this, e.getMessage(),e); } catch (DotDataException e) { Logger.error(this, e.getMessage(),e); } }

Target:
private void setContainerDependencies(final PublisherFilter publisherFilter) { try { final List<Container> containerList = new ArrayList<>(); for (final String id : containersSet) { final Container containerById = APILocator.getContainerAPI().getWorkingContainerById(id, user, false); if(!publisherFilter.doesExcludeDependencyClassesContainsType(PusheableAsset.SITE.getType())) { final Host host = APILocator.getContainerAPI().getParentHost(containerById, user, false); hosts.addOrClean(APILocator.getContainerAPI().getParentHost(containerById, user, false) .getIdentifier(), host.getModDate()); } containerList.clear(); if(!publisherFilter.doesExcludeDependencyClassesContainsType(PusheableAsset.CONTENT_TYPE.getType())) { final Container workingContainer = APILocator.getContainerAPI() .getWorkingContainerById(id, user, false); if (workingContainer != null) { containerList.add(workingContainer); } final Container liveContainer = APILocator.getContainerAPI() .getLiveContainerById(id, user, false); if (liveContainer != null) { containerList.add(liveContainer); } for (final Container container : containerList) { final List<ContainerStructure> csList = APILocator.getContainerAPI() .getContainerStructures(container); for (final ContainerStructure containerStructure : csList) { final Structure structure = CacheLocator.getContentTypeCache() .getStructureByInode(containerStructure.getStructureId()); contentTypes.addOrClean(containerStructure.getStructureId(), structure.getModDate()); contentTypesSet.add(containerStructure.getStructureId()); } } } } final List<Folder> folders = collectFileAssetContainer().stream() .map(this::collectFileAssetContainerDependencies).flatMap(Collection::stream) .collect(Collectors.toList()); setFolderListDependencies(folders, publisherFilter); } catch (DotSecurityException e) { Logger.error(this, e.getMessage(),e); } catch (DotDataException e) { Logger.error(this, e.getMessage(),e); } }