Program: 122057
Project: 122057
Buggy source:
@Override public void run(){
  targetAbsolutePath=null;
  loopNode=null;
  xpathAndOrder.clear();
  RepositoryXmlSelectionDialog reviewDialog=new RepositoryXmlSelectionDialog(shell,new String[]{"String_Node_Str","String_Node_Str"});
  if (reviewDialog.open() == Window.OK) {
    TreeNode treeNodeRoot=XmlMapUtil.getTreeNodeRoot(schemaNode);
    XmlMapUtil.detachNodeConnections(treeNodeRoot,mapperManager.getCopyOfMapData(),true);
    schemaNode.getChildren().clear();
    RepositoryNode repositoryNode=reviewDialog.getResult();
    Item item=repositoryNode.getObject().getProperty().getItem();
    try {
      if (item instanceof XmlFileConnectionItem) {
        XmlFileConnectionItem xmlitem=(XmlFileConnectionItem)item;
        XmlFileConnection connection=(XmlFileConnection)xmlitem.getConnection();
        prepareEmfTreeFromXml(connection);
      }
 else       if (item instanceof MDMConnectionItem) {
        String selectedSchema=(String)repositoryNode.getProperties(EProperties.LABEL);
        MDMConnection connection=(MDMConnection)((MDMConnectionItem)item).getConnection();
        prepareEmfTreeFromMdm(connection,selectedSchema);
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
 finally {
      if (schemaNode.getChildren().isEmpty()) {
        TreeNode rootNode=createModel();
        rootNode.setName("String_Node_Str");
        rootNode.setNodeType(NodeType.ELEMENT);
        rootNode.setType(XmlMapUtil.DEFAULT_DATA_TYPE);
        rootNode.setXpath(XmlMapUtil.getXPath(schemaNode.getXpath(),"String_Node_Str",NodeType.ELEMENT));
        schemaNode.getChildren().add(rootNode);
        showError();
      }
    }
    if (loopNode == null && !schemaNode.getChildren().isEmpty()) {
      schemaNode.getChildren().get(0).setLoop(true);
      schemaNode.getChildren().get(0).setMain(true);
    }
    AbstractInOutTree tree=null;
    if (schemaNode.eContainer() instanceof InputXmlTree) {
      XmlMapConnectionBuilder.rebuildLinks(schemaNode,mapperManager.getCopyOfMapData());
      mapperManager.refreshInputTreeSchemaEditor((InputXmlTree)schemaNode.eContainer());
      tree=(InputXmlTree)schemaNode.eContainer();
    }
 else     if (schemaNode.eContainer() instanceof OutputXmlTree) {
      mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree)schemaNode.eContainer());
      tree=(OutputXmlTree)schemaNode.eContainer();
    }
    if (tree != null) {
      mapperManager.getProblemsAnalyser().checkProblems(tree);
      mapperManager.getMapperUI().updateStatusBar();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  targetAbsolutePath=null;
  loopNode=null;
  xpathAndOrder.clear();
  RepositoryXmlSelectionDialog reviewDialog=new RepositoryXmlSelectionDialog(shell,new String[]{"String_Node_Str","String_Node_Str"});
  if (reviewDialog.open() == Window.OK) {
    TreeNode treeNodeRoot=XmlMapUtil.getTreeNodeRoot(schemaNode);
    XmlMapUtil.detachNodeConnections(treeNodeRoot,mapperManager.getCopyOfMapData(),true);
    RepositoryNode repositoryNode=reviewDialog.getResult();
    Item item=repositoryNode.getObject().getProperty().getItem();
    String detailedMessage="String_Node_Str";
    try {
      if (item instanceof XmlFileConnectionItem) {
        XmlFileConnectionItem xmlitem=(XmlFileConnectionItem)item;
        XmlFileConnection connection=(XmlFileConnection)xmlitem.getConnection();
        prepareEmfTreeFromXml(connection);
      }
 else       if (item instanceof MDMConnectionItem) {
        String selectedSchema=(String)repositoryNode.getProperties(EProperties.LABEL);
        MDMConnection connection=(MDMConnection)((MDMConnectionItem)item).getConnection();
        prepareEmfTreeFromMdm(connection,selectedSchema);
      }
    }
 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 (schemaNode.getChildren().isEmpty()) {
      childrenEmpty=true;
      TreeNode rootNode=createModel();
      rootNode.setName("String_Node_Str");
      rootNode.setNodeType(NodeType.ELEMENT);
      rootNode.setType(XmlMapUtil.DEFAULT_DATA_TYPE);
      rootNode.setXpath(XmlMapUtil.getXPath(schemaNode.getXpath(),"String_Node_Str",NodeType.ELEMENT));
      schemaNode.getChildren().add(rootNode);
      if (loopNode == null) {
        schemaNode.getChildren().get(0).setLoop(true);
        schemaNode.getChildren().get(0).setMain(true);
      }
    }
    if (childrenEmpty || (detailedMessage != null && !"String_Node_Str".equals(detailedMessage))) {
      showError(detailedMessage);
    }
    AbstractInOutTree tree=null;
    if (schemaNode.eContainer() instanceof InputXmlTree) {
      XmlMapConnectionBuilder.rebuildLinks(schemaNode,mapperManager.getCopyOfMapData());
      mapperManager.refreshInputTreeSchemaEditor((InputXmlTree)schemaNode.eContainer());
      tree=(InputXmlTree)schemaNode.eContainer();
    }
 else     if (schemaNode.eContainer() instanceof OutputXmlTree) {
      mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree)schemaNode.eContainer());
      tree=(OutputXmlTree)schemaNode.eContainer();
    }
    if (tree != null) {
      mapperManager.getProblemsAnalyser().checkProblems(tree);
      mapperManager.getMapperUI().updateStatusBar();
    }
  }
}