Program: 126212
Project: 126212
Buggy source:
/** 
 * If standard job and base job pom file existed, will use the dependences of job pom directly.
 */
protected void updateDependencies(IProgressMonitor monitor,IProcessor processor,Model projectModel) throws Exception {
  if (!isUpdateDependencies()) {
    return;
  }
  IFile basePomFile=getBasePomFile();
  if (isStandardJob() && basePomFile != null && basePomFile.getLocation().toFile().exists()) {
    if (!basePomFile.exists()) {
      basePomFile.getParent().refreshLocal(IResource.DEPTH_ONE,monitor);
    }
    Model jobModel=MODEL_MANAGER.readMavenModel(basePomFile);
    List<Dependency> withoutChildrenJobDependencies=new ArrayList<Dependency>(jobModel.getDependencies());
    final String jobGroupPrefix=PomIdsHelper.getJobGroupId((String)null);
    Iterator<Dependency> iterator=withoutChildrenJobDependencies.iterator();
    while (iterator.hasNext()) {
      Dependency d=iterator.next();
      if (d.getGroupId().startsWith(jobGroupPrefix)) {
        iterator.remove();
      }
    }
    ProcessorDependenciesManager.updateDependencies(monitor,projectModel,withoutChildrenJobDependencies,false);
  }
 else   if (processor != null) {
    ProcessorDependenciesManager processorDependenciesManager=new ProcessorDependenciesManager(processor);
    processorDependenciesManager.updateDependencies(monitor,projectModel);
  }
 else {
    IFile routinesPomFile=projectPomFile.getProject().getFile(PomUtil.getPomFileName(TalendMavenConstants.DEFAULT_ROUTINES_ARTIFACT_ID));
    Model routinesModel=MavenTemplateManager.getRoutinesTempalteModel();
    if (routinesPomFile.exists()) {
      routinesModel=MODEL_MANAGER.readMavenModel(routinesPomFile);
    }
    List<Dependency> routinesDependencies=routinesModel.getDependencies();
    ProcessorDependenciesManager.updateDependencies(monitor,projectModel,routinesDependencies,true);
  }
  PomUtil.installDependencies(projectModel.getDependencies());
}

Fixed version (ground truth):
/** 
 * If standard job and base job pom file existed, will use the dependences of job pom directly.
 */
protected void updateDependencies(IProgressMonitor monitor,IProcessor processor,Model projectModel) throws Exception {
  if (!isUpdateDependencies()) {
    return;
  }
  IFile basePomFile=getBasePomFile();
  if (isStandardJob() && basePomFile != null && basePomFile.getLocation().toFile().exists()) {
    if (!basePomFile.exists()) {
      basePomFile.getParent().refreshLocal(IResource.DEPTH_ONE,monitor);
    }
    Model jobModel=MODEL_MANAGER.readMavenModel(basePomFile);
    List<Dependency> withoutChildrenJobDependencies=new ArrayList<Dependency>(jobModel.getDependencies());
    final String jobGroupPrefix=PomIdsHelper.getJobGroupId((String)null);
    Iterator<Dependency> iterator=withoutChildrenJobDependencies.iterator();
    while (iterator.hasNext()) {
      Dependency d=iterator.next();
      if (d.getGroupId().startsWith(jobGroupPrefix)) {
        iterator.remove();
      }
    }
    ProcessorDependenciesManager.updateDependencies(monitor,projectModel,withoutChildrenJobDependencies,false);
  }
 else   if (processor != null) {
    ProcessorDependenciesManager processorDependenciesManager=new ProcessorDependenciesManager(processor);
    processorDependenciesManager.updateDependencies(monitor,projectModel);
  }
 else {
    IFile routinesPomFile=projectPomFile.getProject().getFile(PomUtil.getPomFileName(TalendMavenConstants.DEFAULT_ROUTINES_ARTIFACT_ID));
    Model routinesModel=MavenTemplateManager.getRoutinesTempalteModel();
    if (routinesPomFile.exists()) {
      routinesModel=MODEL_MANAGER.readMavenModel(routinesPomFile);
    }
    List<Dependency> routinesDependencies=routinesModel.getDependencies();
    ProcessorDependenciesManager.updateDependencies(monitor,projectModel,routinesDependencies,true);
  }
}