Program: 6288
Project: 6288
Buggy source:
private BodyConsumer deployApplication(final HttpResponder responder,final Id.Namespace namespace,final String appId,final String archiveName,final String configString) throws IOException {
  Location namespaceHomeLocation=namespacedLocationFactory.get(namespace);
  if (!namespaceHomeLocation.exists()) {
    String msg=String.format("String_Node_Str",namespaceHomeLocation,namespace.getId());
    LOG.error(msg);
    responder.sendString(HttpResponseStatus.NOT_FOUND,msg);
    return null;
  }
  if (archiveName == null || archiveName.isEmpty()) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,ARCHIVE_NAME_HEADER + "String_Node_Str",ImmutableMultimap.of(HttpHeaders.Names.CONNECTION,HttpHeaders.Values.CLOSE));
    return null;
  }
  final Id.Artifact artifactId;
  try {
    artifactId=Id.Artifact.parse(namespace,archiveName);
  }
 catch (  IllegalArgumentException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    return null;
  }
  String namespacesDir=configuration.get(Constants.Namespace.NAMESPACES_DIR);
  File localDataDir=new File(configuration.get(Constants.CFG_LOCAL_DATA_DIR));
  File namespaceBase=new File(localDataDir,namespacesDir);
  File tempDir=new File(new File(namespaceBase,namespace.getId()),configuration.get(Constants.AppFabric.TEMP_DIR)).getAbsoluteFile();
  if (!DirUtils.mkdirs(tempDir)) {
    throw new IOException("String_Node_Str" + tempDir);
  }
  return new AbstractBodyConsumer(File.createTempFile("String_Node_Str","String_Node_Str",tempDir)){
    @Override protected void onFinish(    HttpResponder responder,    File uploadedFile){
      try {
        applicationLifecycleService.deployAppAndArtifact(namespace,appId,artifactId,uploadedFile,configString,createProgramTerminator());
        responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
      }
 catch (      InvalidArtifactException e) {
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
catch (      ArtifactAlreadyExistsException e) {
        responder.sendString(HttpResponseStatus.CONFLICT,String.format("String_Node_Str" + "String_Node_Str",artifactId));
      }
catch (      WriteConflictException e) {
        LOG.warn("String_Node_Str",artifactId,e);
        responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str" + "String_Node_Str");
      }
catch (      Exception e) {
        LOG.error("String_Node_Str",e);
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
    }
  }
;
}

Fixed version (ground truth):
private BodyConsumer deployApplication(final HttpResponder responder,final Id.Namespace namespace,final String appId,final String archiveName,final String configString) throws IOException {
  Location namespaceHomeLocation=namespacedLocationFactory.get(namespace);
  if (!namespaceHomeLocation.exists()) {
    String msg=String.format("String_Node_Str",namespaceHomeLocation,namespace.getId());
    LOG.error(msg);
    responder.sendString(HttpResponseStatus.NOT_FOUND,msg);
    return null;
  }
  if (archiveName == null || archiveName.isEmpty()) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str",ARCHIVE_NAME_HEADER,HttpHeaders.Names.CONTENT_TYPE,MediaType.APPLICATION_JSON),ImmutableMultimap.of(HttpHeaders.Names.CONNECTION,HttpHeaders.Values.CLOSE));
    return null;
  }
  final Id.Artifact artifactId;
  try {
    artifactId=Id.Artifact.parse(namespace,archiveName);
  }
 catch (  IllegalArgumentException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
    return null;
  }
  String namespacesDir=configuration.get(Constants.Namespace.NAMESPACES_DIR);
  File localDataDir=new File(configuration.get(Constants.CFG_LOCAL_DATA_DIR));
  File namespaceBase=new File(localDataDir,namespacesDir);
  File tempDir=new File(new File(namespaceBase,namespace.getId()),configuration.get(Constants.AppFabric.TEMP_DIR)).getAbsoluteFile();
  if (!DirUtils.mkdirs(tempDir)) {
    throw new IOException("String_Node_Str" + tempDir);
  }
  return new AbstractBodyConsumer(File.createTempFile("String_Node_Str","String_Node_Str",tempDir)){
    @Override protected void onFinish(    HttpResponder responder,    File uploadedFile){
      try {
        applicationLifecycleService.deployAppAndArtifact(namespace,appId,artifactId,uploadedFile,configString,createProgramTerminator());
        responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
      }
 catch (      InvalidArtifactException e) {
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
catch (      ArtifactAlreadyExistsException e) {
        responder.sendString(HttpResponseStatus.CONFLICT,String.format("String_Node_Str" + "String_Node_Str",artifactId));
      }
catch (      WriteConflictException e) {
        LOG.warn("String_Node_Str",artifactId,e);
        responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str" + "String_Node_Str");
      }
catch (      Exception e) {
        LOG.error("String_Node_Str",e);
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
    }
  }
;
}