Program: 120201
Project: 120201
Buggy source:
@Override public void run(){
  TreeNode treeNode=null;
  boolean needWarning=false;
  if (input) {
    treeNode=XmlmapFactory.eINSTANCE.createTreeNode();
    if (!selectedNode.getOutgoingConnections().isEmpty()) {
      needWarning=true;
    }
  }
 else {
    treeNode=XmlmapFactory.eINSTANCE.createOutputTreeNode();
    EList<Connection> incomingConnections=selectedNode.getIncomingConnections();
    if (!incomingConnections.isEmpty()) {
      needWarning=true;
    }
  }
  boolean canContinue=true;
  if (needWarning) {
    canContinue=MessageDialog.openConfirm(null,"String_Node_Str","String_Node_Str");
  }
  if (canContinue) {
    AbstractUIPlugin plugin=(AbstractUIPlugin)Platform.getPlugin(PlatformUI.PLUGIN_ID);
    IDialogSettings workbenchSettings=plugin.getDialogSettings();
    IDialogSettings section=workbenchSettings.getSection("String_Node_Str");
    if (section == null) {
      section=workbenchSettings.addNewSection("String_Node_Str");
    }
    boolean popupMessageDialog=!section.getBoolean(HIDE_MESSAGE);
    if (popupMessageDialog) {
      String message="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
      SubsMessageDialog dialog=new SubsMessageDialog(null,message);
      if (dialog.open() == Window.OK) {
        boolean hideDialogNextTime=dialog.getResult();
        if (hideDialogNextTime) {
          section.put(HIDE_MESSAGE,true);
        }
      }
    }
    XmlMapUtil.detachNodeConnections(selectedNode,mapperManager.getExternalData(),false);
    treeNode.setName(selectedNode.getName() + XSDPopulationUtil2.SUBS);
    treeNode.setNodeType(NodeType.ELEMENT);
    treeNode.setXpath(selectedNode.getXpath() + XmlMapUtil.XPATH_SEPARATOR + treeNode.getName());
    treeNode.setSubstitution(true);
    TreeNode parentNode=(TreeNode)selectedNode.eContainer();
    int index=parentNode.getChildren().indexOf(selectedNode);
    parentNode.getChildren().remove(selectedNode);
    treeNode.getChildren().add(selectedNode);
    parentNode.getChildren().add(index,treeNode);
    if (!input) {
      OutputTreeNode output=(OutputTreeNode)selectedNode;
      if (!XmlMapUtil.isExpressionEditable(output) && output.isAggregate()) {
        output.setAggregate(false);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  TreeNode treeNode=null;
  boolean needWarning=false;
  if (input) {
    treeNode=XmlmapFactory.eINSTANCE.createTreeNode();
    if (!selectedNode.getOutgoingConnections().isEmpty()) {
      needWarning=true;
    }
  }
 else {
    treeNode=XmlmapFactory.eINSTANCE.createOutputTreeNode();
    EList<Connection> incomingConnections=selectedNode.getIncomingConnections();
    if (!incomingConnections.isEmpty()) {
      needWarning=true;
    }
  }
  boolean canContinue=true;
  if (needWarning) {
    canContinue=MessageDialog.openConfirm(null,"String_Node_Str","String_Node_Str");
  }
  if (canContinue) {
    AbstractUIPlugin plugin=(AbstractUIPlugin)Platform.getPlugin(PlatformUI.PLUGIN_ID);
    IDialogSettings workbenchSettings=plugin.getDialogSettings();
    IDialogSettings section=workbenchSettings.getSection("String_Node_Str");
    if (section == null) {
      section=workbenchSettings.addNewSection("String_Node_Str");
    }
    boolean popupMessageDialog=!section.getBoolean(HIDE_MESSAGE);
    if (popupMessageDialog) {
      String message="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
      SubsMessageDialog dialog=new SubsMessageDialog(null,message);
      if (dialog.open() == Window.OK) {
        boolean hideDialogNextTime=dialog.getResult();
        if (hideDialogNextTime) {
          section.put(HIDE_MESSAGE,true);
        }
      }
    }
    XmlMapUtil.detachNodeConnections(selectedNode,mapperManager.getExternalData(),false);
    treeNode.setName(selectedNode.getName() + XSDPopulationUtil2.SUBS);
    treeNode.setNodeType(NodeType.ELEMENT);
    treeNode.setXpath(selectedNode.getXpath() + XmlMapUtil.XPATH_SEPARATOR + treeNode.getName());
    treeNode.setSubstitution(true);
    TreeNode parentNode=(TreeNode)selectedNode.eContainer();
    int index=parentNode.getChildren().indexOf(selectedNode);
    parentNode.getChildren().remove(selectedNode);
    treeNode.getChildren().add(selectedNode);
    parentNode.getChildren().add(index,treeNode);
    if (!input) {
      OutputTreeNode output=(OutputTreeNode)selectedNode;
      if (!XmlMapUtil.isExpressionEditable(output) && output.isAggregate()) {
        output.setAggregate(false);
      }
    }
    Object object=graphicViewer.getEditPartRegistry().get(treeNode);
    if (object instanceof TreeNodeEditPart) {
      graphicViewer.select((TreeNodeEditPart)object);
    }
  }
}