Program: 126213
Project: 126213
Buggy source:
/** 
 * update the modules list for project pom. The routines should be added always.
 */
protected void updateModulesList(IProgressMonitor monitor,IProcessor processor,Model projectModel) throws Exception {
  if (!isUpdateModules()) {
    return;
  }
  List<String> modulesList=new ArrayList<String>();
  String routinesModule=PomUtil.getPomFileName(TalendMavenConstants.DEFAULT_ROUTINES_ARTIFACT_ID);
  modulesList.add(routinesModule);
  if (processor != null) {
    for (    JobInfo childJob : processor.getBuildChildrenJobs()) {
      modulesList.add(PomUtil.getPomFileName(childJob.getJobName()));
    }
    modulesList.add(PomUtil.getPomFileName(processor.getProperty().getLabel()));
  }
  List<String> modules=projectModel.getModules();
  if (modules == null) {
    modules=new ArrayList<String>();
    projectModel.setModules(modules);
  }
 else   if (!modules.isEmpty()) {
    modules.clear();
  }
  modules.addAll(modulesList);
  IProject project=projectPomFile.getProject();
  project.refreshLocal(IResource.DEPTH_ONE,monitor);
  for (  String module : modules) {
    IFile file=project.getFile(module);
    if (file.exists()) {
      Model model=MODEL_MANAGER.readMavenModel(file);
      Parent parent=model.getParent();
      if (parent != null) {
        String projectGroupPrefix=JavaResourcesHelper.getGroupName(TalendMavenConstants.DEFAULT_MASTER);
        if (PomIdsHelper.FLAG_FIXING_GROUP_ID && !parent.getGroupId().equals(projectModel.getGroupId()) || !PomIdsHelper.FLAG_FIXING_GROUP_ID && !parent.getGroupId().startsWith(projectGroupPrefix)) {
          continue;
        }
        if (PomIdsHelper.FLAG_FIXING_ATIFACT_ID && !parent.getArtifactId().equals(projectModel.getArtifactId()) || !PomIdsHelper.FLAG_FIXING_ATIFACT_ID && !parent.getGroupId().startsWith(TalendMavenConstants.DEFAULT_CODE)) {
          continue;
        }
        PomUtil.checkParent(model,file);
        PomUtil.savePom(monitor,model,file);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * update the modules list for project pom. The routines should be added always.
 */
protected void updateModulesList(IProgressMonitor monitor,IProcessor processor,Model projectModel) throws Exception {
  if (!isUpdateModules()) {
    return;
  }
  List<String> modulesList=new ArrayList<String>();
  String routinesModule=PomUtil.getPomFileName(TalendMavenConstants.DEFAULT_ROUTINES_ARTIFACT_ID);
  modulesList.add(routinesModule);
  if (processor != null) {
    for (    JobInfo childJob : processor.getBuildChildrenJobs()) {
      modulesList.add(PomUtil.getPomFileName(childJob.getJobName()));
    }
    modulesList.add(PomUtil.getPomFileName(processor.getProperty().getLabel()));
  }
  List<String> modules=projectModel.getModules();
  if (modules == null) {
    modules=new ArrayList<String>();
    projectModel.setModules(modules);
  }
 else   if (!modules.isEmpty()) {
    modules.clear();
  }
  modules.addAll(modulesList);
  IProject project=projectPomFile.getProject();
  project.refreshLocal(IResource.DEPTH_ONE,monitor);
  for (  String module : modules) {
    IFile file=project.getFile(module);
    if (file.exists()) {
      Model model=MODEL_MANAGER.readMavenModel(file);
      Parent parent=model.getParent();
      if (parent != null) {
        if (parent.getGroupId().equals(projectModel.getGroupId())) {
          continue;
        }
        PomUtil.checkParent(model,file);
        PomUtil.savePom(monitor,model,file);
      }
    }
  }
}