Program: 185940
Project: 185940
Buggy source:
public static String calculateClasspath(IJavaProject javaProject){
  try {
    Set accumulatedPathEntries=new LinkedHashSet();
    IProject project=javaProject.getProject();
    String projectName=project.getName();
    IPath defaultOutputPath=javaProject.getOutputLocation();
    String defaultOutputLocation=pathToString(defaultOutputPath,project);
    IClasspathEntry[] cpes=javaProject.getResolvedClasspath(true);
    if (cpes != null) {
      for (int i=0, max=cpes.length; i < max; i++) {
        IClasspathEntry cpe=cpes[i];
        if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
          continue;
        }
        IPath cpePath=cpe.getPath();
        String pathElement=null;
        String segmentZero=cpePath.segment(0);
        if (segmentZero.equals(projectName)) {
          pathElement=project.getFile(cpePath.removeFirstSegments(1)).getRawLocation().toOSString();
        }
 else {
          if (cpe.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
            try {
              IProject iproject=project.getWorkspace().getRoot().getProject(segmentZero);
              if (iproject != null) {
                IFile ifile=iproject.getFile(cpePath.removeFirstSegments(1));
                IPath ipath=(ifile == null ? null : ifile.getRawLocation());
                pathElement=(ipath == null ? null : ipath.toOSString());
              }
            }
 catch (            Throwable t) {
              t.printStackTrace();
            }
          }
          if (cpe.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
            computeDependenciesFromProject(project,segmentZero,accumulatedPathEntries);
          }
 else {
            if (pathElement == null) {
              pathElement=cpe.getPath().toOSString();
            }
          }
        }
        if (pathElement != null) {
          accumulatedPathEntries.add(pathElement);
        }
      }
      accumulatedPathEntries.add(defaultOutputLocation);
      StringBuilder sb=new StringBuilder();
      Iterator iter=accumulatedPathEntries.iterator();
      while (iter.hasNext()) {
        sb.append((String)iter.next());
        sb.append(File.pathSeparator);
      }
      String classpath=sb.toString();
      return classpath;
    }
  }
 catch (  JavaModelException jme) {
    System.err.println("String_Node_Str" + javaProject.getProject().getName() + "String_Node_Str");
    jme.printStackTrace();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String calculateClasspath(IJavaProject javaProject){
  try {
    Set<String> accumulatedPathEntries=new LinkedHashSet<String>();
    IProject project=javaProject.getProject();
    String projectName=project.getName();
    IPath defaultOutputPath=javaProject.getOutputLocation();
    String defaultOutputLocation=pathToString(defaultOutputPath,project);
    IClasspathEntry[] cpes=javaProject.getResolvedClasspath(true);
    if (cpes != null) {
      for (      IClasspathEntry cpe : cpes) {
        if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
          continue;
        }
        IPath cpePath=cpe.getPath();
        String pathElement=null;
        String segmentZero=cpePath.segment(0);
        if (segmentZero.equals(projectName)) {
          pathElement=project.getFile(cpePath.removeFirstSegments(1)).getRawLocation().toOSString();
        }
 else {
          if (cpe.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
            try {
              IProject iproject=project.getWorkspace().getRoot().getProject(segmentZero);
              if (iproject != null) {
                IFile ifile=iproject.getFile(cpePath.removeFirstSegments(1));
                IPath ipath=(ifile == null ? null : ifile.getRawLocation());
                pathElement=(ipath == null ? null : ipath.toOSString());
              }
            }
 catch (            Throwable t) {
              t.printStackTrace();
            }
          }
          if (cpe.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
            computeDependenciesFromProject(project,segmentZero,accumulatedPathEntries);
          }
 else           if (pathElement == null) {
            pathElement=cpe.getPath().toOSString();
          }
        }
        if (pathElement != null) {
          accumulatedPathEntries.add(pathElement);
        }
      }
      accumulatedPathEntries.add(defaultOutputLocation);
      try {
        if (isGroovyNaturedProject(project)) {
          for (          IClasspathEntry entry : javaProject.getRawClasspath()) {
            if (entry.getOutputLocation() != null) {
              String location=pathToString(entry.getOutputLocation(),project);
              if (!defaultOutputLocation.equals(location)) {
                accumulatedPathEntries.add(location);
              }
            }
          }
        }
      }
 catch (      CoreException e) {
        System.err.println("String_Node_Str");
      }
      StringBuilder sb=new StringBuilder();
      for (      String entry : accumulatedPathEntries) {
        sb.append(entry).append(File.pathSeparator);
      }
      return sb.toString();
    }
  }
 catch (  JavaModelException jme) {
    System.err.println("String_Node_Str" + javaProject.getProject().getName() + ':');
    jme.printStackTrace();
  }
  return "String_Node_Str";
}