else if (isInfoEnabled ()) { info ("uidToMPTask - removing mp task uid " + t.getUID() + " from map");
else { if (isInfoEnabled ()) { info ("uidToMPTask - removing mp task uid " + mpt.getUID() + " from map"); }    Collection parentsToReplan = new HashSet ();  for (Enumeration enum = ((MPTask)mpt).getParentTasks(); enum.hasMoreElements(); ) { Task parent = (Task) enum.nextElement(); if (parent.getPlanElement () != null) { if (isInfoEnabled ()) { info ("uidToMPTask - from MPTask parent enum - removing plan element from parent " + parent.getUID()); } parentsToReplan.add (parent); } }  for (Iterator iter = mpt.getComposition ().getParentTasks ().iterator(); iter.hasNext(); ) { Task parent = (Task) iter.next(); if (parent.getPlanElement () != null) { if (isInfoEnabled ()) { info ("uidToMPTask - from composition parent tasks - removing plan element from parent " + parent.getUID()); } parentsToReplan.add (parent); } }  for (Iterator iter = parentsToReplan.iterator (); iter.hasNext(); ) { Task parent = (Task) iter.next(); publishRemove (parent.getPlanElement()); publishChange (parent); }  if (!parentsToReplan.isEmpty ()) {  handleRemovedTasks (Collections.enumeration(parentsToReplan)); }
  public void setupFilters () {    super.setupFilters ();    if (isInfoEnabled()) {      info (getName () + " : Filtering for Aggregations...");    }    addFilter (myAggCallback    = createAggCallback    ());    if (isInfoEnabled()) {      info (getName () + " : Filtering for Expansions...");    }    addFilter (new UTILExpansionCallback (this, logger));    addFilter (mpTaskCallback = new UTILFilterCallbackAdapter (this, logger) {	protected UnaryPredicate getPredicate () {	  return new UnaryPredicate() {	      public boolean execute(Object o) {		return ( o instanceof MPTask );	      }	    };	}	public void reactToChangedFilter () {	  Enumeration addedtasks = getSubscription().getAddedList();	  while (addedtasks.hasMoreElements()) {	    Task t = (Task) addedtasks.nextElement();	    if (!(t instanceof MPTask))	      error ("huh? " + t + " is not an MPTask??");	    if (isInfoEnabled ()) {	      info ("uidToMPTask - mapping mptask " + t.getUID());	    }	    uidToMPTask.put (t.getUID (), t);	  }	  if (getSubscription().getRemovedList().hasMoreElements ()) {	    Enumeration removedtasks = getSubscription().getRemovedList();	    while (removedtasks.hasMoreElements()) {	      Task t = (Task) removedtasks.nextElement();	      if (uidToMPTask.remove (t.getUID()) == null) {		if (isWarnEnabled ()) {		  warn ("no mp task in map with uid " + t.getUID ());		}	      }	      else if (isInfoEnabled ()) {		info ("uidToMPTask - removing mp task uid " + t.getUID() + " from map");	      }	    }	  }	}      }	       );    addFilter (new UTILFilterCallbackAdapter (this, logger) {	protected UnaryPredicate getPredicate () {	  return new UnaryPredicate() {	      public boolean execute(Object o) {		if (!(o instanceof Task))		  return false;		Task task = (Task) o;		PlanElement pe = task.getPlanElement ();		boolean hasPE = (pe != null);		if (hasPE && pe instanceof Aggregation)		  return false;		if (o instanceof MPTask)		  return false;		else // non-MPTasks that don't have aggregations		  return true;	      }	    };	}	public void reactToChangedFilter () {	  if (getSubscription().getRemovedList().hasMoreElements ()) {	    Enumeration removedtasks = getSubscription().getRemovedList();	    while (removedtasks.hasMoreElements()) {	      Task removed = (Task) removedtasks.nextElement();	      if (!forgetTripletToTask (removed)) {		if (isInfoEnabled ()) {		  info ("no task in map with uid " + removed.getUID ());		}	      }	      else if (isInfoEnabled ()) {		info ("removing task uid " + removed.getUID() + " from maps");	      }	    }	  }	}      }	       );  }