Program: 127520
Project: 127520
Buggy source:
protected void createTable(){
  if (concept == null) {
    return;
  }
  if (metadataTable == null) {
    metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    metadataTable.setId(factory.getNextId());
  }
  metadataTable.setLabel(concept.getLabel());
  MappingTypeRetriever retriever=MetadataTalendType.getMappingTypeRetriever("String_Node_Str");
  List<ConceptTarget> targetList=concept.getConceptTargets();
  List<MetadataColumn> metadataColumns=new ArrayList<MetadataColumn>();
  for (  ConceptTarget target : targetList) {
    String relativeXpath=target.getRelativeLoopExpression();
    String fullPath=target.getSchema().getLoopExpression();
    if (fullPath.contains("String_Node_Str") && metadataTable.getSourceName() == null) {
      String source=fullPath.split("String_Node_Str")[1];
      metadataTable.setSourceName(source);
    }
    if (isContextMode()) {
      ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(connectionItem.getConnection(),true);
      fullPath=TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,fullPath));
    }
    if (relativeXpath != null) {
      if (!"String_Node_Str".equals(relativeXpath)) {
        String[] relatedSplitedPaths=relativeXpath.split("String_Node_Str");
        if (relatedSplitedPaths.length > 1) {
          int pathsToRemove=relatedSplitedPaths.length - 1;
          String[] fullPathSplited=fullPath.split("String_Node_Str");
          fullPath="String_Node_Str";
          for (int i=1; i < (fullPathSplited.length - pathsToRemove); i++) {
            fullPath+="String_Node_Str" + fullPathSplited[i];
          }
          fullPath+="String_Node_Str" + relatedSplitedPaths[pathsToRemove];
        }
 else {
          fullPath+="String_Node_Str" + relativeXpath;
        }
      }
    }
    TreeItem treeItem=treePopulator.getTreeItem(fullPath);
    if (treeItem != null) {
      ATreeNode curNode=(ATreeNode)treeItem.getData();
      MetadataColumn metadataColumn=ConnectionFactory.eINSTANCE.createMetadataColumn();
      metadataColumn.setLabel(target.getTargetName());
      if (curNode == null || retriever == null) {
        metadataColumn.setTalendType(MetadataTalendType.getDefaultTalendType());
      }
 else {
        metadataColumn.setTalendType(retriever.getDefaultSelectedTalendType("String_Node_Str" + curNode.getOriginalDataType()));
      }
      int index=removeOriginalColumn(target.getTargetName());
      if (index < 0)       metadataTable.getColumns().add(metadataColumn);
 else       metadataTable.getColumns().add(index,metadataColumn);
      metadataColumns.add(metadataColumn);
    }
  }
  if (!ConnectionHelper.getTables(getConnection()).contains(metadataTable)) {
    TdXmlSchema d=(TdXmlSchema)ConnectionHelper.getPackage(((MDMConnection)connectionItem.getConnection()).getDatacluster(),connectionItem.getConnection(),TdXmlSchema.class);
    if (d != null) {
      d.getOwnedElement().add(metadataTable);
    }
 else {
      TdXmlSchema newXmlDoc=XmlFactory.eINSTANCE.createTdXmlSchema();
      newXmlDoc.setName(((MDMConnection)connectionItem.getConnection()).getDatacluster());
      ConnectionHelper.addPackage(newXmlDoc,connectionItem.getConnection());
      PackageHelper.addMetadataTable(metadataTable,newXmlDoc);
    }
  }
}

Fixed version (ground truth):
@Override protected void createTable(){
  if (concept == null) {
    return;
  }
  if (metadataTable == null) {
    metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    metadataTable.setId(factory.getNextId());
  }
  metadataTable.setLabel(concept.getLabel());
  MappingTypeRetriever retriever=MetadataTalendType.getMappingTypeRetriever("String_Node_Str");
  List<ConceptTarget> targetList=concept.getConceptTargets();
  List<MetadataColumn> metadataColumns=new ArrayList<MetadataColumn>();
  for (  ConceptTarget target : targetList) {
    String relativeXpath=target.getRelativeLoopExpression();
    String fullPath=target.getSchema().getLoopExpression();
    if (fullPath.contains("String_Node_Str") && metadataTable.getSourceName() == null) {
      String source=fullPath.split("String_Node_Str")[1];
      metadataTable.setSourceName(source);
    }
    if (isContextMode()) {
      ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(connectionItem.getConnection(),true);
      fullPath=TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,fullPath));
    }
    if (relativeXpath != null) {
      if (!"String_Node_Str".equals(relativeXpath)) {
        String[] relatedSplitedPaths=relativeXpath.split("String_Node_Str");
        if (relatedSplitedPaths.length > 1) {
          int pathsToRemove=relatedSplitedPaths.length - 1;
          String[] fullPathSplited=fullPath.split("String_Node_Str");
          fullPath="String_Node_Str";
          for (int i=1; i < (fullPathSplited.length - pathsToRemove); i++) {
            fullPath+="String_Node_Str" + fullPathSplited[i];
          }
          fullPath+="String_Node_Str" + relatedSplitedPaths[pathsToRemove];
        }
 else {
          fullPath+="String_Node_Str" + relativeXpath;
        }
      }
    }
    TreeItem treeItem=treePopulator.getTreeItem(fullPath);
    if (treeItem != null) {
      ATreeNode curNode=(ATreeNode)treeItem.getData();
      MetadataColumn metadataColumn=ConnectionFactory.eINSTANCE.createMetadataColumn();
      metadataColumn.setLabel(target.getTargetName());
      if (curNode == null || retriever == null) {
        metadataColumn.setTalendType(MetadataTalendType.getDefaultTalendType());
      }
 else {
        String currentNodeType=curNode.getOriginalDataType();
        if (currentNodeType != null && !currentNodeType.startsWith("String_Node_Str")) {
          currentNodeType="String_Node_Str" + currentNodeType;
        }
        metadataColumn.setTalendType(retriever.getDefaultSelectedTalendType(currentNodeType));
      }
      int index=removeOriginalColumn(target.getTargetName());
      if (index < 0) {
        metadataTable.getColumns().add(metadataColumn);
      }
 else {
        metadataTable.getColumns().add(index,metadataColumn);
      }
      metadataColumns.add(metadataColumn);
    }
  }
  if (!ConnectionHelper.getTables(getConnection()).contains(metadataTable)) {
    TdXmlSchema d=(TdXmlSchema)ConnectionHelper.getPackage(((MDMConnection)connectionItem.getConnection()).getDatacluster(),connectionItem.getConnection(),TdXmlSchema.class);
    if (d != null) {
      d.getOwnedElement().add(metadataTable);
    }
 else {
      TdXmlSchema newXmlDoc=XmlFactory.eINSTANCE.createTdXmlSchema();
      newXmlDoc.setName(((MDMConnection)connectionItem.getConnection()).getDatacluster());
      ConnectionHelper.addPackage(newXmlDoc,connectionItem.getConnection());
      PackageHelper.addMetadataTable(metadataTable,newXmlDoc);
    }
  }
}