logger.error(taskUtils.taskDesc(task)+ " Start: "+TimeUtils.dateString(start)+ " days_spanned: "+days_spanned);
if (logger.isErrorEnabled()) { logger.error(taskUtils.taskDesc(task)+ " Start: "+TimeUtils.dateString(start)+ " days_spanned: "+days_spanned); }
  public double getActualDemand(int bucket) {    if (bucket >= dueOutList.size()) {      return 0.0;    }    double actualDemand = 0.0;    Rate rate;    Scalar scalar;    Iterator list = ((ArrayList)dueOutList.get(bucket)).iterator();    while (list.hasNext()) {      Task task = (Task)list.next();      if (taskUtils.isProjection(task)) {	long start = (long)PluginHelper.getPreferenceBestValue(task, AspectType.START_TIME);	long end = (long)PluginHelper.getPreferenceBestValue(task, AspectType.END_TIME);	start = getEffectiveProjectionStart(task, start);	if (isValidProjectionTaskInBucket(start, end, bucket)) {	  int days_spanned = getDaysSpanned(bucket, start, end);	  rate = taskUtils.getRate(task);	  try {	    scalar = (Scalar)rate.computeNumerator(durationArray[days_spanned]);	    actualDemand += taskUtils.getDouble(scalar);		  } catch(Exception e) {	    logger.error(taskUtils.taskDesc(task)+			 " Start: "+TimeUtils.dateString(start)+			 " days_spanned: "+days_spanned);	  }	}      } else {	actualDemand += taskUtils.getQuantity(task);      }    }    return actualDemand;   }