AllocationResult ar = pe.getEstimatedResult();  if (ar != null) { double resultTime;   if (ar.isDefined(AspectType.END_TIME)) { resultTime = ar.getValue(AspectType.END_TIME); } else { resultTime = ar.getValue(AspectType.START_TIME); } return (long) resultTime; } else {  return PluginHelper.getEndTime(task); } }
  private long getEndTime(Task task) {    PlanElement pe = task.getPlanElement();    // If the task has no plan element then return the EndTime Pref    if (pe == null) {      return PluginHelper.getEndTime(task);    }    AllocationResult ar = pe.getEstimatedResult();    // make sure that we got atleast a valid reported OR estimated allocation result    if (ar != null) {      double resultTime;      // make sure END_TIME is specified - otherwise use START_TIME      // UniversalAllocator plugin only gives start times      if (ar.isDefined(AspectType.END_TIME)) {        resultTime = ar.getValue(AspectType.END_TIME);      } else {        resultTime = ar.getValue(AspectType.START_TIME);      }      return (long) resultTime;    } else {      // if for some reason we have a pe but no ar return the pref      return PluginHelper.getEndTime(task);    }  }    