Program: 49082
Project: 49082
Buggy source:
private void processResponse(ResponseEntity<String> response,HttpMethod verb,PrettyOutput... prettyOutput) throws Exception {
  HttpStatus responseStatus=response.getStatusCode();
  if (responseStatus == HttpStatus.ACCEPTED) {
    HttpHeaders headers=response.getHeaders();
    URI taskURI=headers.getLocation();
    String[] taskURIs=taskURI.toString().split("String_Node_Str");
    String taskId=taskURIs[taskURIs.length - 1];
    TaskRead taskRead;
    int oldProgress=0;
    Status oldTaskStatus=null;
    Status taskStatus=null;
    int progress=0;
    do {
      ResponseEntity<TaskRead> taskResponse=restGetById(Constants.REST_PATH_TASK,taskId,TaskRead.class,false);
      taskRead=taskResponse.getBody();
      progress=(int)(taskRead.getProgress() * 100);
      taskStatus=taskRead.getStatus();
      if ((prettyOutput != null && prettyOutput.length > 0 && prettyOutput[0].isRefresh(false)) || oldTaskStatus != taskStatus || oldProgress != progress) {
        oldTaskStatus=taskStatus;
        oldProgress=progress;
        clearScreen();
        System.out.println(taskStatus + "String_Node_Str" + progress+ "String_Node_Str");
        if (prettyOutput != null && prettyOutput.length > 0) {
          prettyOutput[0].prettyOutput();
        }
      }
      try {
        Thread.sleep(3 * 1000);
      }
 catch (      InterruptedException ex) {
      }
    }
 while (taskRead.getStatus() != TaskRead.Status.SUCCESS && taskRead.getStatus() != TaskRead.Status.FAILED);
    String logdir=taskRead.getWorkDir();
    String errorMsg=taskRead.getErrorMessage();
    if (taskRead.getStatus().equals(TaskRead.Status.FAILED)) {
      if (!CommandsUtils.isBlank(logdir)) {
        String outputErrorInfo=Constants.OUTPUT_LOG_INFO + logdir;
        if (errorMsg != null) {
          outputErrorInfo=errorMsg + "String_Node_Str" + outputErrorInfo;
        }
        throw new CliRestException(outputErrorInfo);
      }
 else       if (errorMsg != null && !errorMsg.isEmpty()) {
        throw new CliRestException(errorMsg);
      }
 else {
        throw new CliRestException("String_Node_Str");
      }
    }
 else     if (taskRead.getStatus().equals(TaskRead.Status.SUCCESS)) {
      if (taskRead.getType().equals(Type.VHM)) {
        if (prettyOutput != null && prettyOutput.length > 0 && prettyOutput[0].isRefresh(true)) {
          clearScreen();
          System.out.println(taskStatus + "String_Node_Str" + progress+ "String_Node_Str");
          if (prettyOutput != null && prettyOutput.length > 0) {
            prettyOutput[0].prettyOutput();
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void processResponse(ResponseEntity<String> response,HttpMethod verb,PrettyOutput... prettyOutput) throws Exception {
  HttpStatus responseStatus=response.getStatusCode();
  if (responseStatus == HttpStatus.ACCEPTED) {
    HttpHeaders headers=response.getHeaders();
    URI taskURI=headers.getLocation();
    String[] taskURIs=taskURI.toString().split("String_Node_Str");
    String taskId=taskURIs[taskURIs.length - 1];
    TaskRead taskRead;
    int oldProgress=0;
    Status oldTaskStatus=null;
    Status taskStatus=null;
    int progress=0;
    do {
      ResponseEntity<TaskRead> taskResponse=restGetById(Constants.REST_PATH_TASK,taskId,TaskRead.class,false);
      taskRead=taskResponse.getBody();
      progress=(int)(taskRead.getProgress() * 100);
      taskStatus=taskRead.getStatus();
      if (oldTaskStatus != taskStatus || oldProgress != progress) {
        oldTaskStatus=taskStatus;
        oldProgress=progress;
        if (prettyOutput != null && prettyOutput.length > 0 && prettyOutput[0].isRefresh(false)) {
          clearScreen();
          System.out.println(taskStatus + "String_Node_Str" + progress+ "String_Node_Str");
          prettyOutput[0].prettyOutput();
        }
 else {
          String output=taskStatus + "String_Node_Str" + progress+ "String_Node_Str";
          if (taskRead.getProgressMessage() != null) {
            output+=taskRead.getProgressMessage();
          }
          System.out.println(output);
        }
      }
      try {
        Thread.sleep(3 * 1000);
      }
 catch (      InterruptedException ex) {
      }
    }
 while (taskRead.getStatus() != TaskRead.Status.SUCCESS && taskRead.getStatus() != TaskRead.Status.FAILED);
    String logdir=taskRead.getWorkDir();
    String errorMsg=taskRead.getErrorMessage();
    if (taskRead.getStatus().equals(TaskRead.Status.FAILED)) {
      if (!CommandsUtils.isBlank(logdir)) {
        String outputErrorInfo=Constants.OUTPUT_LOG_INFO + logdir;
        if (errorMsg != null) {
          outputErrorInfo=errorMsg + "String_Node_Str" + outputErrorInfo;
        }
        throw new CliRestException(outputErrorInfo);
      }
 else       if (errorMsg != null && !errorMsg.isEmpty()) {
        throw new CliRestException(errorMsg);
      }
 else {
        throw new CliRestException("String_Node_Str");
      }
    }
 else     if (taskRead.getStatus().equals(TaskRead.Status.SUCCESS)) {
      if (taskRead.getType().equals(Type.VHM)) {
        if (prettyOutput != null && prettyOutput.length > 0 && prettyOutput[0].isRefresh(true)) {
          clearScreen();
          System.out.println(taskStatus + "String_Node_Str" + progress+ "String_Node_Str");
          if (prettyOutput != null && prettyOutput.length > 0) {
            prettyOutput[0].prettyOutput();
          }
        }
      }
    }
  }
}