Program: 122542
Project: 122542
Buggy source:
@Override public List createPastableBeansList(ExtendedTableModel extendedTable,List copiedObjectsList){
  ArrayList list=new ArrayList();
  ArrayList countList=new ArrayList();
  ArrayList removeList=new ArrayList();
  for (  Object current : copiedObjectsList) {
    if (current instanceof IMetadataColumn) {
      IMetadataColumn copy=((IMetadataColumn)current).clone();
      copy.setLabel(((MetadataTableEditor)extendedTable).getNextGeneratedColumnName(copy.getLabel()));
      if (copy instanceof MetadataColumnExt) {
        list.add(copy);
        removeList.add(copy);
        extendedTable.getBeansList().add(copy);
      }
 else {
        MetadataColumnExt metadataColumnExt=new MetadataColumnExt((MetadataColumn)copy);
        metadataColumnExt.setFunction((new FunctionManagerExt()).getDefaultFunction(metadataColumnExt,metadataColumnExt.getTalendType()));
        list.add(metadataColumnExt);
      }
    }
 else     if (current instanceof org.talend.core.model.metadata.builder.connection.MetadataColumn) {
      MetadataTableEditor tableEditor=(MetadataTableEditor)extendedTable;
      org.talend.core.model.metadata.builder.connection.MetadataColumn metadataColumn=(org.talend.core.model.metadata.builder.connection.MetadataColumn)current;
      String nextGeneratedColumnName=metadataColumn.getLabel();
      String tempNewColumnName="String_Node_Str";
      boolean iMetaColumnUnique=false;
      boolean metaColumnUnique=false;
      while (iMetaColumnUnique == false || metaColumnUnique == false) {
        nextGeneratedColumnName=tableEditor.getNextGeneratedColumnName(nextGeneratedColumnName,null);
        iMetaColumnUnique=true;
        metaColumnUnique=false;
        if (list.size() == 0)         metaColumnUnique=true;
 else {
          tempNewColumnName=this.getUniqueString(list,nextGeneratedColumnName);
          if (tempNewColumnName.equals(nextGeneratedColumnName))           metaColumnUnique=true;
 else {
            metaColumnUnique=false;
            nextGeneratedColumnName=tempNewColumnName;
          }
        }
      }
      org.talend.core.model.metadata.builder.connection.MetadataColumn newColumnCopy=new ConnectionFactoryImpl().copy(metadataColumn,nextGeneratedColumnName);
      IMetadataColumn copy=(ConvertionHelper.convertToIMetaDataColumn(newColumnCopy)).clone();
      copy.setLabel(nextGeneratedColumnName);
      MetadataColumnExt metadataColumnExt=new MetadataColumnExt((MetadataColumn)copy);
      metadataColumnExt.setFunction((new FunctionManagerExt()).getDefaultFunction(metadataColumnExt,metadataColumnExt.getTalendType()));
      list.add(metadataColumnExt);
      countList.add(nextGeneratedColumnName);
    }
  }
  for (int i=0; i < removeList.size(); i++) {
    extendedTable.getBeansList().remove(removeList.get(i));
  }
  return list;
}

Fixed version (ground truth):
@Override public List createPastableBeansList(ExtendedTableModel extendedTable,List copiedObjectsList){
  ArrayList list=new ArrayList();
  ArrayList countList=new ArrayList();
  ArrayList<String> labelsExisted=getLabelsExisted(extendedTable);
  for (  Object current : copiedObjectsList) {
    if (current instanceof IMetadataColumn) {
      IMetadataColumn copy=((IMetadataColumn)current).clone();
      String nextGeneratedColumnName=((MetadataTableEditor)extendedTable).getNextGeneratedColumnName(copy.getLabel());
      if (labelsExisted.contains(nextGeneratedColumnName)) {
        nextGeneratedColumnName=validateColumnName(nextGeneratedColumnName,labelsExisted);
      }
      labelsExisted.add(nextGeneratedColumnName);
      copy.setLabel(nextGeneratedColumnName);
      if (copy instanceof MetadataColumnExt) {
        list.add(copy);
      }
 else {
        MetadataColumnExt metadataColumnExt=new MetadataColumnExt((MetadataColumn)copy);
        metadataColumnExt.setFunction((new FunctionManagerExt()).getDefaultFunction(metadataColumnExt,metadataColumnExt.getTalendType()));
        list.add(metadataColumnExt);
      }
    }
 else     if (current instanceof org.talend.core.model.metadata.builder.connection.MetadataColumn) {
      MetadataTableEditor tableEditor=(MetadataTableEditor)extendedTable;
      org.talend.core.model.metadata.builder.connection.MetadataColumn metadataColumn=(org.talend.core.model.metadata.builder.connection.MetadataColumn)current;
      String nextGeneratedColumnName=metadataColumn.getLabel();
      String tempNewColumnName="String_Node_Str";
      boolean iMetaColumnUnique=false;
      boolean metaColumnUnique=false;
      while (iMetaColumnUnique == false || metaColumnUnique == false) {
        nextGeneratedColumnName=tableEditor.getNextGeneratedColumnName(nextGeneratedColumnName,null);
        iMetaColumnUnique=true;
        metaColumnUnique=false;
        if (list.size() == 0)         metaColumnUnique=true;
 else {
          tempNewColumnName=this.getUniqueString(list,nextGeneratedColumnName);
          if (tempNewColumnName.equals(nextGeneratedColumnName))           metaColumnUnique=true;
 else {
            metaColumnUnique=false;
            nextGeneratedColumnName=tempNewColumnName;
          }
        }
      }
      org.talend.core.model.metadata.builder.connection.MetadataColumn newColumnCopy=new ConnectionFactoryImpl().copy(metadataColumn,nextGeneratedColumnName);
      IMetadataColumn copy=(ConvertionHelper.convertToIMetaDataColumn(newColumnCopy)).clone();
      copy.setLabel(nextGeneratedColumnName);
      MetadataColumnExt metadataColumnExt=new MetadataColumnExt((MetadataColumn)copy);
      metadataColumnExt.setFunction((new FunctionManagerExt()).getDefaultFunction(metadataColumnExt,metadataColumnExt.getTalendType()));
      list.add(metadataColumnExt);
      countList.add(nextGeneratedColumnName);
    }
  }
  return list;
}