Program: 126357
Project: 126357
Buggy source:
@Override public ResultSet getTables(String catalog,String schemaPattern,String tableNamePattern,String[] types) throws SQLException {
  String sql;
  String and;
  if (schemaPattern != null) {
    sql="String_Node_Str" + schemaPattern + "String_Node_Str";
    and="String_Node_Str";
  }
 else {
    sql="String_Node_Str";
    and="String_Node_Str";
  }
  sql=addTypesToSql(sql,types,and);
  if (!StringUtils.isEmpty(tableNamePattern)) {
    sql=sql + "String_Node_Str";
  }
  ResultSet rs=null;
  PreparedStatement stmt=null;
  List<String[]> list=new ArrayList<String[]>();
  Set<String> tablesRetrieved=new HashSet<String>();
  try {
    stmt=connection.prepareStatement(sql);
    if (!StringUtils.isEmpty(tableNamePattern)) {
      stmt.setString(1,tableNamePattern);
    }
    rs=stmt.executeQuery();
    while (rs.next()) {
      String type=rs.getString("String_Node_Str");
      String table_name=rs.getString("String_Node_Str");
      String system_table_name=rs.getString("String_Node_Str");
      tablesRetrieved.add(system_table_name);
      String table_schema=rs.getString("String_Node_Str");
      String system_table_schema=rs.getString("String_Node_Str");
      String[] r=new String[]{type,table_name,system_table_name,table_schema,system_table_schema};
      list.add(r);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
 finally {
    try {
      rs.close();
      stmt.close();
    }
 catch (    Exception e) {
    }
  }
  ResultSet jdbcRset=super.getTables(catalog,schemaPattern,tableNamePattern,types);
  while (jdbcRset.next()) {
    String table_name=jdbcRset.getString("String_Node_Str");
    if (tablesRetrieved.contains(table_name)) {
      continue;
    }
    String type=jdbcRset.getString("String_Node_Str");
    String table_schema=jdbcRset.getString("String_Node_Str");
    String[] r=new String[]{type,table_name,table_name,table_schema,table_schema};
    list.add(r);
  }
  AS400ResultSet tableResultSet=new AS400ResultSet();
  tableResultSet.setMetadata(TABLE_META);
  tableResultSet.setData(list);
  return tableResultSet;
}

Fixed version (ground truth):
@Override public ResultSet getTables(String catalog,String schemaPattern,String tableNamePattern,String[] types) throws SQLException {
  String sql;
  String and;
  if (schemaPattern != null) {
    sql="String_Node_Str" + schemaPattern + "String_Node_Str";
    and="String_Node_Str";
  }
 else {
    sql="String_Node_Str";
    and="String_Node_Str";
  }
  sql=addTypesToSql(sql,types,and);
  if (!StringUtils.isEmpty(tableNamePattern)) {
    sql=sql + "String_Node_Str";
  }
  ResultSet rs=null;
  PreparedStatement stmt=null;
  List<String[]> list=new ArrayList<String[]>();
  try {
    stmt=connection.prepareStatement(sql);
    if (!StringUtils.isEmpty(tableNamePattern)) {
      stmt.setString(1,tableNamePattern);
    }
    rs=stmt.executeQuery();
    while (rs.next()) {
      String type=rs.getString("String_Node_Str");
      String table_name=rs.getString("String_Node_Str");
      String system_table_name=rs.getString("String_Node_Str");
      String table_schema=rs.getString("String_Node_Str");
      String system_table_schema=rs.getString("String_Node_Str");
      String[] r=new String[]{type,table_name,system_table_name,table_schema,system_table_schema};
      list.add(r);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
 finally {
    try {
      rs.close();
      stmt.close();
    }
 catch (    Exception e) {
    }
  }
  AS400ResultSet tableResultSet=new AS400ResultSet();
  tableResultSet.setMetadata(TABLE_META);
  tableResultSet.setData(list);
  return tableResultSet;
}