if (theTask.getPlanElement() == null) {
if (getTaskPlanElement(theTask, allocationsSub[i]) == null) {
  public synchronized void execute() {    // allocate to sink until button pressed    int sinkAllocCounter = 0;    for (int i = 0; i < tasksSub.length; i++) {      if (!(tasksSub[i].hasChanged()))         continue;      Enumeration eTasks = tasksSub[i].getAddedList();      if (!(eTasks.hasMoreElements()))        continue;      CommandInfo c = allCommands[i];      if (c.type_id == CommandInfo.TYPE_ALLOCATE) {        // allocate to sink for now        do {          Task theTask = (Task) eTasks.nextElement();          if (theTask.getPlanElement() == null) {            AllocationResult allocation_result =               computeAllocationResult(theTask);            Allocation allocation =               theLDMF.createAllocation(                theLDMF.getRealityPlan(),                theTask,                sink_asset,                allocation_result,                Role.BOGUS);            publishAdd(allocation);            sinkAllocCounter++;          }        } while (eTasks.hasMoreElements());      } else if (c.type_id == CommandInfo.TYPE_EXPAND) {        // expand as usual        TaskInfo[] toTasks = ((ExpandCommandInfo)c).expandTasks;        do {          Task theTask = (Task) eTasks.nextElement();          if (theTask.getPlanElement() == null) {            for (int j = 0; j < toTasks.length; j++) {              doExpansion(toTasks[j], theTask);            }          }        } while (eTasks.hasMoreElements());      } else {        // no other commands!      }    }    for (int i = 0; i < allocationsSub.length; i++) {      if (allocationsSub[i].hasChanged()) {        updateAllocationResult(allocationsSub[i]);      }    }    // update GUI    incrementSinkAllocCounter(sinkAllocCounter);  }