Program: 123330
Project: 123330
Buggy source:
@Override public void run(){
  try {
    TreeNode docRoot=null;
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=new ArrayList((List)s);
      Iterator iter=selectedarts.iterator();
      while (iter.hasNext()) {
        Object obj=iter.next();
        if (obj instanceof TreeNodeEditPart) {
          TreeNodeEditPart nodePart=(TreeNodeEditPart)obj;
          TreeNode treeNode=(TreeNode)nodePart.getModel();
          if (treeNode.eContainer() instanceof TreeNode) {
            TreeNode parent=(TreeNode)treeNode.eContainer();
            if (docRoot == null) {
              docRoot=XmlMapUtil.getTreeNodeRoot(parent);
            }
            XmlMapUtil.detachNodeConnections(treeNode,mapperManager.getCopyOfMapData(),true);
            if (treeNode.isLoop()) {
              if (treeNode instanceof OutputTreeNode && XmlMapUtil.findUpGroupNode((OutputTreeNode)treeNode) != null) {
                XmlMapUtil.cleanSubGroup(docRoot);
              }
              XmlMapUtil.clearMainNode(docRoot);
            }
            parent.getChildren().remove(treeNode);
          }
        }
      }
    }
    if (mapperManager != null) {
      if (input) {
        if (docRoot != null && docRoot.eContainer() instanceof InputXmlTree) {
          mapperManager.refreshInputTreeSchemaEditor((InputXmlTree)docRoot.eContainer());
        }
      }
 else {
        if (docRoot != null && docRoot.eContainer() instanceof OutputXmlTree) {
          mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree)docRoot.eContainer());
        }
      }
      if (docRoot != null && docRoot.eContainer() instanceof AbstractInOutTree) {
        mapperManager.getProblemsAnalyser().checkLoopProblems((AbstractInOutTree)docRoot.eContainer());
        mapperManager.getMapperUI().updateStatusBar();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    TreeNode docRoot=null;
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=new ArrayList((List)s);
      Iterator iter=selectedarts.iterator();
      while (iter.hasNext()) {
        Object obj=iter.next();
        if (obj instanceof TreeNodeEditPart) {
          TreeNodeEditPart nodePart=(TreeNodeEditPart)obj;
          TreeNode treeNode=(TreeNode)nodePart.getModel();
          if (treeNode.eContainer() instanceof TreeNode) {
            TreeNode parent=(TreeNode)treeNode.eContainer();
            if (docRoot == null) {
              docRoot=XmlMapUtil.getTreeNodeRoot(parent);
            }
            XmlMapUtil.detachNodeConnections(treeNode,mapperManager.getCopyOfMapData(),true);
            if (treeNode.isLoop()) {
              if (treeNode instanceof OutputTreeNode && XmlMapUtil.findUpGroupNode((OutputTreeNode)treeNode) != null) {
                XmlMapUtil.cleanSubGroup(docRoot);
              }
              XmlMapUtil.clearMainNode(docRoot);
            }
            parent.getChildren().remove(treeNode);
          }
        }
      }
    }
    if (mapperManager != null) {
      if (input) {
        if (docRoot != null && docRoot.eContainer() instanceof InputXmlTree) {
          mapperManager.refreshInputTreeSchemaEditor((InputXmlTree)docRoot.eContainer());
        }
      }
 else {
        if (docRoot != null && docRoot.eContainer() instanceof OutputXmlTree) {
          mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree)docRoot.eContainer());
        }
      }
      if (docRoot != null && docRoot.eContainer() instanceof AbstractInOutTree) {
        mapperManager.getProblemsAnalyser().checkProblems((AbstractInOutTree)docRoot.eContainer());
        mapperManager.getMapperUI().updateStatusBar();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}