Program: 120986
Project: 120986
Buggy source:
private void updateEntriesByMetaColumns(String schemaId,IMetadataTable metadataTable,ExternalMapperTable table,MapperComponent component){
  String id=table.getId();
  if (schemaId.equals(id)) {
    List<ExternalMapperTableEntry> mapperTableEntries=table.getMetadataTableEntries();
    List<ExternalMapperTableEntry> newTableEntries=new ArrayList<ExternalMapperTableEntry>();
    for (    ExternalMapperTableEntry oldEntry : mapperTableEntries) {
      String expression=oldEntry.getExpression();
      String columnname=oldEntry.getName();
      if (expression != null) {
        oldMappingMap.put(columnname,expression);
      }
    }
    List<IMetadataColumn> columns=metadataTable.getListColumns();
    if (columns != null) {
      for (      IMetadataColumn metadataColumn : columns) {
        ExternalMapperTableEntry tableEntry=new ExternalMapperTableEntry();
        tableEntry.setName(metadataColumn.getLabel());
        tableEntry.setType(metadataColumn.getTalendType());
        tableEntry.setNullable(metadataColumn.isNullable());
        ExternalMapperTableEntry sameEntry=null;
        for (        ExternalMapperTableEntry oldEntry : mapperTableEntries) {
          if (oldEntry.getName().equals(metadataColumn.getLabel())) {
            sameEntry=oldEntry;
          }
        }
        if (sameEntry != null) {
          tableEntry.setExpression(sameEntry.getExpression());
          tableEntry.setOperator(sameEntry.getOperator());
          String oldExpression=oldMappingMap.get(tableEntry.getName());
          if (oldExpression != null) {
            tableEntry.setExpression(oldExpression);
          }
        }
        newTableEntries.add(tableEntry);
      }
    }
    mapperTableEntries.clear();
    table.setMetadataTableEntries(newTableEntries);
    final IMetadataTable mapperTabel=getMetadataTable(component,table.getName());
    if (mapperTabel != null) {
      if (mapperTabel.getListColumns() != null) {
        mapperTabel.getListColumns().clear();
        mapperTabel.getListColumns().addAll(metadataTable.getListColumns());
      }
 else {
        mapperTabel.setListColumns(metadataTable.getListColumns());
      }
    }
  }
}

Fixed version (ground truth):
private void updateEntriesByMetaColumns(String schemaId,IMetadataTable metadataTable,ExternalMapperTable table,MapperComponent component){
  String id=table.getId();
  if (schemaId.equals(id)) {
    List<ExternalMapperTableEntry> mapperTableEntries=table.getMetadataTableEntries();
    List<ExternalMapperTableEntry> newTableEntries=new ArrayList<ExternalMapperTableEntry>();
    for (    ExternalMapperTableEntry oldEntry : mapperTableEntries) {
      String expression=oldEntry.getExpression();
      String columnname=oldEntry.getName();
      if (expression != null) {
        oldMappingMap.put(columnname,expression);
      }
    }
    List<IMetadataColumn> columns=metadataTable.getListColumns();
    if (columns != null) {
      for (      IMetadataColumn metadataColumn : columns) {
        ExternalMapperTableEntry tableEntry=new ExternalMapperTableEntry();
        tableEntry.setName(metadataColumn.getLabel());
        tableEntry.setType(metadataColumn.getTalendType());
        tableEntry.setNullable(metadataColumn.isNullable());
        ExternalMapperTableEntry sameEntry=null;
        for (        ExternalMapperTableEntry oldEntry : mapperTableEntries) {
          if (oldEntry.getName().equals(metadataColumn.getLabel())) {
            sameEntry=oldEntry;
          }
        }
        if (sameEntry != null) {
          tableEntry.setExpression(sameEntry.getExpression());
          tableEntry.setOperator(sameEntry.getOperator());
          String oldExpression=oldMappingMap.get(tableEntry.getName());
          if (oldExpression != null) {
            tableEntry.setExpression(oldExpression);
          }
        }
        newTableEntries.add(tableEntry);
      }
    }
    mapperTableEntries.clear();
    table.setMetadataTableEntries(newTableEntries);
    final IMetadataTable mapperTabel=getMetadataTable(component,table.getName());
    if (mapperTabel != null) {
      if (mapperTabel.getListColumns() != null) {
        mapperTabel.getListColumns().clear();
        mapperTabel.getListColumns().addAll(metadataTable.getListColumns());
      }
 else {
        mapperTabel.setListColumns(metadataTable.getListColumns());
      }
    }
  }
  oldMappingMap.clear();
}