Program: 7614
Project: 7614
Buggy source:
private BodyConsumer deployAppStream(final HttpRequest request,HttpResponder responder,final String appId) throws IOException {
  final String archiveName=request.getHeader(ARCHIVE_NAME_HEADER);
  final String accountId=getAuthenticatedAccountId(request);
  final Location uploadDir=locationFactory.create(archiveDir + "String_Node_Str" + accountId);
  final Location archive=uploadDir.append(archiveName);
  final OutputStream os=archive.getOutputStream();
  if (archiveName == null || archiveName.isEmpty()) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,ARCHIVE_NAME_HEADER + "String_Node_Str");
  }
  final SessionInfo sessionInfo=new SessionInfo(accountId,appId,archiveName,archive,DeployStatus.UPLOADING);
  sessions.put(accountId,sessionInfo);
  return new BodyConsumer(){
    @Override public void chunk(    ChannelBuffer request,    HttpResponder responder){
      try {
        request.readBytes(os,request.readableBytes());
      }
 catch (      IOException e) {
        sessionInfo.setStatus(DeployStatus.FAILED);
        e.printStackTrace();
        responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
      }
    }
    @Override public void finished(    HttpResponder responder){
      try {
        os.close();
        sessionInfo.setStatus(DeployStatus.VERIFYING);
        deploy(accountId,appId,archive);
        sessionInfo.setStatus(DeployStatus.DEPLOYED);
        responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
      }
 catch (      Exception ex) {
        sessionInfo.setStatus(DeployStatus.FAILED);
        ex.printStackTrace();
        responder.sendString(HttpResponseStatus.BAD_REQUEST,ex.getMessage());
      }
 finally {
        save(sessionInfo.setStatus(sessionInfo.getStatus()),accountId);
        sessions.remove(accountId);
      }
    }
    public void handleError(    Throwable t){
      try {
        os.close();
        sessionInfo.setStatus(DeployStatus.FAILED);
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
;
}

Fixed version (ground truth):
private BodyConsumer deployAppStream(final HttpRequest request,final HttpResponder responder,final String appId) throws IOException {
  final String archiveName=request.getHeader(ARCHIVE_NAME_HEADER);
  final String accountId=getAuthenticatedAccountId(request);
  final Location uploadDir=locationFactory.create(archiveDir + "String_Node_Str" + accountId);
  final Location archive=uploadDir.append(archiveName);
  final OutputStream os=archive.getOutputStream();
  if (archiveName == null || archiveName.isEmpty()) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,ARCHIVE_NAME_HEADER + "String_Node_Str");
  }
  final SessionInfo sessionInfo=new SessionInfo(accountId,appId,archiveName,archive,DeployStatus.UPLOADING);
  sessions.put(accountId,sessionInfo);
  return new BodyConsumer(){
    @Override public void chunk(    ChannelBuffer request,    HttpResponder responder){
      try {
        request.readBytes(os,request.readableBytes());
      }
 catch (      IOException e) {
        sessionInfo.setStatus(DeployStatus.FAILED);
        e.printStackTrace();
        responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
      }
    }
    @Override public void finished(    HttpResponder responder){
      try {
        os.close();
        sessionInfo.setStatus(DeployStatus.VERIFYING);
        deploy(accountId,appId,archive);
        sessionInfo.setStatus(DeployStatus.DEPLOYED);
        responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
      }
 catch (      Exception ex) {
        sessionInfo.setStatus(DeployStatus.FAILED);
        ex.printStackTrace();
        responder.sendString(HttpResponseStatus.BAD_REQUEST,ex.getMessage());
      }
 finally {
        save(sessionInfo.setStatus(sessionInfo.getStatus()),accountId);
        sessions.remove(accountId);
      }
    }
    @Override public void handleError(    Throwable t){
      try {
        os.close();
        sessionInfo.setStatus(DeployStatus.FAILED);
        responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,t.getCause().getMessage());
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
 finally {
        save(sessionInfo.setStatus(sessionInfo.getStatus()),accountId);
        sessions.remove(accountId);
      }
    }
  }
;
}