Program: 95726
Project: 95726
Buggy source:
/** 
 * @param autId The ID of the AUT for which to start the Object Mapping Mode.
 * @param editor the actual om-editor
 * @param unmappedTechNames the top-level category for unmapped Technical Names
 */
private void startMappingMode(AutIdentifier autId,ObjectMappingMultiPageEditor editor,IObjectMappingCategoryPO unmappedTechNames){
  IObjectMappingCategoryPO category=null;
  if (!(editor.getTreeViewer().getSelection() instanceof IStructuredSelection) || !(editor.getTreeViewer().getContentProvider() instanceof ITreeContentProvider)) {
    return;
  }
  IStructuredSelection selection=(IStructuredSelection)editor.getTreeViewer().getSelection();
  Object node;
  if (selection.size() == 1) {
    node=selection.getFirstElement();
    if (node instanceof IObjectMappingCategoryPO && OMEditorDndSupport.getSection((IObjectMappingCategoryPO)node).equals(unmappedTechNames)) {
      category=(IObjectMappingCategoryPO)node;
    }
 else     if (node instanceof IObjectMappingAssoziationPO && OMEditorDndSupport.getSection((IObjectMappingAssoziationPO)node).equals(unmappedTechNames)) {
      category=((IObjectMappingAssoziationPO)node).getCategory();
    }
    if (category != null) {
      editor.getOmEditorBP().setCategoryToCreateIn(category);
    }
 else {
      ObjectMappingEventDispatcher.setCategoryToCreateIn(null);
    }
  }
  if (!AutAgentRegistration.getInstance().getRegisteredAuts().contains(autId)) {
    String message=Messages.OMStartMappingModeActionError1;
    ErrorHandlingUtil.createMessageDialog(new JBException(message,MessageIDs.E_UNEXPECTED_EXCEPTION),null,new String[]{message});
  }
 else {
    int mod=Plugin.getDefault().getPreferenceStore().getInt(Constants.MAPPING_MOD_KEY);
    int key=Plugin.getDefault().getPreferenceStore().getInt(Constants.MAPPING_TRIGGER_KEY);
    int type=Plugin.getDefault().getPreferenceStore().getInt(Constants.MAPPING_TRIGGER_TYPE_KEY);
    final String toolkit=editor.getAut().getToolkit();
    if (toolkit.equals(CommandConstants.SWT_TOOLKIT) || toolkit.equals(CommandConstants.RCP_TOOLKIT)) {
      mod=KeyConverter.convertSwingStateMask(mod);
      key=KeyConverter.convertSwingToSwt(key);
    }
    Job startObjectMappingModeJob=new StartObjectMappingModeJob(editor,autId,mod,key,category,type);
    startObjectMappingModeJob.setSystem(true);
    JobUtils.executeJob(startObjectMappingModeJob,null);
  }
}

Fixed version (ground truth):
/** 
 * @param autId The ID of the AUT for which to start the Object Mapping Mode.
 * @param editor the actual om-editor
 * @param unmappedTechNames the top-level category for unmapped Technical Names
 */
private void startMappingMode(AutIdentifier autId,ObjectMappingMultiPageEditor editor,IObjectMappingCategoryPO unmappedTechNames){
  IObjectMappingCategoryPO category=null;
  TreeViewer treeViewer=editor.getTreeViewer();
  if (treeViewer != null && ((treeViewer.getSelection() instanceof IStructuredSelection) || (treeViewer.getContentProvider() instanceof ITreeContentProvider))) {
    IStructuredSelection selection=(IStructuredSelection)treeViewer.getSelection();
    Object node;
    if (selection.size() == 1) {
      node=selection.getFirstElement();
      if (node instanceof IObjectMappingCategoryPO && OMEditorDndSupport.getSection((IObjectMappingCategoryPO)node).equals(unmappedTechNames)) {
        category=(IObjectMappingCategoryPO)node;
      }
 else       if (node instanceof IObjectMappingAssoziationPO && OMEditorDndSupport.getSection((IObjectMappingAssoziationPO)node).equals(unmappedTechNames)) {
        category=((IObjectMappingAssoziationPO)node).getCategory();
      }
      if (category != null) {
        editor.getOmEditorBP().setCategoryToCreateIn(category);
      }
 else {
        ObjectMappingEventDispatcher.setCategoryToCreateIn(null);
      }
    }
  }
  if (!AutAgentRegistration.getInstance().getRegisteredAuts().contains(autId)) {
    String message=Messages.OMStartMappingModeActionError1;
    ErrorHandlingUtil.createMessageDialog(new JBException(message,MessageIDs.E_UNEXPECTED_EXCEPTION),null,new String[]{message});
  }
 else {
    IPreferenceStore preferenceStore=Plugin.getDefault().getPreferenceStore();
    int mod=preferenceStore.getInt(Constants.MAPPING_MOD_KEY);
    int key=preferenceStore.getInt(Constants.MAPPING_TRIGGER_KEY);
    int type=preferenceStore.getInt(Constants.MAPPING_TRIGGER_TYPE_KEY);
    final String toolkit=editor.getAut().getToolkit();
    if (toolkit.equals(CommandConstants.SWT_TOOLKIT) || toolkit.equals(CommandConstants.RCP_TOOLKIT)) {
      mod=KeyConverter.convertSwingStateMask(mod);
      key=KeyConverter.convertSwingToSwt(key);
    }
    Job startObjectMappingModeJob=new StartObjectMappingModeJob(editor,autId,mod,key,category,type);
    startObjectMappingModeJob.setSystem(true);
    JobUtils.executeJob(startObjectMappingModeJob,null);
  }
}