if (logger.isDebugEnabled()) { logger.debug("Fixing plan element : " + hc(task) + " to " + hc(this)); } } } if (this instanceof Allocation) { fixAsset(((Allocation)this).getAsset()); } else if (this instanceof AssetTransfer) { fixAsset(((AssetTransfer)this).getAsset()); fixAsset(((AssetTransfer)this).getAssignee()); } if (logger.isDebugEnabled()) { if (this instanceof Expansion) { Expansion exp = (Expansion) this; Workflow wf = exp.getWorkflow(); for (Enumeration en = wf.getTasks(); en.hasMoreElements(); ) { Task subtask = (Task) en.nextElement(); PlanElement subtaskPE = subtask.getPlanElement(); if (subtaskPE == null) { logger.debug("Subtask " + subtask.getUID() + " not disposed"); } else { logger.debug("Subtask " + subtask.getUID() + " disposed " + hc(subtaskPE)); } }
  public void postRehydration(Logger logger) {    if (logger.isDebugEnabled()) {      logger.debug("Rehydrated plan element: " + this);    }    TaskImpl task = (TaskImpl) getTask();    if (task != null) {      PlanElement taskPE = task.getPlanElement();      if (taskPE != this) {        if (taskPE != null) {          if (logger.isDebugEnabled()) {            logger.debug("Bogus plan element for task: " + hc(task));          }          task.privately_resetPlanElement();        }        task.privately_setPlanElement(this); // These links can get severed during rehydration        if (logger.isDebugEnabled()) {          logger.debug("Fixing plan element : " + hc(task) + " to " + hc(this));        }      }    }    if (this instanceof Allocation) {      fixAsset(((Allocation)this).getAsset());    } else if (this instanceof AssetTransfer) {      fixAsset(((AssetTransfer)this).getAsset());      fixAsset(((AssetTransfer)this).getAssignee());    }    if (logger.isDebugEnabled()) {      if (this instanceof Expansion) {        Expansion exp = (Expansion) this;        Workflow wf = exp.getWorkflow();        for (Enumeration en = wf.getTasks(); en.hasMoreElements(); ) {          Task subtask = (Task) en.nextElement();          PlanElement subtaskPE = subtask.getPlanElement();          if (subtaskPE == null) {            logger.debug("Subtask " + subtask.getUID() + " not disposed");          } else {            logger.debug("Subtask " + subtask.getUID() + " disposed " + hc(subtaskPE));          }        }      }    }  }