Program: 121784
Project: 121784
Buggy source:
@Override public void run(){
  List<FOXTreeNode> list=new ArrayList<FOXTreeNode>();
  FileDialog f=new FileDialog(shell);
  String file=f.open();
  if (file != null) {
    boolean clickOk=false;
    TreeNode treeNodeRoot=null;
    String detailedMessage="String_Node_Str";
    try {
      clickOk=TreeUtil.getFoxTreeNodesForXmlMap(file,shell,list);
      if (!clickOk) {
        return;
      }
      treeNodeRoot=XmlMapUtil.getTreeNodeRoot(parentNode);
      XmlMapUtil.detachNodeConnections(treeNodeRoot,mapperManager.getCopyOfMapData(),true);
      parentNode.getChildren().clear();
      prepareEmfTreeNode(list,parentNode);
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
      StringBuffer sb=new StringBuffer();
      sb.append(e.toString());
      sb.append("String_Node_Str");
      if (e.getStackTrace() != null) {
        for (        StackTraceElement trace : e.getStackTrace()) {
          sb.append(trace.toString());
          sb.append("String_Node_Str");
        }
      }
      detailedMessage=sb.toString();
    }
    boolean childrenEmpty=false;
    if (parentNode.getChildren().isEmpty()) {
      childrenEmpty=true;
      TreeNode rootNode=null;
      if (input) {
        rootNode=XmlmapFactory.eINSTANCE.createTreeNode();
      }
 else {
        rootNode=XmlmapFactory.eINSTANCE.createOutputTreeNode();
      }
      rootNode.setName("String_Node_Str");
      rootNode.setNodeType(NodeType.ELEMENT);
      rootNode.setType(XmlMapUtil.DEFAULT_DATA_TYPE);
      rootNode.setXpath(XmlMapUtil.getXPath(parentNode.getXpath(),"String_Node_Str",NodeType.ELEMENT));
      parentNode.getChildren().add(rootNode);
      parentNode.getChildren().get(0).setLoop(true);
      parentNode.getChildren().get(0).setMain(true);
    }
    if (childrenEmpty || (detailedMessage != null && !"String_Node_Str".equals(detailedMessage))) {
      showError(detailedMessage);
    }
    if (parentNode.eContainer() instanceof InputXmlTree) {
      XmlMapConnectionBuilder.rebuildLinks(parentNode,mapperManager.getCopyOfMapData());
      mapperManager.refreshInputTreeSchemaEditor((InputXmlTree)parentNode.eContainer());
    }
 else     if (parentNode.eContainer() instanceof OutputXmlTree) {
      mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree)parentNode.eContainer());
    }
    if (treeNodeRoot != null && treeNodeRoot.eContainer() instanceof AbstractInOutTree) {
      mapperManager.getProblemsAnalyser().checkProblems((AbstractInOutTree)treeNodeRoot.eContainer());
      mapperManager.getMapperUI().updateStatusBar();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  List<FOXTreeNode> list=new ArrayList<FOXTreeNode>();
  FileDialog f=new FileDialog(shell);
  String file=f.open();
  if (file != null) {
    boolean clickOk=false;
    TreeNode treeNodeRoot=null;
    String detailedMessage="String_Node_Str";
    try {
      clickOk=TreeUtil.getFoxTreeNodesForXmlMap(file,shell,list);
      if (!clickOk) {
        return;
      }
      treeNodeRoot=XmlMapUtil.getTreeNodeRoot(parentNode);
      XmlMapUtil.detachNodeConnections(treeNodeRoot,mapperManager.getCopyOfMapData(),true);
      parentNode.getChildren().clear();
      prepareEmfTreeNode(list,parentNode);
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
      StringBuffer sb=new StringBuffer();
      sb.append(e.toString());
      sb.append("String_Node_Str");
      if (e.getStackTrace() != null) {
        for (        StackTraceElement trace : e.getStackTrace()) {
          sb.append(trace.toString());
          sb.append("String_Node_Str");
        }
      }
      detailedMessage=sb.toString();
    }
    boolean childrenEmpty=false;
    if (parentNode.getChildren().isEmpty()) {
      childrenEmpty=true;
      TreeNode rootNode=null;
      if (input) {
        rootNode=XmlmapFactory.eINSTANCE.createTreeNode();
      }
 else {
        rootNode=XmlmapFactory.eINSTANCE.createOutputTreeNode();
      }
      rootNode.setName("String_Node_Str");
      rootNode.setNodeType(NodeType.ELEMENT);
      rootNode.setType(XmlMapUtil.DEFAULT_DATA_TYPE);
      rootNode.setXpath(XmlMapUtil.getXPath(parentNode.getXpath(),"String_Node_Str",NodeType.ELEMENT));
      parentNode.getChildren().add(rootNode);
    }
    parentNode.getChildren().get(0).setLoop(true);
    parentNode.getChildren().get(0).setMain(true);
    if (childrenEmpty || (detailedMessage != null && !"String_Node_Str".equals(detailedMessage))) {
      showError(detailedMessage);
    }
    if (parentNode.eContainer() instanceof InputXmlTree) {
      XmlMapConnectionBuilder.rebuildLinks(parentNode,mapperManager.getCopyOfMapData());
      mapperManager.refreshInputTreeSchemaEditor((InputXmlTree)parentNode.eContainer());
    }
 else     if (parentNode.eContainer() instanceof OutputXmlTree) {
      mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree)parentNode.eContainer());
    }
    if (treeNodeRoot != null && treeNodeRoot.eContainer() instanceof AbstractInOutTree) {
      mapperManager.getProblemsAnalyser().checkProblems((AbstractInOutTree)treeNodeRoot.eContainer());
      mapperManager.getMapperUI().updateStatusBar();
    }
  }
}