Program: 29259
Project: 29259
Buggy source:
private void retrieveFile(String zipFileName,AdminCommandContext context,File tempDirectory,Properties props,ActionReport report){
  Payload.Outbound outboundPayload=context.getOutboundPayload();
  boolean retrieveFiles=false;
  if (outboundPayload == null) {
    outboundPayload=PayloadImpl.Outbound.newInstance();
    retrieveFiles=true;
  }
  try {
    List<File> files=new ArrayList<File>(Arrays.asList(tempDirectory.listFiles()));
    for (int i=0; i < files.size(); i++) {
      File file=files.get(i);
      if (file.isDirectory()) {
        files.addAll(Arrays.asList(file.listFiles()));
        continue;
      }
      if (file.getAbsolutePath().contains("String_Node_Str")) {
        continue;
      }
      outboundPayload.attachFile("String_Node_Str",tempDirectory.toURI().relativize(file.toURI()),"String_Node_Str",props,file);
    }
    if (retrieveFiles) {
      File targetLocalFile=new File(retrieveFilePath);
      if (targetLocalFile.exists()) {
        throw new Exception("String_Node_Str");
      }
      if (!targetLocalFile.getParentFile().exists()) {
        throw new Exception("String_Node_Str");
      }
      FileOutputStream targetStream=new FileOutputStream(targetLocalFile);
      outboundPayload.writeTo(targetStream);
      targetStream.flush();
      targetStream.close();
    }
  }
 catch (  Exception ex) {
    final String errorMsg=localStrings.getLocalString("String_Node_Str","String_Node_Str",retrieveFilePath);
    logger.log(Level.SEVERE,errorMsg,ex);
    report.setMessage(errorMsg);
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    return;
  }
}

Fixed version (ground truth):
private void retrieveFile(String zipFileName,AdminCommandContext context,File tempDirectory,Properties props,ActionReport report){
  Payload.Outbound outboundPayload=context.getOutboundPayload();
  boolean retrieveFiles=false;
  if (outboundPayload == null) {
    outboundPayload=PayloadImpl.Outbound.newInstance();
    retrieveFiles=true;
  }
  try {
    List<File> files=new ArrayList<File>(Arrays.asList(tempDirectory.listFiles()));
    for (int i=0; i < files.size(); i++) {
      File file=files.get(i);
      if (file.isDirectory()) {
        files.addAll(Arrays.asList(file.listFiles()));
        continue;
      }
      if (file.getAbsolutePath().contains("String_Node_Str")) {
        continue;
      }
      outboundPayload.attachFile("String_Node_Str",tempDirectory.toURI().relativize(file.toURI()),"String_Node_Str",props,file);
    }
    if (retrieveFiles) {
      File targetLocalFile=new File(retrieveFilePath);
      if (targetLocalFile.exists()) {
        throw new Exception("String_Node_Str");
      }
      if (!targetLocalFile.getParentFile().exists()) {
        throw new Exception("String_Node_Str");
      }
      FileOutputStream targetStream=null;
      try {
        targetStream=new FileOutputStream(targetLocalFile);
        outboundPayload.writeTo(targetStream);
        targetStream.flush();
      }
  finally {
        if (targetStream != null)         targetStream.close();
      }
    }
  }
 catch (  Exception ex) {
    final String errorMsg=localStrings.getLocalString("String_Node_Str","String_Node_Str",retrieveFilePath);
    logger.log(Level.SEVERE,errorMsg,ex);
    report.setMessage(errorMsg);
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    return;
  }
}