public synchronized void setTaskResult(String taskId, TaskResult result) {
    TaskDisplay taskDisplay = tasks.get(taskId);
    if (taskDisplay != null) {
      taskDisplay.returnValue = result.getExitVal();
      if (result.getTaskError() != null) {
        taskDisplay.errorMsg = result.getTaskError().toString();
      }
    }
  }
Preferred objectMapper for this class.

It must be used to have things work in shaded environment (and its also more performant).
ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java