Program: 20769
Project: 20769
Buggy source:
private void getFileFromRepository(String path,ProxiedArtifactRepository repository,String repositoryCachePath,ProxyInfo httpProxy,File target,ArtifactRepositoryPolicy policy) throws ProxyException {
  boolean connected=false;
  Map checksums=null;
  Wagon wagon=null;
  try {
    String protocol=repository.getRepository().getProtocol();
    wagon=(Wagon)wagons.get(protocol);
    if (wagon == null) {
      throw new ProxyException("String_Node_Str" + protocol);
    }
    checksums=prepareChecksumListeners(wagon);
    connected=connectToRepository(wagon,repository,httpProxy);
    if (connected) {
      File temp=new File(target.getAbsolutePath() + "String_Node_Str");
      temp.deleteOnExit();
      int tries=0;
      boolean success;
      do {
        tries++;
        getLogger().debug("String_Node_Str" + path + "String_Node_Str"+ repository.getName()+ "String_Node_Str");
        if (!target.exists()) {
          wagon.get(path,temp);
        }
 else {
          wagon.getIfNewer(path,temp,target.lastModified());
        }
        success=checkChecksum(checksums,path,wagon,repositoryCachePath);
        if (tries > 1 && !success) {
          processRepositoryFailure(repository,"String_Node_Str" + path,path,policy);
          return;
        }
        if (temp.exists()) {
          moveTempToTarget(temp,target);
        }
      }
 while (!success);
    }
  }
 catch (  TransferFailedException e) {
    processRepositoryFailure(repository,e,path,policy);
  }
catch (  AuthorizationException e) {
    processRepositoryFailure(repository,e,path,policy);
  }
catch (  ResourceDoesNotExistException e) {
    getLogger().debug("String_Node_Str" + repository.getName() + "String_Node_Str"+ e.getMessage());
  }
 finally {
    if (wagon != null && checksums != null) {
      releaseChecksumListeners(wagon,checksums);
    }
    if (connected) {
      disconnectWagon(wagon);
    }
  }
}

Fixed version (ground truth):
private void getFileFromRepository(String path,ProxiedArtifactRepository repository,String repositoryCachePath,ProxyInfo httpProxy,File target,ArtifactRepositoryPolicy policy,boolean force) throws ProxyException {
  boolean connected=false;
  Map checksums=null;
  Wagon wagon=null;
  File temp=new File(target.getAbsolutePath() + "String_Node_Str");
  temp.deleteOnExit();
  try {
    String protocol=repository.getRepository().getProtocol();
    wagon=(Wagon)wagons.get(protocol);
    if (wagon == null) {
      throw new ProxyException("String_Node_Str" + protocol);
    }
    checksums=prepareChecksumListeners(wagon);
    connected=connectToRepository(wagon,repository,httpProxy);
    if (connected) {
      int tries=0;
      boolean success;
      do {
        tries++;
        getLogger().debug("String_Node_Str" + path + "String_Node_Str"+ repository.getName()+ "String_Node_Str");
        if (force || !target.exists()) {
          wagon.get(path,temp);
        }
 else {
          wagon.getIfNewer(path,temp,target.lastModified());
        }
        success=checkChecksum(checksums,path,wagon,repositoryCachePath);
        if (tries > 1 && !success) {
          processRepositoryFailure(repository,"String_Node_Str" + path,path,policy);
          return;
        }
      }
 while (!success);
      if (temp.exists()) {
        moveTempToTarget(temp,target);
      }
    }
  }
 catch (  TransferFailedException e) {
    processRepositoryFailure(repository,e,path,policy);
  }
catch (  AuthorizationException e) {
    processRepositoryFailure(repository,e,path,policy);
  }
catch (  ResourceDoesNotExistException e) {
    getLogger().debug("String_Node_Str" + repository.getName() + "String_Node_Str"+ e.getMessage());
  }
 finally {
    temp.delete();
    if (wagon != null && checksums != null) {
      releaseChecksumListeners(wagon,checksums);
    }
    if (connected) {
      disconnectWagon(wagon);
    }
  }
}