Program: 129470
Project: 129470
Buggy source:
/** 
 * DOC qzhang Comment method "getTableNamesFromQuery".
 * @param rsTables
 * @return
 * @throws SQLException
 */
private static List<String> getTableNamesFromTables(ResultSet resultSet,IMetadataConnection iMetadataConnection) throws SQLException {
  List<String> itemTablesName=new ArrayList<String>();
  ExtractMetaDataFromDataBase.tableCommentsMap.clear();
  if (resultSet != null) {
    while (resultSet.next()) {
      String nameKey=resultSet.getString(GetTable.TABLE_NAME.name());
      boolean isDerby=false;
      if (iMetadataConnection != null) {
        String dbType=iMetadataConnection.getDbType();
        if (dbType.equals("String_Node_Str")) {
          String driverClassName=iMetadataConnection.getDriverClass();
          String driverJar=iMetadataConnection.getDriverJarPath();
          if (driverJar != null && !"String_Node_Str".equals(driverJar)) {
            if (driverJar.contains("String_Node_Str")) {
              driverJar=driverJar.substring(driverJar.lastIndexOf("String_Node_Str") + 1,driverJar.length());
            }
          }
          if (driverJar != null && !"String_Node_Str".equals(driverJar)) {
            dbType=ExtractMetaDataUtils.getDbTypeByClassNameAndDriverJar(driverClassName,driverJar);
          }
 else {
            dbType=ExtractMetaDataUtils.getDbTypeByClassName(driverClassName);
          }
        }
        isDerby="String_Node_Str".equals(dbType) || "String_Node_Str".equals(dbType);
      }
      String colComment="String_Node_Str";
      if (!isDerby) {
        if (EDatabaseTypeName.ORACLEFORSID.getProduct().equals(iMetadataConnection.getProduct()) && iMetadataConnection.getDbVersionString() != null && iMetadataConnection.getDbVersionString().equals("String_Node_Str") || EDatabaseTypeName.GENERAL_JDBC.getProduct().equals(iMetadataConnection.getProduct()) && iMetadataConnection.getDriverJarPath().contains("String_Node_Str")) {
          colComment=getTableComment(nameKey,resultSet,false);
        }
 else {
          colComment=getTableComment(nameKey,resultSet,true);
        }
      }
      itemTablesName.add(nameKey);
      if (ExtractMetaDataFromDataBase.tableCommentsMap.containsKey(nameKey)) {
        if (colComment == null) {
          colComment="String_Node_Str";
        }
        tableCommentsMap.remove(nameKey);
        tableCommentsMap.put(nameKey,colComment);
      }
      tableCommentsMap.put(nameKey,colComment);
      if (tableTypeMap.containsKey(nameKey)) {
        tableTypeMap.remove(nameKey);
        tableTypeMap.put(nameKey,resultSet.getString("String_Node_Str"));
      }
 else       tableTypeMap.put(nameKey,resultSet.getString("String_Node_Str"));
    }
    resultSet.close();
  }
  return itemTablesName;
}

Fixed version (ground truth):
/** 
 * DOC qzhang Comment method "getTableNamesFromQuery".
 * @param rsTables
 * @return
 * @throws SQLException
 */
private static List<String> getTableNamesFromTables(ResultSet resultSet,IMetadataConnection iMetadataConnection) throws SQLException {
  List<String> itemTablesName=new ArrayList<String>();
  ExtractMetaDataFromDataBase.tableCommentsMap.clear();
  if (resultSet != null) {
    while (resultSet.next()) {
      String nameKey=resultSet.getString(GetTable.TABLE_NAME.name());
      boolean isDerby=false;
      if (iMetadataConnection != null) {
        String dbType=iMetadataConnection.getDbType();
        if (dbType.equals("String_Node_Str")) {
          String driverClassName=iMetadataConnection.getDriverClass();
          String driverJar=iMetadataConnection.getDriverJarPath();
          if (driverJar != null && !"String_Node_Str".equals(driverJar)) {
            if (driverJar.contains("String_Node_Str")) {
              driverJar=driverJar.substring(driverJar.lastIndexOf("String_Node_Str") + 1,driverJar.length());
            }
          }
          if (driverJar != null && !"String_Node_Str".equals(driverJar)) {
            dbType=ExtractMetaDataUtils.getDbTypeByClassNameAndDriverJar(driverClassName,driverJar);
          }
 else {
            dbType=ExtractMetaDataUtils.getDbTypeByClassName(driverClassName);
          }
        }
        isDerby="String_Node_Str".equals(dbType) || "String_Node_Str".equals(dbType);
      }
      String colComment="String_Node_Str";
      if (!isDerby) {
        if (EDatabaseTypeName.ORACLEFORSID.getProduct().equals(iMetadataConnection.getProduct()) && iMetadataConnection.getDbVersionString() != null && iMetadataConnection.getDbVersionString().equals("String_Node_Str") || EDatabaseTypeName.GENERAL_JDBC.getProduct().equals(iMetadataConnection.getProduct()) && iMetadataConnection.getDriverJarPath().contains("String_Node_Str")) {
          colComment=getTableComment(nameKey,resultSet,false);
        }
 else {
          colComment=getTableComment(nameKey,resultSet,true);
        }
      }
      itemTablesName.add(nameKey);
      if (ExtractMetaDataFromDataBase.tableCommentsMap.containsKey(nameKey)) {
        if (colComment == null) {
          colComment="String_Node_Str";
        }
        tableCommentsMap.remove(nameKey);
        tableCommentsMap.put(nameKey,colComment);
      }
      tableCommentsMap.put(nameKey,colComment);
      if (tableTypeMap.containsKey(nameKey)) {
        tableTypeMap.remove(nameKey);
        tableTypeMap.put(nameKey,resultSet.getString("String_Node_Str"));
      }
 else {
        tableTypeMap.put(nameKey,resultSet.getString("String_Node_Str"));
      }
    }
    resultSet.close();
  }
  return itemTablesName;
}