Program: 136071
Project: 136071
Buggy source:
/** 
 * Checks whether the checkpoint files exist for a given model 
 * @param launchConfig
 * @return the array of checkpoint directories, sorted from last to first
 */
public static IResource[] getCheckpoints(ILaunchConfiguration config) throws CoreException {
  Pattern pattern=Pattern.compile("String_Node_Str");
  Vector checkpoints=new Vector();
  IFolder directory=getModelTargetDirectory(config);
  if (directory != null && directory.exists()) {
    directory.refreshLocal(IResource.DEPTH_ONE,null);
    IResource[] members=directory.members();
    for (int i=0; i < members.length; i++) {
      if (members[i].getType() == IResource.FOLDER) {
        Matcher matcher=pattern.matcher(members[i].getName());
        if (matcher.matches()) {
          members[i].refreshLocal(IResource.DEPTH_ONE,null);
          if (((IFolder)members[i]).findMember(CHECKPOINT_QUEUE) != null && ((IFolder)members[i]).findMember(CHECKPOINT_VARS) != null && ((IFolder)members[i]).findMember(CHECKPOINT_STATES) != null) {
            checkpoints.add(members[i]);
          }
        }
      }
    }
  }
  IResource[] result=(IResource[])checkpoints.toArray(new IResource[checkpoints.size()]);
  Arrays.sort(result,new Comparator(){
    public int compare(    Object arg0,    Object arg1){
      return ((IResource)arg0).getName().compareTo(((IResource)arg1).getName());
    }
  }
);
  return result;
}

Fixed version (ground truth):
/** 
 * Checks whether the checkpoint files exist for a given model If doRefresh is set to true, this method will refresh the model directory, and if a checkpoint folder is found, it will refresh the contents of that folder. This means that the eclipse workspace representation of that directory will synch with the file system. This is a long running job, so this method should not be called within the run method of another job unless the scheduling rule for refreshing the model directory is included in the scheduling rule of the job which is calling this method. This scheduling rule can be found by calling  {@link IResourceRuleFactory#refreshRule(IResource)}
 * @param config
 * @param doRefresh whether the model directory's contents and any checkpointfolders contents should be refreshed
 * @return the array of checkpoint directories, sorted from last to first
 */
public static IResource[] getCheckpoints(ILaunchConfiguration config,boolean doRefresh) throws CoreException {
  Pattern pattern=Pattern.compile("String_Node_Str");
  Vector checkpoints=new Vector();
  IFolder directory=getModelTargetDirectory(config);
  if (directory != null && directory.exists()) {
    if (doRefresh) {
      directory.refreshLocal(IResource.DEPTH_ONE,null);
    }
    IResource[] members=directory.members();
    for (int i=0; i < members.length; i++) {
      if (members[i].getType() == IResource.FOLDER) {
        Matcher matcher=pattern.matcher(members[i].getName());
        if (matcher.matches()) {
          if (doRefresh) {
            members[i].refreshLocal(IResource.DEPTH_ONE,null);
          }
          if (((IFolder)members[i]).findMember(CHECKPOINT_QUEUE) != null && ((IFolder)members[i]).findMember(CHECKPOINT_VARS) != null && ((IFolder)members[i]).findMember(CHECKPOINT_STATES) != null) {
            checkpoints.add(members[i]);
          }
        }
      }
    }
  }
  IResource[] result=(IResource[])checkpoints.toArray(new IResource[checkpoints.size()]);
  Arrays.sort(result,new Comparator(){
    public int compare(    Object arg0,    Object arg1){
      return ((IResource)arg0).getName().compareTo(((IResource)arg1).getName());
    }
  }
);
  return result;
}