Program: 188844
Project: 188844
Buggy source:
/** 
 * @see HttpServlet#doGet(HttpServletRequest request,HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String pid=request.getParameter(PARAM_PID);
  String name="String_Node_Str" + pid.replace(':','_');
  File tempDir=TempDir.createUniqueTemporaryDirectory(name);
  try {
    RODAClient rodaClient=RodaClientFactory.getRodaClient(request.getSession());
    getPremisAndRepresentations(pid,rodaClient,aipDir);
    getEad(pid,request,response,rodaClient,aipDir);
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    ZipOutputStream zip=new ZipOutputStream(baos);
    ZipUtility.addDirToArchive(zip,aipDir);
    response.setContentType("String_Node_Str");
    response.setContentLength((int)baos.size());
    response.setHeader("String_Node_Str","String_Node_Str" + pid.replace(':','_') + "String_Node_Str");
    response.getOutputStream().write(baos.toByteArray());
    response.flushBuffer();
  }
 catch (  LoginException e) {
    logger.error("String_Node_Str",e);
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED,e.getMessage());
  }
catch (  RODAClientException e) {
    logger.error("String_Node_Str",e);
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e.getMessage());
  }
catch (  NoSuchRODAObjectException e) {
    response.sendError(HttpServletResponse.SC_NOT_FOUND,e.getMessage());
  }
catch (  DownloaderException e) {
    logger.error("String_Node_Str",e);
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e.getMessage());
  }
catch (  BrowserException e) {
    logger.error("String_Node_Str",e);
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e.getMessage());
  }
 finally {
    if ((aipDir != null) && (aipDir.exists())) {
      FileUtils.deleteDirectory(aipDir);
    }
  }
}

Fixed version (ground truth):
/** 
 * @see HttpServlet#doGet(HttpServletRequest request,HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String pid=request.getParameter(PARAM_PID);
  String name="String_Node_Str" + pid.replace(':','_');
  File tempDir=TempDir.createUniqueTemporaryDirectory(name);
  try {
    RODAClient rodaClient=RodaClientFactory.getRodaClient(request.getSession());
    getPremisAndRepresentations(pid,rodaClient,tempDir);
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    ZipOutputStream zip=new ZipOutputStream(baos);
    ZipUtility.addDirToArchive(zip,tempDir);
    response.setContentType("String_Node_Str");
    response.setContentLength((int)baos.size());
    response.setHeader("String_Node_Str","String_Node_Str" + pid.replace(':','_') + "String_Node_Str");
    response.getOutputStream().write(baos.toByteArray());
    response.flushBuffer();
  }
 catch (  LoginException e) {
    logger.error("String_Node_Str",e);
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED,e.getMessage());
  }
catch (  RODAClientException e) {
    logger.error("String_Node_Str",e);
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e.getMessage());
  }
catch (  NoSuchRODAObjectException e) {
    response.sendError(HttpServletResponse.SC_NOT_FOUND,e.getMessage());
  }
catch (  DownloaderException e) {
    logger.error("String_Node_Str",e);
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e.getMessage());
  }
catch (  BrowserException e) {
    logger.error("String_Node_Str",e);
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e.getMessage());
  }
 finally {
    if ((tempDir != null) && (tempDir.exists())) {
      FileUtils.deleteDirectory(tempDir);
    }
  }
}