for (Iterator iter = toReplan.iterator(); iter.hasNext(); ) { SequentialScheduleElement replanSSE = (SequentialScheduleElement) iter.next(); replanPortion (exp, replanSSE); }   if (!toReplan.isEmpty()) { if (isInfoEnabled ()) { info ("got overlap of " + parentTask.getUID()); } turnCrank (parentTask); } }
  protected void replanDependingTasks (Task parentTask, long beforeTime) {    Expansion exp = (Expansion) parentTask.getPlanElement();    if (exp == null) {      if (isInfoEnabled()) {	info ("no expansion for " + parentTask.getUID() + " must be in middle of rescinds.");      }      return;    }          PrepositionalPhrase prep = prepHelper.getPrepNamed(parentTask, GLMTransConst.SequentialSchedule);    Schedule sched = (Schedule) prep.getIndirectObject();    Enumeration enum = sched.getAllScheduleElements();    boolean overlap = false;    Set toReplan = new HashSet();    while (enum.hasMoreElements()) {      SequentialScheduleElement spe = (SequentialScheduleElement)enum.nextElement();      String uid = "<NO TASK>";      if (spe.getTask () != null)	uid = spe.getTask ().getUID ().toString();      if (isInfoEnabled ()) {	info ("for task " + parentTask.getUID() + 	      " spe task " + uid +	      " spe planned " + spe.isPlanned () +	      " spe end date " + spe.getEndDate () + 	      " before time " + new Date(beforeTime));      }      if (spe.isPlanned ()) {	for (Iterator iter = spe.getDependencies ().iterator (); iter.hasNext(); ) {	  SequentialScheduleElement dependency = (SequentialScheduleElement)iter.next();	  // |--- spe ---|               (overlap) 	  //    |--- dep ---|	  //   OR 	  // |--- dep ---| |--- spe ---| (dependency should always be after!)	  if (spe.overlapSchedule (dependency) || dependency.getEndTime () < spe.getStartTime()) {	    if (isInfoEnabled ()) {	      info ("for task " + parentTask.getUID() + " replanning spe at " + spe.getEndDate ());	    }	    toReplan.add (spe);	  }	}      }    }