Program: 86508
Project: 86508
Buggy source:
/** 
 * Applies dependency overrides to the project.
 */
private void apply(final Project project,final Model model,final Map<ArtifactRef,String> overrides) throws ManipulationException {
  final WildcardMap<String> explicitOverrides=new WildcardMap<>();
  final String projectGA=ga(project);
  final DependencyState dependencyState=session.getState(DependencyState.class);
  final CommonState commonState=session.getState(CommonState.class);
  logger.info("String_Node_Str",projectGA);
  Map<ArtifactRef,String> moduleOverrides=new LinkedHashMap<>(overrides);
  moduleOverrides=removeReactorGAs(moduleOverrides);
  try {
    moduleOverrides=applyModuleVersionOverrides(projectGA,dependencyState.getDependencyExclusions(),moduleOverrides,explicitOverrides);
    logger.debug("String_Node_Str",moduleOverrides);
    logger.debug("String_Node_Str",explicitOverrides);
  }
 catch (  InvalidRefException e) {
    logger.error("String_Node_Str",moduleOverrides,explicitOverrides);
    throw e;
  }
  if (project.isInheritanceRoot()) {
    if (project.getModelParent() != null) {
      for (      Map.Entry<ArtifactRef,String> entry : moduleOverrides.entrySet()) {
        String oldValue=project.getModelParent().getVersion();
        String newValue=entry.getValue();
        if (entry.getKey().asProjectRef().equals(SimpleProjectRef.parse(ga(project.getModelParent())))) {
          if (commonState.getStrict()) {
            if (!PropertiesUtils.checkStrictValue(session,oldValue,newValue)) {
              if (commonState.getFailOnStrictViolation()) {
                throw new ManipulationException("String_Node_Str",ga(project.getModelParent()),newValue,oldValue);
              }
 else {
                logger.warn("String_Node_Str",ga(project.getModelParent()),newValue,oldValue);
                continue;
              }
            }
          }
          logger.debug("String_Node_Str",model.getParent().getVersion(),newValue,ga(project.getModelParent()));
          model.getParent().setVersion(newValue);
          break;
        }
      }
      HashMap<ProjectVersionRef,Dependency> pDepMap=new HashMap<>();
      Dependency d=new Dependency();
      d.setGroupId(project.getModelParent().getGroupId());
      d.setArtifactId(project.getModelParent().getArtifactId());
      d.setVersion(project.getModelParent().getVersion());
      pDepMap.put(SimpleProjectVersionRef.parse(d.getManagementKey()),d);
      applyExplicitOverrides(project,pDepMap,explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
      project.getModelParent().setVersion(d.getVersion());
    }
    if (session.getState(DependencyState.class).getOverrideDependencies()) {
      logger.debug("String_Node_Str",projectGA);
      final Map<ArtifactRef,String> nonMatchingVersionOverrides=applyOverrides(project,project.getResolvedManagedDependencies(session),explicitOverrides,moduleOverrides);
      final Map<ArtifactRef,String> matchedOverrides=new LinkedHashMap<>(moduleOverrides);
      matchedOverrides.keySet().removeAll(nonMatchingVersionOverrides.keySet());
      applyExplicitOverrides(project,project.getResolvedManagedDependencies(session),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
      if (commonState.getOverrideTransitive()) {
        final List<Dependency> extraDeps=new ArrayList<>();
        for (        final ArtifactRef var : overrides.keySet()) {
          if (!nonMatchingVersionOverrides.containsKey(var)) {
            continue;
          }
          final Dependency newDependency=new Dependency();
          newDependency.setGroupId(var.getGroupId());
          newDependency.setArtifactId(var.getArtifactId());
          newDependency.setType(var.getType());
          newDependency.setClassifier(var.getClassifier());
          final String artifactVersion=moduleOverrides.get(var);
          newDependency.setVersion(artifactVersion);
          extraDeps.add(newDependency);
          logger.debug("String_Node_Str",var,artifactVersion);
        }
        DependencyManagement dependencyManagement=model.getDependencyManagement();
        if (extraDeps.size() > 0) {
          if (dependencyManagement == null) {
            dependencyManagement=new DependencyManagement();
            model.setDependencyManagement(dependencyManagement);
            logger.debug("String_Node_Str");
          }
          dependencyManagement.getDependencies().addAll(0,extraDeps);
        }
      }
 else {
        logger.debug("String_Node_Str");
      }
    }
 else {
      logger.debug("String_Node_Str",projectGA);
    }
  }
 else {
    if (session.getState(DependencyState.class).getOverrideDependencies()) {
      logger.debug("String_Node_Str",projectGA);
      applyOverrides(project,project.getResolvedManagedDependencies(session),explicitOverrides,moduleOverrides);
      applyExplicitOverrides(project,project.getResolvedManagedDependencies(session),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
    }
 else {
      logger.debug("String_Node_Str",projectGA);
    }
  }
  if (session.getState(DependencyState.class).getOverrideDependencies()) {
    logger.debug("String_Node_Str",projectGA);
    applyOverrides(project,project.getResolvedDependencies(session),explicitOverrides,moduleOverrides);
    applyExplicitOverrides(project,project.getResolvedDependencies(session),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
    final HashMap<Profile,HashMap<ProjectVersionRef,Dependency>> pd=project.getResolvedProfileDependencies(session);
    final HashMap<Profile,HashMap<ProjectVersionRef,Dependency>> pmd=project.getResolvedProfileManagedDependencies(session);
    for (    Profile p : pd.keySet()) {
      applyOverrides(project,pd.get(p),explicitOverrides,moduleOverrides);
      applyExplicitOverrides(project,pd.get(p),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
    }
    for (    Profile p : pmd.keySet()) {
      applyOverrides(project,pmd.get(p),explicitOverrides,moduleOverrides);
      applyExplicitOverrides(project,pmd.get(p),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
    }
  }
 else {
    logger.debug("String_Node_Str",projectGA);
  }
}

Fixed version (ground truth):
/** 
 * Applies dependency overrides to the project.
 */
private void apply(final Project project,final Model model,final Map<ArtifactRef,String> overrides) throws ManipulationException {
  final WildcardMap<String> explicitOverrides=new WildcardMap<>();
  final String projectGA=ga(project);
  final DependencyState dependencyState=session.getState(DependencyState.class);
  final CommonState commonState=session.getState(CommonState.class);
  logger.info("String_Node_Str",projectGA);
  Map<ArtifactRef,String> moduleOverrides=new LinkedHashMap<>(overrides);
  moduleOverrides=removeReactorGAs(moduleOverrides);
  try {
    moduleOverrides=applyModuleVersionOverrides(projectGA,dependencyState.getDependencyExclusions(),moduleOverrides,explicitOverrides);
    logger.debug("String_Node_Str",moduleOverrides);
    logger.debug("String_Node_Str",explicitOverrides);
  }
 catch (  InvalidRefException e) {
    logger.error("String_Node_Str",moduleOverrides,explicitOverrides);
    throw e;
  }
  if (project.isInheritanceRoot()) {
    if (project.getModelParent() != null) {
      for (      Map.Entry<ArtifactRef,String> entry : moduleOverrides.entrySet()) {
        String oldValue=project.getModelParent().getVersion();
        String newValue=entry.getValue();
        if (entry.getKey().asProjectRef().equals(SimpleProjectRef.parse(ga(project.getModelParent())))) {
          if (commonState.getStrict()) {
            if (!PropertiesUtils.checkStrictValue(session,oldValue,newValue)) {
              if (commonState.getFailOnStrictViolation()) {
                throw new ManipulationException("String_Node_Str",ga(project.getModelParent()),newValue,oldValue);
              }
 else {
                logger.warn("String_Node_Str",ga(project.getModelParent()),newValue,oldValue);
                continue;
              }
            }
          }
          logger.debug("String_Node_Str",model.getParent().getVersion(),newValue,ga(project.getModelParent()));
          model.getParent().setVersion(newValue);
          break;
        }
      }
      HashMap<ArtifactRef,Dependency> pDepMap=new HashMap<>();
      Dependency d=new Dependency();
      d.setGroupId(project.getModelParent().getGroupId());
      d.setArtifactId(project.getModelParent().getArtifactId());
      d.setVersion(project.getModelParent().getVersion());
      pDepMap.put(SimpleArtifactRef.parse(d.getManagementKey()),d);
      applyExplicitOverrides(project,pDepMap,explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
      project.getModelParent().setVersion(d.getVersion());
    }
    if (session.getState(DependencyState.class).getOverrideDependencies()) {
      logger.debug("String_Node_Str",projectGA);
      final Map<ArtifactRef,String> nonMatchingVersionOverrides=applyOverrides(project,project.getResolvedManagedDependencies(session),explicitOverrides,moduleOverrides);
      final Map<ArtifactRef,String> matchedOverrides=new LinkedHashMap<>(moduleOverrides);
      matchedOverrides.keySet().removeAll(nonMatchingVersionOverrides.keySet());
      applyExplicitOverrides(project,project.getResolvedManagedDependencies(session),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
      if (commonState.getOverrideTransitive()) {
        final List<Dependency> extraDeps=new ArrayList<>();
        for (        final ArtifactRef var : overrides.keySet()) {
          if (!nonMatchingVersionOverrides.containsKey(var)) {
            continue;
          }
          final Dependency newDependency=new Dependency();
          newDependency.setGroupId(var.getGroupId());
          newDependency.setArtifactId(var.getArtifactId());
          newDependency.setType(var.getType());
          newDependency.setClassifier(var.getClassifier());
          final String artifactVersion=moduleOverrides.get(var);
          newDependency.setVersion(artifactVersion);
          extraDeps.add(newDependency);
          logger.debug("String_Node_Str",var,artifactVersion);
        }
        DependencyManagement dependencyManagement=model.getDependencyManagement();
        if (extraDeps.size() > 0) {
          if (dependencyManagement == null) {
            dependencyManagement=new DependencyManagement();
            model.setDependencyManagement(dependencyManagement);
            logger.debug("String_Node_Str");
          }
          dependencyManagement.getDependencies().addAll(0,extraDeps);
        }
      }
 else {
        logger.debug("String_Node_Str");
      }
    }
 else {
      logger.debug("String_Node_Str",projectGA);
    }
  }
 else {
    if (session.getState(DependencyState.class).getOverrideDependencies()) {
      logger.debug("String_Node_Str",projectGA);
      applyOverrides(project,project.getResolvedManagedDependencies(session),explicitOverrides,moduleOverrides);
      applyExplicitOverrides(project,project.getResolvedManagedDependencies(session),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
    }
 else {
      logger.debug("String_Node_Str",projectGA);
    }
  }
  if (session.getState(DependencyState.class).getOverrideDependencies()) {
    logger.debug("String_Node_Str",projectGA);
    applyOverrides(project,project.getResolvedDependencies(session),explicitOverrides,moduleOverrides);
    applyExplicitOverrides(project,project.getResolvedDependencies(session),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
    final HashMap<Profile,HashMap<ArtifactRef,Dependency>> pd=project.getResolvedProfileDependencies(session);
    final HashMap<Profile,HashMap<ArtifactRef,Dependency>> pmd=project.getResolvedProfileManagedDependencies(session);
    for (    Profile p : pd.keySet()) {
      applyOverrides(project,pd.get(p),explicitOverrides,moduleOverrides);
      applyExplicitOverrides(project,pd.get(p),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
    }
    for (    Profile p : pmd.keySet()) {
      applyOverrides(project,pmd.get(p),explicitOverrides,moduleOverrides);
      applyExplicitOverrides(project,pmd.get(p),explicitOverrides,commonState,explicitVersionPropertyUpdateMap);
    }
  }
 else {
    logger.debug("String_Node_Str",projectGA);
  }
}