error (".handleTask - huh? reserved task " + reservedTask.getUID () + " not a member of it's own workflow " + reservedTask.getWorkflow () + "\nuids " + uidsWorkflow(reservedTask));
if (isInfoEnabled()) { info (".handleTask - huh? reserved task " + reservedTask.getUID () + " not a member of it's own workflow " + reservedTask.getWorkflow () + "\nuids " + uidsWorkflow(reservedTask)); }
  public void handleTransportTask(Task task1, Map reservedToActual) {    // find matching reservation transport task    final Task task = task1;    final Collection units = findForPreps (task);    final boolean isReserved = isReservedTask (task);    if (isReservedTask (task) && !ownWorkflow(task)) {      if (isInfoEnabled()) info (".handleTask - skipping reserved task " + task.getUID () + 				" that's not in it's own workflow.");      return;    }    if (isInfoEnabled())      info (getName () + ".handleTask - looking through blackboard for task to match " + 	    ((isReserved) ? "reserved " : "normal ") + task.getUID());    Collection matchingTaskCollection = blackboard.query (new UnaryPredicate () {	public boolean execute (Object obj) {	  if (!(obj instanceof Task)) return false;	  Task examinedTask = (Task) obj;	  if (task.getUID().equals(examinedTask.getUID())) {	    if (isDebugEnabled())	      debug ("skipping self " + examinedTask.getUID());	    return false; // don't match yourself	  }	  // better be a transport task	  if (!(examinedTask.getVerb ().equals (Constants.Verb.TRANSPORT))) {	    if (isDebugEnabled())	      debug ("skipping non-transport task " + examinedTask.getUID());	    return false;	  }	  // is it a reservation task?	  boolean examinedIsReserved = isReservedTask (examinedTask);	  if ((!isReserved && !examinedIsReserved) || 	      ( isReserved &&  examinedIsReserved)) {	    if (isDebugEnabled())	      debug ("skipping examined transport task because same type " + examinedTask.getUID() + " and " + task.getUID());	    return false;	  }	  if (examinedIsReserved) {	    // has it already been removed from workflow?	    if (!taskInWorkflow (examinedTask, examinedTask.getWorkflow())) {	      if (isInfoEnabled ())		info ("skipping reserved transport task " + examinedTask.getUID() + 		      " since it's already been removed from it's workflow.");	      return false;	    }	  }	  else if (!(task instanceof MPTask)) {	    if (isInfoEnabled ())	      info ("saw transport task "  + task.getUID());	  }	  // is it for the same org? 	  Collection examinedUnits = findForPreps (examinedTask);	  Collection copy = new ArrayList(examinedUnits);	  examinedUnits.retainAll (units);	  if (examinedUnits.isEmpty ()) {	    if (isDebugEnabled())	      debug ("skipping transport task where units don't match " + units + " vs examined " + copy);	    return false;	  }	  // are they for the same type of supply?	  if (!contentTypesOverlap (task, examinedTask)) return false;	  // do the dates overlap	  Task reserved, transport;	  if (examinedIsReserved) {	    reserved  = examinedTask;	    transport = task;	  }	  else {	    reserved  = task;	    transport = examinedTask;	  }	  	  return transportDateWithinReservedWindow (transport, reserved);	}      } 							  );    // there can be more than one matching reserved task, e.g. when the actual contains multiple different DODICS:    //  types [DODIC/C787, DODIC/C380, ] vs [DODIC/C787] (Task 1)    //  types [DODIC/C787, DODIC/C380, ] vs [DODIC/C380] (Task 2)    if (matchingTaskCollection.isEmpty () && isInfoEnabled ()) {      info (".handleTask - could not find matching task for " + task.getUID());      return;    }    if (isInfoEnabled ()) {      info  (".handleTask - found " + matchingTaskCollection.size () + " matches.");    }    for (Iterator iter = matchingTaskCollection.iterator(); iter.hasNext();) {      Task reservedTask, actual;      if (isReserved) {	reservedTask = task;	actual       = (Task)iter.next();      }      else {	reservedTask = (Task) iter.next ();	actual       = task;      }      if (!ownWorkflow (reservedTask)) {	error (".handleTask - huh? reserved task " + reservedTask.getUID () + 	       " not a member of it's own workflow " + reservedTask.getWorkflow () + 	       "\nuids " + uidsWorkflow(reservedTask));      }      updateMap (reservedToActual, actual, reservedTask);    }  }