code: protected String[] getTaskDiagnosticsImpl(TaskAttemptID taskId)
      throws IOException {
  
      List<String> taskDiagnosticInfo = null;
      JobID jobId = taskId.getJobID();
      TaskID tipId = taskId.getTaskID();
      JobInProgressTraits job = getJobInProgress(jobId);
  
      if (job != null && job.inited()) {
        TaskInProgress tip = job.getTaskInProgress(tipId);
        if (tip != null) {
          taskDiagnosticInfo = tip.getDiagnosticInfo(taskId);
        }
  
      }
      return ((taskDiagnosticInfo == null) ? EMPTY_TASK_DIAGNOSTICS :
              taskDiagnosticInfo.toArray(new String[taskDiagnosticInfo.size()]));
    }
docs: Get the diagnostics for a given task
  @param taskId the id of the task
  @return an array of the diagnostic messages