Enumeration tasks = myAllocatableTasks.getAddedList();  Collection subs = retrieveSubOrgs(myOrgAssets.getCollection()); if (myLogger.isDebugEnabled()) { myLogger.debug("Expanding " + myAllocatableTasks.getAddedCollection().size() + " added tasks");
Collection tasks = myAllocatableTasks.getAddedCollection();  if (!tasks.isEmpty()) { if (myLogger.isDebugEnabled()) { myLogger.debug("Expanding " + tasks.size() + " added tasks"); }  Collection subs = retrieveSubOrgs(myOrgAssets.getCollection()); for (Iterator iterator = tasks.iterator(); iterator.hasNext();) { Task task = (Task) iterator.next(); expand(task, subs); }
  public synchronized void execute() {    if (myAllocatableTasks.hasChanged() ) {      Enumeration tasks = myAllocatableTasks.getAddedList();            Collection subs = retrieveSubOrgs(myOrgAssets.getCollection());      if (myLogger.isDebugEnabled()) {        myLogger.debug("Expanding "                     + myAllocatableTasks.getAddedCollection().size()                     + " added tasks");      }      while (tasks.hasMoreElements()) {        Task task = (Task) tasks.nextElement();	expand(task, subs);      }      tasks = myAllocatableTasks.getChangedList();      if (myLogger.isDebugEnabled()) {        myLogger.debug("Updating "                     + myAllocatableTasks.getChangedCollection().size()                     + " changed tasks");      }      while (tasks.hasMoreElements()) {        Task task = (Task) tasks.nextElement();	update(task);      }    }    // check the asset container for new Subordinates    if (myOrgAssets.hasChanged()) {      /**       * When a new subordinate appears we must modify the existing       * expansions to include the new subordinate.       **/      Collection newSubs = retrieveSubOrgs(myOrgAssets.getCollection());      for (Iterator iterator = newSubs.iterator(); iterator.hasNext();) {        Organization org = (Organization)iterator.next();        // Remove from set if we already know about it        if (mySubs.get(org.getUID()) != null) {          iterator.remove();        } else {          mySubs.put(org.getUID(), org);        }      }      for (Enumeration expansions = myExpansions.elements(); 	   expansions.hasMoreElements(); ) {	// It's an error if subs show up after we've sent GLS (bug 2990)	if (newSubs.size() > 0) {	  myLogger.error(getAgentIdentifier() + 		       " adding subordinates - " + newSubs + " after initial GLS");	}        Expansion exp = (Expansion) expansions.nextElement();        augmentExpansion(exp, newSubs);      }      /** Should handle removed assets, too **/    }		    if (myAllocations.hasChanged()) {      if (myLogger.isDebugEnabled()) {	myLogger.debug(getAgentIdentifier() + " updating allocations");      }      PluginHelper.updateAllocationResult(myAllocations);    }        if (myExpansions.hasChanged()) {      if (myLogger.isDebugEnabled()) {	myLogger.debug(getAgentIdentifier() + " updating allocations");      }      PluginHelper.updateAllocationResult(myExpansions);    }  } // end of execute