Program: 125709
Project: 125709
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>();
  List<String> codesModules=PomUtil.getMavenCodesModules(processor != null ? processor.getProcess() : null);
  for (  String module : codesModules) {
    modulesList.add(module);
  }
  if (processor != null) {
    for (    JobInfo childJob : processor.getBuildChildrenJobs()) {
      modulesList.add(PomUtil.getPomFileName(childJob.getJobName(),childJob.getJobVersion()));
    }
    modulesList.add(PomUtil.getPomFileName(processor.getProperty().getLabel(),processor.getProperty().getVersion()));
  }
  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);
      }
    }
  }
}

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>();
  List<String> codesModules=PomUtil.getMavenCodesModules(processor != null ? processor.getProcess() : null);
  for (  String module : codesModules) {
    modulesList.add(module);
  }
  if (processor != null) {
    String mainPom=PomUtil.getPomFileName(processor.getProperty().getLabel(),processor.getProperty().getVersion());
    for (    JobInfo childJob : processor.getBuildChildrenJobs()) {
      String childPom=PomUtil.getPomFileName(childJob.getJobName(),childJob.getJobVersion());
      if (!childPom.equals(mainPom)) {
        modulesList.add(childPom);
      }
    }
    modulesList.add(mainPom);
  }
  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);
      }
    }
  }
}