Program: 124002
Project: 124002
Buggy source:
private void prepareEmfTreeFromMdm(MDMConnection connection,String selectedConcept){
  if (connection == null || selectedConcept == null) {
    return;
  }
  EList<Concept> schemas=connection.getSchemas();
  Concept selected=null;
  for (int i=0; i < schemas.size(); i++) {
    Concept concept=schemas.get(i);
    if (selectedConcept.equals(concept.getLabel())) {
      selected=concept;
      break;
    }
  }
  if (selected != null) {
    if (!MdmConceptType.OUTPUT.equals(selected.getConceptType())) {
      IMDMProviderService service=(IMDMProviderService)GlobalServiceRegister.getDefault().getService(IMDMProviderService.class);
      if (service != null) {
        boolean initConcepts=service.initConcepts(connection);
        if (initConcepts) {
          String prefix=service.getXPathPrefixValue(selected);
          String loopExpression=selected.getLoopExpression();
          EList<ConceptTarget> conceptTargets=selected.getConceptTargets();
          if (conceptTargets == null || loopExpression == null) {
            return;
          }
          this.schemaTargets=conceptTargets;
          List<FOXTreeNode> list=TreeUtil.getFoxTreeNodesForXmlMap(getTempTemplateXSDFile().getAbsolutePath(),loopExpression);
          TreeNode pNode=parentNode;
          if (MdmConceptType.RECEIVE.equals(selected.getConceptType())) {
            if (prefix != null) {
              String[] preValues=prefix.split(XmlMapUtil.XPATH_SEPARATOR);
              for (              String value : preValues) {
                if (!"String_Node_Str".equals(value)) {
                  TreeNode createTreeNode=createModel();
                  createTreeNode.setName(value);
                  createTreeNode.setNodeType(NodeType.ELEMENT);
                  createTreeNode.setType(XmlMapUtil.DEFAULT_DATA_TYPE);
                  createTreeNode.setXpath(XmlMapUtil.getXPath(pNode.getXpath(),createTreeNode.getName(),createTreeNode.getNodeType()));
                  pNode.getChildren().add(createTreeNode);
                  pNode=createTreeNode;
                }
              }
              loopExpression=prefix + loopExpression;
            }
          }
          prepareEmfTree(list,pNode,prefix,loopExpression);
        }
      }
    }
 else {
      prepareModelFromOutput(selected.getRoot(),selected.getLoop(),selected.getGroup());
    }
  }
}

Fixed version (ground truth):
private void prepareEmfTreeFromMdm(MDMConnection connection,String selectedConcept){
  if (connection == null || selectedConcept == null) {
    return;
  }
  EList<Concept> schemas=connection.getSchemas();
  Concept selected=null;
  for (int i=0; i < schemas.size(); i++) {
    Concept concept=schemas.get(i);
    if (selectedConcept.equals(concept.getLabel())) {
      selected=concept;
      break;
    }
  }
  if (selected != null) {
    if (!MdmConceptType.OUTPUT.equals(selected.getConceptType())) {
      IMDMProviderService service=(IMDMProviderService)GlobalServiceRegister.getDefault().getService(IMDMProviderService.class);
      if (service != null) {
        boolean initConcepts=service.initConcepts(connection);
        if (initConcepts) {
          String prefix=service.getXPathPrefixValue(selected);
          prefix=TalendTextUtils.removeQuotes(prefix);
          String loopExpression=selected.getLoopExpression();
          EList<ConceptTarget> conceptTargets=selected.getConceptTargets();
          if (conceptTargets == null || loopExpression == null) {
            return;
          }
          this.schemaTargets=conceptTargets;
          List<FOXTreeNode> list=TreeUtil.getFoxTreeNodesForXmlMap(getTempTemplateXSDFile().getAbsolutePath(),loopExpression);
          TreeNode pNode=parentNode;
          if (MdmConceptType.RECEIVE.equals(selected.getConceptType())) {
            if (prefix != null && !"String_Node_Str".equals(prefix)) {
              String[] preValues=prefix.split(XmlMapUtil.XPATH_SEPARATOR);
              for (              String value : preValues) {
                if (!"String_Node_Str".equals(value)) {
                  TreeNode createTreeNode=createModel();
                  createTreeNode.setName(value);
                  createTreeNode.setNodeType(NodeType.ELEMENT);
                  createTreeNode.setType(XmlMapUtil.DEFAULT_DATA_TYPE);
                  createTreeNode.setXpath(XmlMapUtil.getXPath(pNode.getXpath(),createTreeNode.getName(),createTreeNode.getNodeType()));
                  pNode.getChildren().add(createTreeNode);
                  pNode=createTreeNode;
                }
              }
              loopExpression=prefix + loopExpression;
            }
          }
          prepareEmfTree(list,pNode,prefix,loopExpression);
        }
      }
    }
 else {
      prepareModelFromOutput(selected.getRoot(),selected.getLoop(),selected.getGroup());
    }
  }
}