Program: 95389
Project: 95389
Buggy source:
/** 
 * Recursively searches for projects that cannot be used by the given  project. The current rules are as follows: 1. No circular dependencies. This means that a project 'A' can not use  itself nor any project that uses 'A' (this rule is, of course,  transitive).
 * @param projectToCheck The project for which reused/reusable projects arebeing checked.
 * @param checkedProjects Projects that have already been examined by thismethod.
 * @param illegalProjects Projects marked as not reusable by this method.
 * @param projectsToImport Projects that are currently being imported.Reused projects will be searched for by first looking through this collection, and, if the  project is not found there, looking in the # database. May be <code>null</code>.
 */
public static void findIllegalProjects(IProjectPO projectToCheck,Set<IProjectPO> checkedProjects,Set<IProjectPO> illegalProjects,Set<IProjectPO> projectsToImport){
  if (!checkedProjects.contains(projectToCheck)) {
    checkedProjects.add(projectToCheck);
    for (    IReusedProjectPO reused : projectToCheck.getUsedProjects()) {
      try {
        String reusedGuid=reused.getProjectGuid();
        IProjectPO reusedProject=null;
        if (projectsToImport != null) {
          for (          IProjectPO importedProject : projectsToImport) {
            if (reusedGuid.equals(importedProject.getGuid()) && reused.getProjectVersion().equals(importedProject.getProjectVersion())) {
              reusedProject=importedProject;
              break;
            }
          }
        }
        if (reusedProject == null) {
          reusedProject=loadProjectByGuidAndVersion(reused.getProjectGuid(),reused.getMajorNumber(),reused.getMinorNumber(),reused.getMicroNumber(),reused.getVersionQualifier());
        }
        if (reusedProject != null) {
          findIllegalProjects(reusedProject,checkedProjects,illegalProjects,projectsToImport);
        }
      }
 catch (      JBException e) {
        illegalProjects.add(projectToCheck);
      }
      for (      IProjectPO project : illegalProjects) {
        if (project.getGuid().equals(reused.getProjectGuid()) && project.getMajorProjectVersion().equals(reused.getMajorNumber()) && project.getMinorProjectVersion().equals(reused.getMinorNumber())) {
          illegalProjects.add(projectToCheck);
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Recursively searches for projects that cannot be used by the given  project. The current rules are as follows: 1. No circular dependencies. This means that a project 'A' can not use  itself nor any project that uses 'A' (this rule is, of course,  transitive).
 * @param projectToCheck The project for which reused/reusable projects arebeing checked.
 * @param checkedProjects Projects that have already been examined by thismethod.
 * @param illegalProjects Projects marked as not reusable by this method.
 * @param projectsToImport Projects that are currently being imported.Reused projects will be searched for by first looking through this collection, and, if the  project is not found there, looking in the # database. May be <code>null</code>.
 */
public static void findIllegalProjects(IProjectPO projectToCheck,Set<IProjectPO> checkedProjects,Set<IProjectPO> illegalProjects,Set<IProjectPO> projectsToImport){
  if (!checkedProjects.contains(projectToCheck)) {
    checkedProjects.add(projectToCheck);
    for (    IReusedProjectPO reused : projectToCheck.getUsedProjects()) {
      try {
        String reusedGuid=reused.getProjectGuid();
        IProjectPO reusedProject=null;
        if (projectsToImport != null) {
          for (          IProjectPO importedProject : projectsToImport) {
            if (reusedGuid.equals(importedProject.getGuid()) && reused.getProjectVersion().equals(importedProject.getProjectVersion())) {
              reusedProject=importedProject;
              break;
            }
          }
        }
        if (reusedProject == null) {
          reusedProject=loadProjectByGuidAndVersion(reused.getProjectGuid(),reused.getMajorNumber(),reused.getMinorNumber(),reused.getMicroNumber(),reused.getVersionQualifier());
        }
        if (reusedProject != null) {
          findIllegalProjects(reusedProject,checkedProjects,illegalProjects,projectsToImport);
        }
      }
 catch (      JBException e) {
        illegalProjects.add(projectToCheck);
      }
      for (      IProjectPO project : illegalProjects) {
        if (project.getGuid().equals(reused.getProjectGuid()) && project.getProjectVersion().equals(reused.getProjectVersion())) {
          illegalProjects.add(projectToCheck);
          break;
        }
      }
    }
  }
}