Program: 126917
Project: 126917
Buggy source:
/** 
 * DOC qzhang Comment method "getMetadataTables".
 * @param medataTables
 * @param rsTables
 * @throws SQLException
 */
protected void getMetadataTables(List<IMetadataTable> medataTables,ResultSet rsTables,boolean supportSchema,List<String> tablesToFilter,int... limit) throws SQLException {
  if (rsTables == null) {
    return;
  }
  int limitNum=-1;
  long index=0;
  if (limit != null && limit.length > 0) {
    limitNum=limit[0];
  }
  while (rsTables.next()) {
    index++;
    if (limitNum > 0 && index > limitNum) {
      break;
    }
    boolean isSynonym=false;
    MetadataTable medataTable=new MetadataTable();
    medataTable.setId(index + "String_Node_Str");
    String tableName=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.TABLE_NAME,null);
    if (tableName == null) {
      tableName=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,3);
    }
    if (tableName == null) {
      tableName=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.SYNONYM_NAME,null);
      isSynonym=true;
    }
    if (tableName == null || tablesToFilter.contains(tableName) || tableName.startsWith("String_Node_Str")) {
      continue;
    }
    medataTable.setLabel(tableName);
    medataTable.setTableName(medataTable.getLabel());
    medataTable.setComment(ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.REMARKS,null));
    String schema=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.TABLE_SCHEMA,null);
    if (schema == null) {
      schema=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,2);
    }
    String tableType=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.TABLE_TYPE,null);
    if (tableType == null) {
      tableType=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,4);
    }
    if (ExtractManager.TABLETYPE_TABLE.equals(tableType)) {
      tableType=ETableTypes.TABLETYPE_TABLE.getName();
    }
    if (ExtractManager.TABLETYPE_VIEW.equals(tableType)) {
      tableType=ETableTypes.TABLETYPE_VIEW.getName();
    }
    if (isSynonym) {
      tableType="String_Node_Str";
    }
    try {
      tableTypeMap.put(medataTable.getLabel(),tableType);
    }
 catch (    Exception e) {
      tableTypeMap.put(medataTable.getLabel(),ETableTypes.TABLETYPE_TABLE.getName());
    }
    medataTables.add(medataTable);
  }
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "getMetadataTables".
 * @param medataTables
 * @param rsTables
 * @throws SQLException
 */
protected void getMetadataTables(List<IMetadataTable> medataTables,ResultSet rsTables,boolean supportSchema,List<String> tablesToFilter,int... limit) throws SQLException {
  if (rsTables == null) {
    return;
  }
  int limitNum=-1;
  long index=0;
  if (limit != null && limit.length > 0) {
    limitNum=limit[0];
  }
  while (rsTables.next()) {
    index++;
    if (limitNum > 0 && index > limitNum) {
      break;
    }
    boolean isSynonym=false;
    MetadataTable medataTable=new MetadataTable();
    medataTable.setId(index + "String_Node_Str");
    String tableName=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.TABLE_NAME,null);
    if (tableName == null) {
      tableName=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,3);
    }
    if (tableName == null) {
      tableName=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.SYNONYM_NAME,null);
      isSynonym=true;
    }
    if (tableName == null || tablesToFilter.contains(tableName)) {
      continue;
    }
    medataTable.setLabel(tableName);
    medataTable.setTableName(medataTable.getLabel());
    medataTable.setComment(ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.REMARKS,null));
    String schema=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.TABLE_SCHEMA,null);
    if (schema == null) {
      schema=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,2);
    }
    String tableType=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,ExtractManager.TABLE_TYPE,null);
    if (tableType == null) {
      tableType=ExtractMetaDataUtils.getStringMetaDataInfo(rsTables,4);
    }
    if (ExtractManager.TABLETYPE_TABLE.equals(tableType)) {
      tableType=ETableTypes.TABLETYPE_TABLE.getName();
    }
    if (ExtractManager.TABLETYPE_VIEW.equals(tableType)) {
      tableType=ETableTypes.TABLETYPE_VIEW.getName();
    }
    if (isSynonym) {
      tableType="String_Node_Str";
    }
    try {
      tableTypeMap.put(medataTable.getLabel(),tableType);
    }
 catch (    Exception e) {
      tableTypeMap.put(medataTable.getLabel(),ETableTypes.TABLETYPE_TABLE.getName());
    }
    medataTables.add(medataTable);
  }
}