Program: 4581
Project: 4581
Buggy source:
/** 
 * Notifies all existing HTTPDownloaders about this RFD. If good is true, it notifies them of a succesful alternate location, otherwise it notifies them of a failed alternate location. The internal validAlts is also updated if good is true, and invalidAlts is updated if good is false. The IncompleteFileDesc is also notified of new locations for this file.
 */
private synchronized void informMesh(RemoteFileDesc rfd,boolean good){
  if (!rfd.isAltLocCapable())   return;
  URN bucketHash=buckets.getURNForBucket(bucketNumber);
  Assert.that(bucketHash != null,"String_Node_Str");
  Assert.that(bucketHash.equals(rfd.getSHA1Urn()),"String_Node_Str");
  if (validAlts == null)   validAlts=AlternateLocationCollection.create(bucketHash);
  AlternateLocation loc=null;
  AlternateLocation forFD=null;
  try {
    loc=AlternateLocation.create(rfd);
    forFD=AlternateLocation.create(rfd);
  }
 catch (  IOException iox) {
    return;
  }
  for (Iterator iter=dloaders.iterator(); iter.hasNext(); ) {
    HTTPDownloader httpDloader=(HTTPDownloader)iter.next();
    RemoteFileDesc r=httpDloader.getRemoteFileDesc();
    if (r.getHost() == rfd.getHost() && r.getPort() == rfd.getPort())     continue;
    if (good)     httpDloader.addSuccessfulAltLoc(loc);
 else     httpDloader.addFailedAltLoc(loc);
  }
  FileDesc fd=fileManager.getFileDescForFile(incompleteFile);
  IncompleteFileDesc ifd=null;
  if (fd != null && fd instanceof IncompleteFileDesc) {
    ifd=(IncompleteFileDesc)fd;
    if (!bucketHash.equals(ifd.getSHA1Urn())) {
      Assert.silent(false,"String_Node_Str");
      fileManager.removeFileIfShared(incompleteFile);
    }
  }
  if (good) {
    if (!validAlts.contains(loc)) {
      if (RECORD_STATS && rfd.isFromAlternateLocation())       DownloadStat.ALTERNATE_WORKED.incrementStat();
      validAlts.add(loc);
      if (ifd != null)       ifd.addVerified(forFD);
    }
  }
 else {
    if (RECORD_STATS && rfd.isFromAlternateLocation())     DownloadStat.ALTERNATE_NOT_ADDED.incrementStat();
    validAlts.remove(loc);
    if (ifd != null)     ifd.remove(forFD);
    invalidAlts.put(rfd,rfd);
  }
}

Fixed version (ground truth):
/** 
 * Notifies all existing HTTPDownloaders about this RFD. If good is true, it notifies them of a succesful alternate location, otherwise it notifies them of a failed alternate location. The internal validAlts is also updated if good is true, and invalidAlts is updated if good is false. The IncompleteFileDesc is also notified of new locations for this file.
 */
private synchronized void informMesh(RemoteFileDesc rfd,boolean good){
  if (!rfd.isAltLocCapable())   return;
  URN bucketHash=buckets.getURNForBucket(bucketNumber);
  Assert.that(bucketHash != null,"String_Node_Str");
  Assert.that(bucketHash.equals(rfd.getSHA1Urn()),"String_Node_Str");
  if (validAlts == null)   validAlts=AlternateLocationCollection.create(bucketHash);
  AlternateLocation loc=null;
  AlternateLocation forFD=null;
  try {
    loc=AlternateLocation.create(rfd);
    forFD=AlternateLocation.create(rfd);
  }
 catch (  IOException iox) {
    return;
  }
  for (Iterator iter=dloaders.iterator(); iter.hasNext(); ) {
    HTTPDownloader httpDloader=(HTTPDownloader)iter.next();
    RemoteFileDesc r=httpDloader.getRemoteFileDesc();
    if (r.getHost() == rfd.getHost() && r.getPort() == rfd.getPort())     continue;
    if (good)     httpDloader.addSuccessfulAltLoc(loc);
 else     httpDloader.addFailedAltLoc(loc);
  }
  FileDesc fd=fileManager.getFileDescForFile(incompleteFile);
  IncompleteFileDesc ifd=null;
  if (fd != null && fd instanceof IncompleteFileDesc) {
    ifd=(IncompleteFileDesc)fd;
    if (!bucketHash.equals(ifd.getSHA1Urn())) {
      Assert.silent(false,"String_Node_Str");
      fileManager.removeFileIfShared(incompleteFile);
      ifd=null;
    }
  }
  if (good) {
    if (!validAlts.contains(loc)) {
      if (RECORD_STATS && rfd.isFromAlternateLocation())       DownloadStat.ALTERNATE_WORKED.incrementStat();
      validAlts.add(loc);
      if (ifd != null)       ifd.addVerified(forFD);
    }
  }
 else {
    if (RECORD_STATS && rfd.isFromAlternateLocation())     DownloadStat.ALTERNATE_NOT_ADDED.incrementStat();
    validAlts.remove(loc);
    if (ifd != null)     ifd.remove(forFD);
    invalidAlts.put(rfd,rfd);
  }
}