Program: 86530
Project: 86530
Buggy source:
/** 
 * Prescans the Project to build up a list of Project GAs and also the various Dependencies.
 */
@Override public void scan(final List<Project> projects,final ManipulationSession session) throws ManipulationException {
  final DependencyRESTState state=session.getState(DependencyRESTState.class);
  if (!session.isEnabled() || !state.isEnabled()) {
    logger.debug(getClass().getSimpleName() + "String_Node_Str");
    return;
  }
  for (  final Project project : projects) {
    restParam.add(project.getKey());
    recordDependencies(projects,localDeps,project.getManagedDependencies());
    recordDependencies(projects,localDeps,project.getDependencies());
    List<Profile> profiles=project.getModel().getProfiles();
    if (profiles != null) {
      for (      Profile p : profiles) {
        if (p.getDependencyManagement() != null) {
          recordDependencies(projects,localDeps,p.getDependencyManagement().getDependencies());
        }
        recordDependencies(projects,localDeps,p.getDependencies());
      }
    }
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + localDeps);
  }
  restResult=(Map<ProjectVersionRef,String>)load(state,session);
  Map<ProjectRef,Set<String>> versionStates=new HashMap<ProjectRef,Set<String>>();
  for (  final Project p : projects) {
    if (restResult.containsKey(p.getKey())) {
      Set<String> versions=versionStates.get(p.getKey().asProjectRef());
      if (versions == null) {
        versions=new HashSet<String>();
        versionStates.put(p.getKey().asProjectRef(),versions);
      }
      versions.add(restResult.get(p.getKey()));
    }
  }
  logger.debug("String_Node_Str" + versionStates);
  final VersioningState vs=session.getState(VersioningState.class);
  vs.setRESTMetadata(versionStates);
  logger.debug("String_Node_Str" + restResult);
}

Fixed version (ground truth):
/** 
 * Prescans the Project to build up a list of Project GAs and also the various Dependencies.
 */
@Override public void scan(final List<Project> projects,final ManipulationSession session) throws ManipulationException {
  final DependencyRESTState state=session.getState(DependencyRESTState.class);
  if (!session.isEnabled() || !state.isEnabled()) {
    logger.debug(getClass().getSimpleName() + "String_Node_Str");
    return;
  }
  for (  final Project project : projects) {
    restParam.add(project.getKey());
    recordDependencies(projects,localDeps,project.getManagedDependencies());
    recordDependencies(projects,localDeps,project.getDependencies());
    List<Profile> profiles=project.getModel().getProfiles();
    if (profiles != null) {
      for (      Profile p : profiles) {
        if (p.getDependencyManagement() != null) {
          recordDependencies(projects,localDeps,p.getDependencyManagement().getDependencies());
        }
        recordDependencies(projects,localDeps,p.getDependencies());
      }
    }
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + localDeps);
  }
  restResult=(Map<ProjectVersionRef,String>)load(state,session);
  Map<ProjectRef,Set<String>> versionStates=new HashMap<ProjectRef,Set<String>>();
  for (  final Project p : projects) {
    if (restResult.containsKey(p.getKey())) {
      Set<String> versions=versionStates.get(p.getKey().asProjectRef());
      if (versions == null) {
        versions=new HashSet<String>();
        versionStates.put(p.getKey().asProjectRef(),versions);
      }
      versions.add(restResult.get(p.getKey()));
    }
  }
  logger.debug("String_Node_Str" + versionStates);
  final VersioningState vs=session.getState(VersioningState.class);
  vs.setRESTMetadata(versionStates);
}