Program: 185951
Project: 185951
Buggy source:
/** 
 * Determine the exposed (exported) dependencies from the project named 'otherProject' and add them to the accumulatedPathEntries String Set. This will include the output location of the project plus other kinds of entry that are re-exported.  If dependent on another project and that project is re-exported, the method will recurse.
 * @param baseProject the original project for which the classpath is being computed
 * @param otherProject a project something in the dependency chain for the original project
 * @param accumulatedPathEntries a String set of classpath entries, into which new entries should be added
 */
private static void computeDependenciesFromProject(IProject baseProject,String otherProject,Set accumulatedPathEntries) throws JavaModelException {
  IProject iproject=baseProject.getWorkspace().getRoot().getProject(otherProject);
  IJavaProject ijp=JavaCore.create(iproject);
  accumulatedPathEntries.add(pathToString(ijp.getOutputLocation(),iproject));
  IClasspathEntry[] cpes=ijp.getResolvedClasspath(true);
  if (cpes != null) {
    for (int j=0; j < cpes.length; j++) {
      IClasspathEntry cpe=cpes[j];
      if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
        continue;
      }
      if (cpe.isExported()) {
        IPath cpePath=cpes[j].getPath();
        String segmentZero=cpePath.segment(0);
        if (segmentZero != null && segmentZero.equals(otherProject)) {
          accumulatedPathEntries.add(iproject.getFile(cpePath.removeFirstSegments(1)).getRawLocation().toOSString());
        }
 else {
          if (cpe.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
            computeDependenciesFromProject(baseProject,segmentZero,accumulatedPathEntries);
          }
 else {
            String otherPathElement=null;
            if (segmentZero != null && segmentZero.equals(iproject.getName())) {
              otherPathElement=iproject.getFile(cpePath.removeFirstSegments(1)).getRawLocation().toOSString();
            }
 else {
              otherPathElement=cpePath.toOSString();
            }
            accumulatedPathEntries.add(otherPathElement);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Determine the exposed (exported) dependencies from the project named 'otherProject' and add them to the accumulatedPathEntries String Set. This will include the output location of the project plus other kinds of entry that are re-exported.  If dependent on another project and that project is re-exported, the method will recurse.
 * @param baseProject the original project for which the classpath is being computed
 * @param otherProject a project something in the dependency chain for the original project
 * @param accumulatedPathEntries a String set of classpath entries, into which new entries should be added
 */
private static void computeDependenciesFromProject(IProject baseProject,String otherProject,Set<String> accumulatedPathEntries) throws JavaModelException {
  IProject iproject=baseProject.getWorkspace().getRoot().getProject(otherProject);
  IJavaProject iJavaProject=JavaCore.create(iproject);
  accumulatedPathEntries.add(pathToString(iJavaProject.getOutputLocation(),iproject));
  IClasspathEntry[] cpes=iJavaProject.getResolvedClasspath(true);
  if (cpes != null) {
    for (    IClasspathEntry cpe : cpes) {
      if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE && cpe.getOutputLocation() != null) {
        accumulatedPathEntries.add(pathToString(cpe.getOutputLocation(),iproject));
      }
 else       if (cpe.isExported()) {
        IPath cpePath=cpe.getPath();
        String segmentZero=cpePath.segment(0);
        if (segmentZero != null && segmentZero.equals(otherProject)) {
          accumulatedPathEntries.add(iproject.getFile(cpePath.removeFirstSegments(1)).getRawLocation().toOSString());
        }
 else         if (cpe.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
          computeDependenciesFromProject(baseProject,segmentZero,accumulatedPathEntries);
        }
 else {
          String otherPathElement=null;
          if (segmentZero != null && segmentZero.equals(iproject.getName())) {
            otherPathElement=iproject.getFile(cpePath.removeFirstSegments(1)).getRawLocation().toOSString();
          }
 else {
            otherPathElement=cpePath.toOSString();
          }
          accumulatedPathEntries.add(otherPathElement);
        }
      }
    }
  }
}