Program: 5186
Project: 5186
Buggy source:
private BodyConsumer deployAppFromArtifact(final ApplicationId appId) throws IOException {
  return new AbstractBodyConsumer(File.createTempFile("String_Node_Str" + appId,"String_Node_Str",tmpDir)){
    @Override protected void onFinish(    HttpResponder responder,    File uploadedFile){
      try (FileReader fileReader=new FileReader(uploadedFile)){
        AppRequest<?> appRequest=GSON.fromJson(fileReader,AppRequest.class);
        ArtifactSummary artifactSummary=appRequest.getArtifact();
        NamespaceId artifactNamespace=ArtifactScope.SYSTEM.equals(artifactSummary.getScope()) ? NamespaceId.SYSTEM : appId.getParent();
        Id.Artifact artifactId=Id.Artifact.from(artifactNamespace.toId(),artifactSummary.getName(),artifactSummary.getVersion());
        KerberosPrincipalId ownerPrincipalId=appRequest.getOwnerPrincipal() == null ? null : new KerberosPrincipalId(appRequest.getOwnerPrincipal());
        String configString=appRequest.getConfig() == null ? null : GSON.toJson(appRequest.getConfig());
        applicationLifecycleService.deployApp(appId.getParent(),appId.getApplication(),appId.getVersion(),artifactId,configString,createProgramTerminator(),ownerPrincipalId);
        responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
      }
 catch (      ArtifactNotFoundException e) {
        responder.sendString(HttpResponseStatus.NOT_FOUND,e.getMessage());
      }
catch (      InvalidArtifactException e) {
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
catch (      IOException e) {
        LOG.error("String_Node_Str",appId);
        responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,String.format("String_Node_Str",appId));
      }
catch (      Exception e) {
        LOG.error("String_Node_Str",e);
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
    }
  }
;
}

Fixed version (ground truth):
private BodyConsumer deployAppFromArtifact(final ApplicationId appId) throws IOException {
  return new AbstractBodyConsumer(File.createTempFile("String_Node_Str" + appId,"String_Node_Str",tmpDir)){
    @Override protected void onFinish(    HttpResponder responder,    File uploadedFile){
      try (FileReader fileReader=new FileReader(uploadedFile)){
        AppRequest<?> appRequest=GSON.fromJson(fileReader,AppRequest.class);
        ArtifactSummary artifactSummary=appRequest.getArtifact();
        NamespaceId artifactNamespace=ArtifactScope.SYSTEM.equals(artifactSummary.getScope()) ? NamespaceId.SYSTEM : appId.getParent();
        Id.Artifact artifactId=Id.Artifact.from(artifactNamespace.toId(),artifactSummary.getName(),artifactSummary.getVersion());
        KerberosPrincipalId ownerPrincipalId=appRequest.getOwnerPrincipal() == null ? null : new KerberosPrincipalId(appRequest.getOwnerPrincipal());
        String configString=appRequest.getConfig() == null ? null : GSON.toJson(appRequest.getConfig());
        applicationLifecycleService.deployApp(appId.getParent(),appId.getApplication(),appId.getVersion(),artifactId,configString,createProgramTerminator(),ownerPrincipalId);
        responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
      }
 catch (      ArtifactNotFoundException e) {
        responder.sendString(HttpResponseStatus.NOT_FOUND,e.getMessage());
      }
catch (      ConflictException e) {
        responder.sendString(HttpResponseStatus.CONFLICT,e.getMessage());
      }
catch (      UnauthorizedException e) {
        responder.sendString(HttpResponseStatus.FORBIDDEN,e.getMessage());
      }
catch (      InvalidArtifactException e) {
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
catch (      IOException e) {
        LOG.error("String_Node_Str",appId);
        responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,String.format("String_Node_Str",appId));
      }
catch (      Exception e) {
        LOG.error("String_Node_Str",e);
        responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
      }
    }
  }
;
}