Program: 69730
Project: 69730
Buggy source:
public void handleSelectionChanged(ISelection selection){
  if (editorUIEnabled == true) {
    saveModel();
  }
  if (selection != null) {
    Object[] sel=((IStructuredSelection)selection).toArray();
    IElementPropertyDefn targetMethod=null;
    if (sel.length == 1) {
      editObject=sel[0];
      if (sel[0] instanceof ScriptElementNode) {
        editObject=((ScriptElementNode)editObject).getParent();
      }
 else       if (sel[0] instanceof ScriptObjectNode) {
        editObject=((ScriptObjectNode)editObject).getParent();
      }
      if (editObject instanceof PropertyHandle) {
        targetMethod=((PropertyHandle)editObject).getPropertyDefn();
        editObject=((PropertyHandle)editObject).getElementHandle();
      }
    }
    if (editObject instanceof DesignElementHandle) {
      palettePage.getSupport().setCurrentEditObject(editObject);
      setComboViewerInput(editObject);
      cmbItemLastSelected=null;
      setEditorText("String_Node_Str");
      if (cmbExpList.getItemCount() > 0) {
        enableEditor();
        if (targetMethod != null) {
          selectItemInComboExpList(new StructuredSelection(targetMethod));
        }
 else {
          selectItemInComboExpList((ISelection)selectionMap.get(getModel()));
        }
      }
 else {
        disableEditor();
      }
      checkDirty();
      palettePage.getSupport().updateParametersTree();
    }
 else {
      disableEditor();
      cmbExpList.removeAll();
      cmbSubFunctions.setItems(null);
      cmbItemLastSelected=null;
      palettePage.getSupport().setCurrentEditObject(null);
    }
    if (sel.length > 0) {
      updateAnnotationLabel(sel[0]);
    }
  }
}

Fixed version (ground truth):
public void handleSelectionChanged(ISelection selection){
  if (editorUIEnabled == true) {
    saveModel();
  }
  if (selection != null) {
    Object[] sel=((IStructuredSelection)selection).toArray();
    IElementPropertyDefn targetMethod=null;
    if (sel.length == 1) {
      editObject=sel[0];
      if (sel[0] instanceof ScriptElementNode) {
        editObject=((ScriptElementNode)editObject).getParent();
      }
 else       if (sel[0] instanceof ScriptObjectNode) {
        editObject=((ScriptObjectNode)editObject).getParent();
      }
      if (editObject instanceof PropertyHandle) {
        targetMethod=((PropertyHandle)editObject).getPropertyDefn();
        if (targetMethod.getMethodInfo() != null) {
          editObject=((PropertyHandle)editObject).getElementHandle();
        }
      }
    }
    if (editObject instanceof DesignElementHandle) {
      palettePage.getSupport().setCurrentEditObject(editObject);
      setComboViewerInput(editObject);
      cmbItemLastSelected=null;
      setEditorText("String_Node_Str");
      if (cmbExpList.getItemCount() > 0) {
        enableEditor();
        if (targetMethod != null) {
          selectItemInComboExpList(new StructuredSelection(targetMethod));
        }
 else {
          selectItemInComboExpList((ISelection)selectionMap.get(getModel()));
        }
      }
 else {
        disableEditor();
      }
      checkDirty();
      palettePage.getSupport().updateParametersTree();
    }
 else {
      disableEditor();
      cmbExpList.removeAll();
      cmbSubFunctions.setItems(null);
      cmbItemLastSelected=null;
      palettePage.getSupport().setCurrentEditObject(null);
    }
    if (sel.length > 0) {
      updateAnnotationLabel(sel[0]);
    }
  }
}