Source:
<code>public static void updateDuplicateWidgets(IManagedForm managedForm, AbstractWorkflowArtifact sma, XWidget xWidget, boolean fromHeader) { WorkDefinition workDef = (WorkDefinition) sma.getWorkDefinition(); String currStateName = sma.getStateDefinition().getName(); Object container = managedForm.getContainer(); WfeWorkFlowTab currWFE = null; if (container instanceof WfeWorkFlowTab) { currWFE = (WfeWorkFlowTab) container; <START> } <END> if (currWFE == null) { return; } WfeHeaderComposite headComp = currWFE.getHeader(); Collection<XWidget> headerWidgets = headComp.getXWidgets(new ArrayList<XWidget>()); List<StateXWidgetPage> statePages = currWFE.getStatePages(); Set<String> statePageNames = new HashSet<String>(); for (StateXWidgetPage sP : statePages) { statePageNames.add(sP.getName()); } if (!workDef.getDuplicatesMap().containsKey(xWidget.getLabel())) { return; } for (String key : workDef.getDuplicatesMap().get(xWidget.getLabel())) { if (!fromHeader && key.equals("Header Definition")) { for (XWidget currHeadWidget : headerWidgets) { if (currHeadWidget.getLabel().equals(xWidget.getLabel())) { if (!updateWidget(xWidget, currHeadWidget)) { break; } } } } if (!key.equals("Header Definition") && (key.equals(currStateName) || !statePageNames.contains(key))) { continue; } for (StateXWidgetPage currStatePage : statePages) { Collection<XWidget> updateWidgets = currStatePage.getDynamicXWidgetLayout().getXWidgets(); for (XWidget currUpdateWidget : updateWidgets) { if (currUpdateWidget.getLabel().equals(xWidget.getLabel())) { if (!updateWidget(xWidget, currUpdateWidget)) { break; } } } } } }</code><technical_language>else{return;}</technical_language>

Target:
public static void updateDuplicateWidgets(IManagedForm managedForm, AbstractWorkflowArtifact sma, XWidget xWidget, boolean fromHeader) { WorkDefinition workDef = (WorkDefinition) sma.getWorkDefinition(); String currStateName = sma.getStateDefinition().getName(); Object container = managedForm.getContainer(); WfeWorkFlowTab currWFE = null; if (container instanceof WfeWorkFlowTab) { currWFE = (WfeWorkFlowTab) container; } else { return; } WfeHeaderComposite headComp = currWFE.getHeader(); Collection<XWidget> headerWidgets = headComp.getXWidgets(new ArrayList<XWidget>()); List<StateXWidgetPage> statePages = currWFE.getStatePages(); Set<String> statePageNames = new HashSet<String>(); for (StateXWidgetPage sP : statePages) { statePageNames.add(sP.getName()); } if (!workDef.getDuplicatesMap().containsKey(xWidget.getLabel())) { return; } for (String key : workDef.getDuplicatesMap().get(xWidget.getLabel())) { if (!fromHeader && key.equals("Header Definition")) { for (XWidget currHeadWidget : headerWidgets) { if (currHeadWidget.getLabel().equals(xWidget.getLabel())) { if (!updateWidget(xWidget, currHeadWidget)) { break; } } } } if (!key.equals("Header Definition") && (key.equals(currStateName) || !statePageNames.contains(key))) { continue; } for (StateXWidgetPage currStatePage : statePages) { Collection<XWidget> updateWidgets = currStatePage.getDynamicXWidgetLayout().getXWidgets(); for (XWidget currUpdateWidget : updateWidgets) { if (currUpdateWidget.getLabel().equals(xWidget.getLabel())) { if (!updateWidget(xWidget, currUpdateWidget)) { break; } } } } } }