Program: 120671
Project: 120671
Buggy source:
private void initializeTableFromXml(PARAMETERType xmlParam,ElementParameter param){
  List<TABLEType> tableList=xmlParam.getTABLE();
  if ((tableList == null) || (tableList.size() == 0)) {
    return;
  }
  for (  TABLEType tableType : tableList) {
    IMetadataTable defaultTable=new MetadataTable();
    EList xmlColumnList=tableType.getCOLUMN();
    COLUMNType xmlColumn;
    List<IMetadataColumn> talendColumnList=new ArrayList<IMetadataColumn>();
    IMetadataColumn talendColumn;
    boolean isReadOnly;
    if (tableType.isSetREADONLY()) {
      defaultTable.setReadOnly(tableType.isREADONLY());
      isReadOnly=tableType.isREADONLY();
    }
 else {
      defaultTable.setReadOnly(param.isReadOnly());
      isReadOnly=param.isReadOnly();
    }
    String readOnlyColumnPosition=tableType.getREADONLYCOLUMNPOSITION();
    if (readOnlyColumnPosition == null) {
      readOnlyColumnPosition=EReadOnlyComlumnPosition.BOTTOM.toString();
    }
    defaultTable.setReadOnlyColumnPosition(readOnlyColumnPosition);
    int nbCustom=0;
    for (int i=0; i < xmlColumnList.size(); i++) {
      xmlColumn=(COLUMNType)xmlColumnList.get(i);
      talendColumn=new MetadataColumn();
      talendColumn.setLabel(xmlColumn.getNAME());
      talendColumn.setOriginalDbColumnName(xmlColumn.getNAME());
      talendColumn.setTalendType(xmlColumn.getTYPE());
      talendColumn.setPrecision(new Integer(xmlColumn.getPRECISION()));
      talendColumn.setLength(new Integer(xmlColumn.getLENGTH()));
      talendColumn.setNullable(xmlColumn.isNULLABLE());
      talendColumn.setKey(xmlColumn.isKEY());
      talendColumn.setPattern(xmlColumn.getPATTERN());
      talendColumn.setComment(xmlColumn.getCOMMENT());
      if (xmlColumn.isSetREADONLY()) {
        talendColumn.setReadOnly(xmlColumn.isREADONLY());
      }
 else       if (isReadOnly) {
        talendColumn.setReadOnly(isReadOnly);
      }
 else {
        talendColumn.setReadOnly(xmlParam.isREADONLY());
      }
      if (xmlColumn.isSetCUSTOM()) {
        talendColumn.setCustom(xmlColumn.isCUSTOM());
        talendColumn.setCustomId(nbCustom++);
      }
 else {
        talendColumn.setCustomId(-1);
      }
      talendColumnList.add(talendColumn);
    }
    defaultTable.setListColumns(talendColumnList);
    IElementParameterDefaultValue defaultValue=new ElementParameterDefaultValue();
    defaultValue.setDefaultValue(defaultTable);
    defaultValue.setIfCondition(tableType.getIF());
    defaultValue.setNotIfCondition(tableType.getNOTIF());
    param.getDefaultValues().add(defaultValue);
  }
}

Fixed version (ground truth):
private void initializeTableFromXml(PARAMETERType xmlParam,ElementParameter param){
  List<TABLEType> tableList=xmlParam.getTABLE();
  if ((tableList == null) || (tableList.size() == 0)) {
    return;
  }
  String mappingType=getMappingType();
  for (  TABLEType tableType : tableList) {
    IMetadataTable defaultTable=new MetadataTable();
    EList xmlColumnList=tableType.getCOLUMN();
    COLUMNType xmlColumn;
    List<IMetadataColumn> talendColumnList=new ArrayList<IMetadataColumn>();
    MetadataColumn talendColumn;
    boolean isReadOnly;
    if (tableType.isSetREADONLY()) {
      defaultTable.setReadOnly(tableType.isREADONLY());
      isReadOnly=tableType.isREADONLY();
    }
 else {
      defaultTable.setReadOnly(param.isReadOnly());
      isReadOnly=param.isReadOnly();
    }
    String readOnlyColumnPosition=tableType.getREADONLYCOLUMNPOSITION();
    if (readOnlyColumnPosition == null) {
      readOnlyColumnPosition=EReadOnlyComlumnPosition.BOTTOM.toString();
    }
    defaultTable.setReadOnlyColumnPosition(readOnlyColumnPosition);
    int nbCustom=0;
    for (int i=0; i < xmlColumnList.size(); i++) {
      xmlColumn=(COLUMNType)xmlColumnList.get(i);
      talendColumn=new MetadataColumn();
      talendColumn.setLabel(xmlColumn.getNAME());
      talendColumn.setOriginalDbColumnName(xmlColumn.getNAME());
      talendColumn.setTalendType(xmlColumn.getTYPE());
      talendColumn.setPrecision(new Integer(xmlColumn.getPRECISION()));
      talendColumn.setLength(new Integer(xmlColumn.getLENGTH()));
      talendColumn.setNullable(xmlColumn.isNULLABLE());
      talendColumn.setKey(xmlColumn.isKEY());
      talendColumn.setPattern(xmlColumn.getPATTERN());
      talendColumn.setComment(xmlColumn.getCOMMENT());
      if (mappingType != null) {
        String defaultSelectedDbType=MetadataTalendType.getMappingTypeRetriever(mappingType).getDefaultSelectedDbType(xmlColumn.getTYPE());
        talendColumn.setType(defaultSelectedDbType);
      }
      if (xmlColumn.isSetREADONLY()) {
        talendColumn.setReadOnly(xmlColumn.isREADONLY());
      }
 else       if (isReadOnly) {
        talendColumn.setReadOnly(isReadOnly);
      }
 else {
        talendColumn.setReadOnly(xmlParam.isREADONLY());
      }
      if (xmlColumn.isSetCUSTOM()) {
        talendColumn.setCustom(xmlColumn.isCUSTOM());
        talendColumn.setCustomId(nbCustom++);
      }
 else {
        talendColumn.setCustomId(-1);
      }
      talendColumnList.add(talendColumn);
    }
    defaultTable.setListColumns(talendColumnList);
    IElementParameterDefaultValue defaultValue=new ElementParameterDefaultValue();
    defaultValue.setDefaultValue(defaultTable);
    defaultValue.setIfCondition(tableType.getIF());
    defaultValue.setNotIfCondition(tableType.getNOTIF());
    param.getDefaultValues().add(defaultValue);
  }
}