code: private void updateDates(Task parentTask)
     {
        if (parentTask.hasChildTasks())
        {
           int finished = 0;
           Date startDate = parentTask.getStart();
           Date finishDate = parentTask.getFinish();
           Date actualStartDate = parentTask.getActualStart();
           Date actualFinishDate = parentTask.getActualFinish();
           Date earlyStartDate = parentTask.getEarlyStart();
           Date earlyFinishDate = parentTask.getEarlyFinish();
           Date lateStartDate = parentTask.getLateStart();
           Date lateFinishDate = parentTask.getLateFinish();
  
           for (Task task : parentTask.getChildTasks())
           {
              updateDates(task);
  
              startDate = DateHelper.min(startDate, task.getStart());
              finishDate = DateHelper.max(finishDate, task.getFinish());
              actualStartDate = DateHelper.min(actualStartDate, task.getActualStart());
              actualFinishDate = DateHelper.max(actualFinishDate, task.getActualFinish());
              earlyStartDate = DateHelper.min(earlyStartDate, task.getEarlyStart());
              earlyFinishDate = DateHelper.max(earlyFinishDate, task.getEarlyFinish());
              lateStartDate = DateHelper.min(lateStartDate, task.getLateStart());
              lateFinishDate = DateHelper.max(lateFinishDate, task.getLateFinish());
  
              if (task.getActualFinish() != null)
              {
                 ++finished;
              }
           }
  
           parentTask.setStart(startDate);
           parentTask.setFinish(finishDate);
           parentTask.setActualStart(actualStartDate);
           parentTask.setEarlyStart(earlyStartDate);
           parentTask.setEarlyFinish(earlyFinishDate);
           parentTask.setLateStart(lateStartDate);
           parentTask.setLateFinish(lateFinishDate);
  
           //
           // Only if all child tasks have actual finish dates do we
           // set the actual finish date on the parent task.
           //
           if (finished == parentTask.getChildTasks().size())
           {
              parentTask.setActualFinish(actualFinishDate);
           }
        }
     }
docs: See the notes above.
  
  @param parentTask parent task.