Program: 123777
Project: 123777
Buggy source:
private void createInputLoopTable(OutputTreeNode targetOutputNode,OutputTreeNodeEditPart treeNodeEditPart){
  OutputTreeNodeEditPart outputTreeNodeEditPart=null;
  if (treeNodeEditPart instanceof OutputTreeNodeEditPart) {
    outputTreeNodeEditPart=XmlMapUtil.getParentLoopNodeEditPart(treeNodeEditPart);
  }
  if (loopParentTreeNode != null) {
    InputLoopNodesTable inputLoopNodesTable=null;
    AbstractInOutTree abstractTree=XmlMapUtil.getAbstractInOutTree(targetOutputNode);
    if (abstractTree != null && abstractTree instanceof OutputXmlTree) {
      listInputLoopNodesTablesEntry=((OutputXmlTree)abstractTree).getInputLoopNodesTables();
      if (!XmlMapUtil.hasDocument(abstractTree)) {
        if (listInputLoopNodesTablesEntry != null && listInputLoopNodesTablesEntry.size() == 0) {
          inputLoopNodesTable=XmlmapFactory.eINSTANCE.createInputLoopNodesTable();
          inputLoopNodesTable.getInputloopnodes().add(loopParentTreeNode);
          listInputLoopNodesTablesEntry.add(inputLoopNodesTable);
        }
 else         if (listInputLoopNodesTablesEntry != null && listInputLoopNodesTablesEntry.size() == 1) {
          inputLoopNodesTable=listInputLoopNodesTablesEntry.get(0);
          boolean isContain=false;
          for (          TreeNode treeNode : inputLoopNodesTable.getInputloopnodes()) {
            if (treeNode.getXpath().equals(loopParentTreeNode.getXpath())) {
              isContain=true;
            }
          }
          if (!isContain) {
            inputLoopNodesTable.getInputloopnodes().add(loopParentTreeNode);
          }
        }
      }
 else {
        OutputTreeNode loopParentOutputTreeNode=(OutputTreeNode)XmlMapUtil.getLoopParentNode(targetOutputNode);
        if (loopParentOutputTreeNode != null) {
          if (loopParentOutputTreeNode.getInputLoopNodesTable() == null) {
            inputLoopNodesTable=XmlmapFactory.eINSTANCE.createInputLoopNodesTable();
            if (outputTreeNodeEditPart != null) {
              inputLoopNodesTable.eAdapters().add(outputTreeNodeEditPart);
            }
            inputLoopNodesTable.getInputloopnodes().add(loopParentTreeNode);
            loopParentOutputTreeNode.setInputLoopNodesTable(inputLoopNodesTable);
            listInputLoopNodesTablesEntry.add(inputLoopNodesTable);
          }
 else {
            loopParentOutputTreeNode.getInputLoopNodesTable().getInputloopnodes().add(loopParentTreeNode);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void createInputLoopTable(OutputTreeNode targetOutputNode,OutputTreeNodeEditPart treeNodeEditPart){
  OutputTreeNodeEditPart outputTreeNodeEditPart=null;
  if (treeNodeEditPart instanceof OutputTreeNodeEditPart) {
    outputTreeNodeEditPart=XmlMapUtil.getParentLoopNodeEditPart(treeNodeEditPart);
  }
  if (loopParentTreeNode != null) {
    InputLoopNodesTable inputLoopNodesTable=null;
    AbstractInOutTree abstractTree=XmlMapUtil.getAbstractInOutTree(targetOutputNode);
    if (abstractTree != null && abstractTree instanceof OutputXmlTree) {
      listInputLoopNodesTablesEntry=((OutputXmlTree)abstractTree).getInputLoopNodesTables();
      if (!XmlMapUtil.hasDocument(abstractTree)) {
        if (listInputLoopNodesTablesEntry != null && listInputLoopNodesTablesEntry.size() == 0) {
          inputLoopNodesTable=XmlmapFactory.eINSTANCE.createInputLoopNodesTable();
          inputLoopNodesTable.getInputloopnodes().add(loopParentTreeNode);
          listInputLoopNodesTablesEntry.add(inputLoopNodesTable);
        }
 else         if (listInputLoopNodesTablesEntry != null && listInputLoopNodesTablesEntry.size() == 1) {
          inputLoopNodesTable=listInputLoopNodesTablesEntry.get(0);
          boolean isContain=false;
          for (          TreeNode treeNode : inputLoopNodesTable.getInputloopnodes()) {
            if (treeNode.getXpath().equals(loopParentTreeNode.getXpath())) {
              isContain=true;
            }
          }
          if (!isContain) {
            inputLoopNodesTable.getInputloopnodes().add(loopParentTreeNode);
          }
        }
      }
 else {
        OutputTreeNode loopParentOutputTreeNode=(OutputTreeNode)XmlMapUtil.getLoopParentNode(targetOutputNode);
        if (loopParentOutputTreeNode != null) {
          if (loopParentOutputTreeNode.getInputLoopNodesTable() == null) {
            inputLoopNodesTable=XmlmapFactory.eINSTANCE.createInputLoopNodesTable();
            if (outputTreeNodeEditPart != null) {
              inputLoopNodesTable.eAdapters().add(outputTreeNodeEditPart);
            }
            inputLoopNodesTable.getInputloopnodes().add(loopParentTreeNode);
            loopParentOutputTreeNode.setInputLoopNodesTable(inputLoopNodesTable);
            listInputLoopNodesTablesEntry.add(inputLoopNodesTable);
          }
 else {
            if (outputTreeNodeEditPart != null) {
              loopParentOutputTreeNode.getInputLoopNodesTable().eAdapters().add(outputTreeNodeEditPart);
            }
            loopParentOutputTreeNode.getInputLoopNodesTable().getInputloopnodes().add(loopParentTreeNode);
          }
        }
      }
    }
  }
}