Program: 95789
Project: 95789
Buggy source:
private RevisionLocation zipAndUpload(AWSClients aws,String projectName,FilePath sourceDirectory,Map<String,String> envVars) throws IOException, InterruptedException, IllegalArgumentException {
  File zipFile=File.createTempFile(projectName + "String_Node_Str","String_Node_Str");
  String key;
  File appspec;
  File dest;
  try {
    if (this.deploymentGroupAppspec) {
      appspec=new File(sourceDirectory + "String_Node_Str" + this.deploymentGroupName+ "String_Node_Str");
      if (appspec.exists()) {
        dest=new File(sourceDirectory + "String_Node_Str");
        FileUtils.copyFile(appspec,dest);
        logger.println("String_Node_Str" + this.deploymentGroupName + "String_Node_Str");
      }
      if (!appspec.exists()) {
        throw new IllegalArgumentException("String_Node_Str" + this.deploymentGroupName + "String_Node_Str");
      }
    }
    logger.println("String_Node_Str" + zipFile.getAbsolutePath());
    sourceDirectory.zip(new FileOutputStream(zipFile),new DirScanner.Glob(this.includes,this.excludes));
    if (this.s3prefix.isEmpty()) {
      key=zipFile.getName();
    }
 else {
      key=Util.replaceMacro(this.s3prefix,envVars);
      if (this.s3prefix.endsWith("String_Node_Str")) {
        key+=zipFile.getName();
      }
 else {
        key+="String_Node_Str" + zipFile.getName();
      }
    }
    logger.println("String_Node_Str" + this.s3bucket + "String_Node_Str"+ key);
    PutObjectResult s3result=aws.s3.putObject(this.s3bucket,key,zipFile);
    S3Location s3Location=new S3Location();
    s3Location.setBucket(this.s3bucket);
    s3Location.setKey(key);
    s3Location.setBundleType(BundleType.Zip);
    s3Location.setETag(s3result.getETag());
    RevisionLocation revisionLocation=new RevisionLocation();
    revisionLocation.setRevisionType(RevisionLocationType.S3);
    revisionLocation.setS3Location(s3Location);
    return revisionLocation;
  }
  finally {
    zipFile.delete();
  }
}

Fixed version (ground truth):
private RevisionLocation zipAndUpload(AWSClients aws,String projectName,FilePath sourceDirectory,Map<String,String> envVars,String deploymentGroupName) throws IOException, InterruptedException, IllegalArgumentException {
  File zipFile=File.createTempFile(projectName + "String_Node_Str","String_Node_Str");
  String key;
  File appspec;
  File dest;
  try {
    if (this.deploymentGroupAppspec) {
      appspec=new File(sourceDirectory + "String_Node_Str" + deploymentGroupName+ "String_Node_Str");
      if (appspec.exists()) {
        dest=new File(sourceDirectory + "String_Node_Str");
        FileUtils.copyFile(appspec,dest);
        logger.println("String_Node_Str" + deploymentGroupName + "String_Node_Str");
      }
      if (!appspec.exists()) {
        throw new IllegalArgumentException("String_Node_Str" + deploymentGroupName + "String_Node_Str");
      }
    }
    logger.println("String_Node_Str" + zipFile.getAbsolutePath());
    sourceDirectory.zip(new FileOutputStream(zipFile),new DirScanner.Glob(this.includes,this.excludes));
    if (this.s3prefix.isEmpty()) {
      key=zipFile.getName();
    }
 else {
      key=Util.replaceMacro(this.s3prefix,envVars);
      if (this.s3prefix.endsWith("String_Node_Str")) {
        key+=zipFile.getName();
      }
 else {
        key+="String_Node_Str" + zipFile.getName();
      }
    }
    logger.println("String_Node_Str" + this.s3bucket + "String_Node_Str"+ key);
    PutObjectResult s3result=aws.s3.putObject(this.s3bucket,key,zipFile);
    S3Location s3Location=new S3Location();
    s3Location.setBucket(this.s3bucket);
    s3Location.setKey(key);
    s3Location.setBundleType(BundleType.Zip);
    s3Location.setETag(s3result.getETag());
    RevisionLocation revisionLocation=new RevisionLocation();
    revisionLocation.setRevisionType(RevisionLocationType.S3);
    revisionLocation.setS3Location(s3Location);
    return revisionLocation;
  }
  finally {
    zipFile.delete();
  }
}