Program: 180536
Project: 180536
Buggy source:
private void transferWithExceptions() throws ServletException, IOException, URISyntaxException, JSONException {
  String host, remotePath, user, passphrase;
  int port;
  try {
    JSONObject requestInfo=OrionServlet.readJSONRequest(request);
    host=requestInfo.getString(ProtocolConstants.KEY_HOST);
    remotePath=requestInfo.getString(ProtocolConstants.KEY_PATH);
    port=requestInfo.optInt(ProtocolConstants.KEY_PORT,22);
    user=requestInfo.getString(ProtocolConstants.KEY_USER_NAME);
    passphrase=requestInfo.getString(ProtocolConstants.KEY_PASSPHRASE);
  }
 catch (  Exception e) {
    handleException("String_Node_Str",e,HttpServletResponse.SC_BAD_REQUEST);
    return;
  }
  File localFile;
  try {
    localFile=localRoot.toLocalFile(EFS.NONE,null);
  }
 catch (  CoreException e) {
    handleException(NLS.bind("String_Node_Str",localRoot.toString()),e,HttpServletResponse.SC_NOT_IMPLEMENTED);
    return;
  }
  SFTPTransferJob job;
  if (TransferServlet.PREFIX_IMPORT.equals(new Path(request.getPathInfo()).segment(0))) {
    job=new SFTPImportJob(localFile,host,port,new Path(remotePath),user,passphrase,options);
  }
 else {
    job=new SFTPExportJob(localFile,host,port,new Path(remotePath),user,passphrase,options);
  }
  job.schedule();
  TaskInfo task=job.getTask();
  JSONObject result=task.toJSON();
  URI requestLocation=ServletResourceHandler.getURI(request);
  URI taskLocation=new URI(requestLocation.getScheme(),requestLocation.getAuthority(),"String_Node_Str" + task.getTaskId(),null,null);
  result.put(ProtocolConstants.KEY_LOCATION,taskLocation.toString());
  response.setHeader(ProtocolConstants.HEADER_LOCATION,taskLocation.toString());
  OrionServlet.writeJSONResponse(request,response,result);
  response.setStatus(HttpServletResponse.SC_CREATED);
}

Fixed version (ground truth):
private void transferWithExceptions() throws ServletException, IOException, URISyntaxException, JSONException {
  String host, remotePath, user, passphrase;
  int port;
  try {
    JSONObject requestInfo=OrionServlet.readJSONRequest(request);
    host=requestInfo.getString(ProtocolConstants.KEY_HOST);
    remotePath=requestInfo.getString(ProtocolConstants.KEY_PATH);
    port=requestInfo.optInt(ProtocolConstants.KEY_PORT,22);
    user=requestInfo.getString(ProtocolConstants.KEY_USER_NAME);
    passphrase=requestInfo.getString(ProtocolConstants.KEY_PASSPHRASE);
  }
 catch (  Exception e) {
    handleException("String_Node_Str",e,HttpServletResponse.SC_BAD_REQUEST);
    return;
  }
  File localFile;
  try {
    localFile=localRoot.toLocalFile(EFS.NONE,null);
  }
 catch (  CoreException e) {
    handleException(NLS.bind("String_Node_Str",localRoot.toString()),e,HttpServletResponse.SC_NOT_IMPLEMENTED);
    return;
  }
  SFTPTransferJob job;
  if (TransferServlet.PREFIX_IMPORT.equals(new Path(request.getPathInfo()).segment(0))) {
    job=new SFTPImportJob(localFile,host,port,new Path(remotePath),user,passphrase,options);
  }
 else {
    job=new SFTPExportJob(localFile,host,port,new Path(remotePath),user,passphrase,options);
  }
  job.schedule();
  TaskInfo task=job.getTask();
  JSONObject result=task.toJSON();
  URI requestLocation=ServletResourceHandler.getURI(request);
  URI taskLocation=new URI(requestLocation.getScheme(),requestLocation.getAuthority(),"String_Node_Str" + task.getTaskId(),null,null);
  result.put(ProtocolConstants.KEY_LOCATION,taskLocation);
  response.setHeader(ProtocolConstants.HEADER_LOCATION,taskLocation.toString());
  OrionServlet.writeJSONResponse(request,response,result);
  response.setStatus(HttpServletResponse.SC_CREATED);
}