Program: 123272
Project: 123272
Buggy source:
public void setMetadataType(final MetadataType metadataType){
  this.metadataType=metadataType;
  metadataTable=new MetadataTable();
  IMetadataColumn metaCol;
  ColumnType colType;
  EList listColType;
  List<IMetadataColumn> listMetadataColumn;
  metadataTable.setComment(metadataType.getComment());
  metadataTable.setTableName(metadataType.getName());
  metadataTable.setLabel(metadataType.getLabel());
  if (metadataType.getConnector() != null) {
    metadataTable.setAttachedConnector(metadataType.getConnector());
  }
 else {
    metadataTable.setAttachedConnector(EConnectionType.FLOW_MAIN.getName());
  }
  listColType=metadataType.getColumn();
  listMetadataColumn=new ArrayList<IMetadataColumn>();
  for (int i=0; i < listColType.size(); i++) {
    colType=(ColumnType)listColType.get(i);
    metaCol=new MetadataColumn();
    metaCol.setComment(colType.getComment());
    metaCol.setKey(colType.isKey());
    metaCol.setNullable(colType.isNullable());
    if (colType.isSetLength()) {
      if (colType.getLength() >= 0) {
        metaCol.setLength(new Integer(colType.getLength()));
      }
 else {
        metaCol.setLength(null);
      }
    }
 else {
      metaCol.setLength(null);
    }
    if (colType.getOriginalLength() >= 0) {
      metaCol.setOriginalLength(new Integer(colType.getOriginalLength()));
    }
 else {
      metaCol.setOriginalLength(null);
    }
    metaCol.setLabel(colType.getName());
    if (colType.isSetPrecision()) {
      if (colType.getPrecision() >= 0) {
        metaCol.setPrecision(new Integer(colType.getPrecision()));
      }
 else {
        metaCol.setPrecision(null);
      }
    }
 else {
      metaCol.setPrecision(null);
    }
    metaCol.setTalendType(colType.getType());
    metaCol.setType(colType.getSourceType());
    metaCol.setPattern(colType.getPattern());
    metaCol.setDefault(colType.getDefaultValue());
    metaCol.setRelatedEntity(colType.getRelatedEntity());
    metaCol.setRelationshipType(colType.getRelationshipType());
    if (colType.getOriginalDbColumnName() == null) {
      metaCol.setOriginalDbColumnName(colType.getName());
    }
 else {
      metaCol.setOriginalDbColumnName(colType.getOriginalDbColumnName());
    }
    listMetadataColumn.add(metaCol);
  }
  metadataTable.setListColumns(listMetadataColumn);
}

Fixed version (ground truth):
public void setMetadataType(final MetadataType metadataType){
  this.metadataType=metadataType;
  metadataTable=new MetadataTable();
  IMetadataColumn metaCol;
  ColumnType colType;
  EList listColType;
  List<IMetadataColumn> listMetadataColumn;
  metadataTable.setComment(metadataType.getComment());
  metadataTable.setTableName(metadataType.getName());
  metadataTable.setLabel(metadataType.getLabel());
  if (metadataType.getConnector() != null) {
    metadataTable.setAttachedConnector(metadataType.getConnector());
  }
 else {
    metadataTable.setAttachedConnector(EConnectionType.FLOW_MAIN.getName());
  }
  listColType=metadataType.getColumn();
  listMetadataColumn=new ArrayList<IMetadataColumn>();
  for (int i=0; i < listColType.size(); i++) {
    colType=(ColumnType)listColType.get(i);
    metaCol=new MetadataColumn();
    metaCol.setComment(colType.getComment());
    metaCol.setKey(colType.isKey());
    metaCol.setNullable(colType.isNullable());
    if (colType.isSetLength()) {
      if (colType.getLength() >= 0) {
        metaCol.setLength(new Integer(colType.getLength()));
      }
 else {
        metaCol.setLength(null);
      }
    }
 else {
      metaCol.setLength(null);
    }
    if (colType.getOriginalLength() >= 0) {
      metaCol.setOriginalLength(new Integer(colType.getOriginalLength()));
    }
 else {
      metaCol.setOriginalLength(null);
    }
    if (colType.getAdditionalField().size() > 0) {
      Iterator it=colType.getAdditionalField().keySet().iterator();
      while (it.hasNext()) {
        String key=(String)it.next();
        metaCol.getAdditionalField().put(key,(String)colType.getAdditionalField().get(key));
      }
    }
    metaCol.setLabel(colType.getName());
    if (colType.isSetPrecision()) {
      if (colType.getPrecision() >= 0) {
        metaCol.setPrecision(new Integer(colType.getPrecision()));
      }
 else {
        metaCol.setPrecision(null);
      }
    }
 else {
      metaCol.setPrecision(null);
    }
    metaCol.setTalendType(colType.getType());
    metaCol.setType(colType.getSourceType());
    metaCol.setPattern(colType.getPattern());
    metaCol.setDefault(colType.getDefaultValue());
    metaCol.setRelatedEntity(colType.getRelatedEntity());
    metaCol.setRelationshipType(colType.getRelationshipType());
    if (colType.getOriginalDbColumnName() == null) {
      metaCol.setOriginalDbColumnName(colType.getName());
    }
 else {
      metaCol.setOriginalDbColumnName(colType.getOriginalDbColumnName());
    }
    listMetadataColumn.add(metaCol);
  }
  metadataTable.setListColumns(listMetadataColumn);
}