Program: 7149
Project: 7149
Buggy source:
private BodyConsumer deployApplication(final HttpResponder responder,final String namespaceId,final String appId,final String archiveName) throws IOException {
  Id.Namespace namespace=Id.Namespace.from(namespaceId);
  if (!namespaceAdmin.hasNamespace(namespace)) {
    LOG.warn("String_Node_Str",namespaceId);
    responder.sendString(HttpResponseStatus.NOT_FOUND,String.format("String_Node_Str",namespaceId));
    return null;
  }
  Location namespaceHomeLocation=locationFactory.create(namespaceId);
  if (!namespaceHomeLocation.exists()) {
    String msg=String.format("String_Node_Str",namespaceHomeLocation.toURI().getPath(),namespaceId);
    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;
  }
  String tempBase=String.format("String_Node_Str",configuration.get(Constants.CFG_LOCAL_DATA_DIR),namespaceId);
  File tempDir=new File(tempBase,configuration.get(Constants.AppFabric.TEMP_DIR)).getAbsoluteFile();
  if (!DirUtils.mkdirs(tempDir)) {
    throw new IOException("String_Node_Str" + tempDir);
  }
  String appFabricDir=configuration.get(Constants.AppFabric.OUTPUT_DIR);
  final Location archive=namespaceHomeLocation.append(appFabricDir).append(Constants.ARCHIVE_DIR).append(archiveName);
  return new AbstractBodyConsumer(File.createTempFile("String_Node_Str","String_Node_Str",tempDir)){
    @Override protected void onFinish(    HttpResponder responder,    File uploadedFile){
      try {
        DeploymentInfo deploymentInfo=new DeploymentInfo(uploadedFile,archive);
        deploy(namespaceId,appId,deploymentInfo);
        responder.sendString(HttpResponseStatus.OK,"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 String namespaceId,final String appId,final String archiveName) throws IOException {
  Id.Namespace namespace=Id.Namespace.from(namespaceId);
  if (!namespaceAdmin.hasNamespace(namespace)) {
    LOG.warn("String_Node_Str",namespaceId);
    responder.sendString(HttpResponseStatus.NOT_FOUND,String.format("String_Node_Str",namespaceId));
    return null;
  }
  Location namespaceHomeLocation=namespacedLocationFactory.get(namespace);
  if (!namespaceHomeLocation.exists()) {
    String msg=String.format("String_Node_Str",namespaceHomeLocation.toURI().getPath(),namespaceId);
    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;
  }
  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,namespaceId),configuration.get(Constants.AppFabric.TEMP_DIR)).getAbsoluteFile();
  if (!DirUtils.mkdirs(tempDir)) {
    throw new IOException("String_Node_Str" + tempDir);
  }
  String appFabricDir=configuration.get(Constants.AppFabric.OUTPUT_DIR);
  final Location archive=namespaceHomeLocation.append(appFabricDir).append(Constants.ARCHIVE_DIR).append(archiveName);
  return new AbstractBodyConsumer(File.createTempFile("String_Node_Str","String_Node_Str",tempDir)){
    @Override protected void onFinish(    HttpResponder responder,    File uploadedFile){
      try {
        DeploymentInfo deploymentInfo=new DeploymentInfo(uploadedFile,archive);
        deploy(namespaceId,appId,deploymentInfo);
        responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",e);
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
    }
  }
;
}