if (tasks.isEmpty() ) { printError("publishExpansion - no tasks"+TaskUtils.taskDesc(parent)); return; } Enumeration elements = tasks.elements(); Task task = (Task)elements.nextElement(); PlanElement pe = parent.getPlanElement(); Expansion expansion; if (pe == null) {  Enumeration enum = tasks.elements(); while (enum.hasMoreElements()) { publishAddTask((Task)enum.nextElement()); }  expansion = buildExpansion(parent, tasks); delegate_.publishAdd(expansion); return; }
if (tasks.isEmpty()) { if (logger.isErrorEnabled()) { logger.error("publishExpansion - no tasks" + TaskUtils.taskDesc(parent)); } return; } Enumeration elements = tasks.elements(); Task task = (Task) elements.nextElement(); PlanElement pe = parent.getPlanElement(); Expansion expansion; if (pe == null) {  Enumeration enum = tasks.elements(); while (enum.hasMoreElements()) { publishAddTask((Task) enum.nextElement()); }  expansion = buildExpansion(parent, tasks); delegate_.publishAdd(expansion); return; }
    protected void publishExpansion(Task parent, Vector tasks) {	if (tasks.isEmpty() ) {	    printError("publishExpansion - no tasks"+TaskUtils.taskDesc(parent));	    return;	}	Enumeration elements = tasks.elements();	Task task = (Task)elements.nextElement();	PlanElement pe = parent.getPlanElement();	Expansion expansion; 	if (pe == null) {	    // In MB5.2 no longer automatically publishes tasks in a workflow.	    Enumeration enum = tasks.elements();	    while (enum.hasMoreElements()) {		publishAddTask((Task)enum.nextElement());	    }	    // create new expansion	    expansion = buildExpansion(parent, tasks);	    delegate_.publishAdd(expansion);	    return;	}