Program: 125216
Project: 125216
Buggy source:
public void syncAllPomsWithoutProgress(IProgressMonitor monitor) throws Exception {
  IRunProcessService runProcessService=getRunProcessService();
  List<IRepositoryViewObject> objects=new ArrayList<>();
  if (runProcessService != null) {
    for (    ERepositoryObjectType type : ERepositoryObjectType.getAllTypesOfProcess2()) {
      objects.addAll(ProxyRepositoryFactory.getInstance().getAll(type,true,true));
    }
  }
  BuildCacheManager.getInstance().clearAllCaches();
  int size=3 + (objects == null ? 0 : objects.size());
  monitor.setTaskName("String_Node_Str");
  monitor.beginTask("String_Node_Str",size);
  monitor.subTask("String_Node_Str");
  updateCodeProjects(monitor,true);
  monitor.worked(1);
  if (monitor.isCanceled()) {
    return;
  }
  List<String> modules=new ArrayList<>();
  if (objects != null) {
    IFilterService filterService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IFilterService.class)) {
      filterService=(IFilterService)GlobalServiceRegister.getDefault().getService(IFilterService.class);
    }
    String pomFilter=PomIdsHelper.getPomFilter();
    List<ERepositoryObjectType> allJobletTypes=ERepositoryObjectType.getAllTypesOfJoblet();
    for (    IRepositoryViewObject object : objects) {
      if (filterService != null) {
        if (!allJobletTypes.contains(object.getRepositoryObjectType()) && !filterService.isFilterAccepted(object.getProperty().getItem(),pomFilter)) {
          continue;
        }
      }
      if (object.getProperty() != null && object.getProperty().getItem() != null) {
        Item item=object.getProperty().getItem();
        if (ProjectManager.getInstance().isInCurrentMainProject(item)) {
          monitor.subTask("String_Node_Str" + item.getProperty().getLabel() + "String_Node_Str"+ item.getProperty().getVersion());
          runProcessService.generatePom(item);
          IFile pomFile=getItemPomFolder(item.getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
          if (pomFile.exists()) {
            modules.add(getModulePath(pomFile));
          }
        }
      }
      monitor.worked(1);
      if (monitor.isCanceled()) {
        return;
      }
    }
  }
  monitor.subTask("String_Node_Str");
  collectModules(modules);
  createRootPom(modules,true,monitor);
  monitor.worked(1);
  monitor.subTask("String_Node_Str");
  installRootPom(true);
  monitor.worked(1);
  if (monitor.isCanceled()) {
    return;
  }
  monitor.done();
}

Fixed version (ground truth):
public void syncAllPomsWithoutProgress(IProgressMonitor monitor) throws Exception {
  IRunProcessService runProcessService=getRunProcessService();
  List<IRepositoryViewObject> objects=new ArrayList<>();
  if (runProcessService != null) {
    for (    ERepositoryObjectType type : ERepositoryObjectType.getAllTypesOfProcess2()) {
      objects.addAll(ProxyRepositoryFactory.getInstance().getAll(type,true,true));
    }
  }
  BuildCacheManager.getInstance().clearAllCaches();
  int size=3 + (objects == null ? 0 : objects.size());
  monitor.setTaskName("String_Node_Str");
  monitor.beginTask("String_Node_Str",size);
  monitor.subTask("String_Node_Str");
  createRootPom(null,true,monitor);
  installRootPom(true);
  monitor.worked(1);
  if (monitor.isCanceled()) {
    return;
  }
  monitor.subTask("String_Node_Str");
  updateCodeProjects(monitor,true);
  monitor.worked(1);
  if (monitor.isCanceled()) {
    return;
  }
  List<String> modules=new ArrayList<>();
  if (objects != null) {
    IFilterService filterService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IFilterService.class)) {
      filterService=(IFilterService)GlobalServiceRegister.getDefault().getService(IFilterService.class);
    }
    String pomFilter=PomIdsHelper.getPomFilter();
    List<ERepositoryObjectType> allJobletTypes=ERepositoryObjectType.getAllTypesOfJoblet();
    for (    IRepositoryViewObject object : objects) {
      if (filterService != null) {
        if (!allJobletTypes.contains(object.getRepositoryObjectType()) && !filterService.isFilterAccepted(object.getProperty().getItem(),pomFilter)) {
          continue;
        }
      }
      if (object.getProperty() != null && object.getProperty().getItem() != null) {
        Item item=object.getProperty().getItem();
        if (ProjectManager.getInstance().isInCurrentMainProject(item)) {
          monitor.subTask("String_Node_Str" + item.getProperty().getLabel() + "String_Node_Str"+ item.getProperty().getVersion());
          runProcessService.generatePom(item);
          IFile pomFile=getItemPomFolder(item.getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
          if (pomFile.exists()) {
            modules.add(getModulePath(pomFile));
          }
        }
      }
      monitor.worked(1);
      if (monitor.isCanceled()) {
        return;
      }
    }
  }
  monitor.subTask("String_Node_Str");
  collectModules(modules);
  createRootPom(modules,true,monitor);
  installRootPom(true);
  monitor.worked(1);
  if (monitor.isCanceled()) {
    return;
  }
  monitor.done();
}