Program: 102334
Project: 102334
Buggy source:
/** 
 * @param project the project whose Preview VDBs are being requested
 * @param onlyThoseNeedingToBeDeployed <code>true</code> if only Preview VDBs needing to be deployed should be returned
 * @return the project Preview VDBs (never <code>null</code>)
 */
List<IFile> findProjectPvdbs(IProject project,boolean onlyThoseNeedingToBeDeployed){
  List<IFile> pvdbsToDeploy=new ArrayList<IFile>();
  Collection<PreviewVdbStatus> statuses=null;
  try {
    this.statusLock.readLock().lock();
    statuses=this.deploymentStatusMap.get(project.getFullPath());
    if ((statuses != null) && !statuses.isEmpty()) {
      statuses=new ArrayList<PreviewVdbStatus>(statuses);
    }
  }
  finally {
    this.statusLock.readLock().unlock();
  }
  if ((statuses != null) && !statuses.isEmpty()) {
    Collection<PreviewVdbStatus> missingPvdbs=new ArrayList<PreviewVdbStatus>();
    for (    PreviewVdbStatus status : statuses) {
      IFile pvdbFile=status.getFile();
      if (pvdbFile.exists()) {
        if (!onlyThoseNeedingToBeDeployed) {
          pvdbsToDeploy.add(this.context.getPreviewVdb(status.getFile()));
        }
 else {
          if (needsToBeDeployed(pvdbFile)) {
            pvdbsToDeploy.add(this.context.getPreviewVdb(pvdbFile));
          }
        }
      }
 else {
        missingPvdbs.add(status);
      }
    }
    if (!missingPvdbs.isEmpty()) {
      Util.log(Messages.DeployStatusCacheError);
      try {
        this.statusLock.writeLock().lock();
        for (        PreviewVdbStatus status : missingPvdbs) {
          statuses.remove(status);
        }
      }
  finally {
        this.statusLock.writeLock().unlock();
      }
    }
  }
  return pvdbsToDeploy;
}

Fixed version (ground truth):
/** 
 * @param project the project whose Preview VDBs are being requested
 * @param onlyThoseNeedingToBeDeployed <code>true</code> if only Preview VDBs needing to be deployed should be returned
 * @return the project Preview VDBs (never <code>null</code>)
 */
List<IFile> findProjectPvdbs(IProject project,boolean onlyThoseNeedingToBeDeployed){
  List<IFile> pvdbsToDeploy=new ArrayList<IFile>();
  Collection<PreviewVdbStatus> statuses=null;
  try {
    this.statusLock.readLock().lock();
    statuses=this.deploymentStatusMap.get(project.getFullPath());
    if ((statuses != null) && !statuses.isEmpty()) {
      statuses=new ArrayList<PreviewVdbStatus>(statuses);
    }
  }
  finally {
    this.statusLock.readLock().unlock();
  }
  if ((statuses != null) && !statuses.isEmpty()) {
    Collection<PreviewVdbStatus> missingPvdbs=new ArrayList<PreviewVdbStatus>();
    for (    PreviewVdbStatus status : statuses) {
      IFile pvdbFile=status.getFile();
      if (pvdbFile.exists()) {
        if (!onlyThoseNeedingToBeDeployed) {
          pvdbsToDeploy.add(this.context.getPreviewVdb(status.getFile()));
        }
 else {
          if (needsToBeDeployed(pvdbFile)) {
            pvdbsToDeploy.add(this.context.getPreviewVdb(pvdbFile));
          }
        }
      }
 else {
        missingPvdbs.add(status);
      }
    }
    if (!missingPvdbs.isEmpty()) {
      Util.log(Messages.DeployStatusCacheError);
      try {
        this.statusLock.writeLock().lock();
        statuses=this.deploymentStatusMap.get(project.getFullPath());
        for (        PreviewVdbStatus status : missingPvdbs) {
          statuses.remove(status);
        }
      }
  finally {
        this.statusLock.writeLock().unlock();
      }
    }
  }
  return pvdbsToDeploy;
}