Program: 75601
Project: 75601
Buggy source:
public void handleSelectionChanged(ISelection selection){
  if (getSourceViewer() == null || !getSourceViewer().getTextWidget().isVisible()) {
    return;
  }
  if (editorUIEnabled == true) {
    saveModel();
  }
  if (selection != null) {
    settingText=true;
    Object[] sel=((IStructuredSelection)selection).toArray();
    if (sel.length == 1 && sel[0] instanceof DesignElementHandle) {
      editObject=sel[0];
      palettePage.getSupport().setCurrentEditObject(editObject);
      if (editObject instanceof ExtendedItemHandle) {
        disableEditor();
        cmbExpList.removeAll();
        cmbItemLastSelected=null;
        getSourceViewer().getTextWidget().setEnabled(true);
        setEditorText(((ExtendedItemHandle)editObject).getExternalScript());
        context.setVariable("String_Node_Str","String_Node_Str");
      }
 else {
        setComboViewerInput(editObject);
        cmbItemLastSelected=null;
        setEditorText("String_Node_Str");
        if (cmbExpList.getItemCount() > 0) {
          enableEditor();
          selectItemInComboExpList((ISelection)selectionMap.get(getModel()));
        }
 else {
          disableEditor();
        }
      }
      checkDirty();
      palettePage.getSupport().updateParametersTree();
    }
 else {
      disableEditor();
      cmbExpList.removeAll();
      cmbItemLastSelected=null;
      palettePage.getSupport().setCurrentEditObject(null);
    }
    if (sel.length > 0) {
      updateAnnotationLabel(sel[0]);
    }
    settingText=false;
  }
}

Fixed version (ground truth):
public void handleSelectionChanged(ISelection selection){
  if (getSourceViewer() == null || !getSourceViewer().getTextWidget().isVisible()) {
    return;
  }
  if (editorUIEnabled == true) {
    saveModel();
  }
  if (selection != null) {
    settingText=true;
    Object[] sel=((IStructuredSelection)selection).toArray();
    if (sel.length == 1) {
      editObject=sel[0];
      if (sel[0] instanceof ScriptElementNode) {
        editObject=((ScriptElementNode)editObject).getParent();
      }
    }
    if (editObject instanceof DesignElementHandle) {
      palettePage.getSupport().setCurrentEditObject(editObject);
      if (editObject instanceof ExtendedItemHandle) {
        disableEditor();
        cmbExpList.removeAll();
        cmbItemLastSelected=null;
        getSourceViewer().getTextWidget().setEnabled(true);
        setEditorText(((ExtendedItemHandle)editObject).getExternalScript());
        context.setVariable("String_Node_Str","String_Node_Str");
      }
 else {
        setComboViewerInput(editObject);
        cmbItemLastSelected=null;
        setEditorText("String_Node_Str");
        if (cmbExpList.getItemCount() > 0) {
          enableEditor();
          selectItemInComboExpList((ISelection)selectionMap.get(getModel()));
        }
 else {
          disableEditor();
        }
      }
      checkDirty();
      palettePage.getSupport().updateParametersTree();
    }
 else {
      disableEditor();
      cmbExpList.removeAll();
      cmbItemLastSelected=null;
      palettePage.getSupport().setCurrentEditObject(null);
    }
    if (sel.length > 0) {
      updateAnnotationLabel(sel[0]);
    }
    settingText=false;
  }
}