Source:
private void setLinkDependencies(final PublisherFilter publisherFilter) { for(String linkId : linksSet) { try { Identifier ident=APILocator.getIdentifierAPI().find(linkId); if(publisherFilter.acceptExcludeDependencyClasses(PusheableAsset.FOLDER.getType())) { Folder ff = APILocator.getFolderAPI() .findFolderByPath(ident.getParentPath(), ident.getHostId(), user, false); folders.addOrClean(ff.getInode(), ff.getModDate()); foldersSet.add(ff.getInode()); } if(publisherFilter.acceptExcludeDependencyClasses(PusheableAsset.SITE.getType())) { Host hh = APILocator.getHostAPI().find(ident.getHostId(), user, false); hosts.addOrClean(hh.getIdentifier(), hh.getModDate()); hostsSet.add(hh.getIdentifier()); } if(publisherFilter.acceptExcludeDependencyClasses(PusheableAsset.CONTENTLET.getType())) { Link link = APILocator.getMenuLinkAPI() .findWorkingLinkById(linkId, user, false); if (link != null) { if (link.getLinkType().equals(Link.LinkType.INTERNAL.toString())) { Identifier id = APILocator.getIdentifierAPI() .find(link.getInternalLinkIdentifier()); if (InodeUtils.isSet(id.getInode()) && id.getAssetType() .equals("contentlet")) { List<Contentlet> contentList = APILocator.getContentletAPI() .search("+identifier:" + id.getId(), 0, 0, "moddate", user, false); for (Contentlet contentlet : contentList) { if(publisherFilter.acceptExcludeDependencyQuery(contentlet.getIdentifier())) { contents.addOrClean(contentlet.getIdentifier(), contentlet.getModDate()); contentsSet.add(contentlet.getIdentifier()); } } } } } } } catch (Exception e) { Logger.error(this, "can't load menuLink deps "+linkId,e); } } }

Target:
private void setLinkDependencies(final PublisherFilter publisherFilter) { for(String linkId : linksSet) { try { Identifier ident=APILocator.getIdentifierAPI().find(linkId); if(!publisherFilter.doesExcludeDependencyClassesContainsType(PusheableAsset.FOLDER.getType())) { final Folder folder = APILocator.getFolderAPI() .findFolderByPath(ident.getParentPath(), ident.getHostId(), user, false); folders.addOrClean(folder.getInode(), folder.getModDate()); foldersSet.add(folder.getInode()); } if(!publisherFilter.doesExcludeDependencyClassesContainsType(PusheableAsset.SITE.getType())) { final Host host = APILocator.getHostAPI().find(ident.getHostId(), user, false); hosts.addOrClean(host.getIdentifier(), host.getModDate()); hostsSet.add(host.getIdentifier()); } if(!publisherFilter.doesExcludeDependencyClassesContainsType(PusheableAsset.CONTENTLET.getType())) { final Link link = APILocator.getMenuLinkAPI() .findWorkingLinkById(linkId, user, false); if (link != null) { if (link.getLinkType().equals(Link.LinkType.INTERNAL.toString())) { final Identifier id = APILocator.getIdentifierAPI() .find(link.getInternalLinkIdentifier()); if (InodeUtils.isSet(id.getInode()) && id.getAssetType() .equals("contentlet")) { final List<Contentlet> contentList = APILocator.getContentletAPI() .search("+identifier:" + id.getId(), 0, 0, "moddate", user, false); for (final Contentlet contentlet : contentList) { if(!publisherFilter.doesExcludeDependencyQueryContainsContentletId(contentlet.getIdentifier())) { contents.addOrClean(contentlet.getIdentifier(), contentlet.getModDate()); contentsSet.add(contentlet.getIdentifier()); } } } } } } } catch (Exception e) { Logger.error(this, "can't load menuLink deps "+linkId,e); } } }