Program: 86356
Project: 86356
Buggy source:
private void buildSequences(DatabaseMetaData metaData,TableContainer owner){
  ResultSet rs=null;
  PreparedStatement pstmt=null;
  try {
    PreparedStatement psmt=metaData.getConnection().prepareStatement("String_Node_Str" + "String_Node_Str" + owner.getName() + "String_Node_Str");
    rs=psmt.executeQuery();
    while (rs.next()) {
      String name=rs.getString(1);
      int increment=rs.getInt(2);
      int minValue=rs.getInt(3);
      BigInteger maxValueAsBigInt=new BigInteger(rs.getString(4));
      BigInteger maxIntValue=new BigInteger(Integer.toString(Integer.MAX_VALUE));
      Integer maxValue=null;
      if (maxValueAsBigInt.compareTo(maxIntValue) < 0) {
        maxValue=maxValueAsBigInt.intValue();
      }
 else {
        maxValue=-1;
      }
      int start=rs.getInt(5);
      Sequence sequence=CreationUtils.createSequence(owner,name,increment,minValue,maxValue,start);
      if (name.endsWith("String_Node_Str")) {
        String tableName=name.substring(0,name.length() - "String_Node_Str".length());
        AbstractTable abstractTable=queries.getTable(tableName);
        if (abstractTable != null && abstractTable instanceof Table) {
          Table table=(Table)abstractTable;
          if (table.getPrimaryKey() != null && table.getPrimaryKey().getColumns().size() == 1) {
            Column column=table.getPrimaryKey().getColumns().get(0);
            column.setSequence(sequence);
          }
        }
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
 finally {
    JdbcUtils.closeStatement(pstmt);
    JdbcUtils.closeResultSet(rs);
  }
}

Fixed version (ground truth):
private void buildSequences(TableContainer owner){
  ResultSet rs=null;
  PreparedStatement pstmt=null;
  try {
    PreparedStatement psmt=metaData.getConnection().prepareStatement("String_Node_Str" + "String_Node_Str" + schemaName + "String_Node_Str");
    rs=psmt.executeQuery();
    while (rs.next()) {
      String name=rs.getString(1);
      int increment=rs.getInt(2);
      int minValue=rs.getInt(3);
      BigInteger maxValueAsBigInt=new BigInteger(rs.getString(4));
      BigInteger maxIntValue=new BigInteger(Integer.toString(Integer.MAX_VALUE));
      Integer maxValue=null;
      if (maxValueAsBigInt.compareTo(maxIntValue) < 0) {
        maxValue=maxValueAsBigInt.intValue();
      }
 else {
        maxValue=-1;
      }
      int start=rs.getInt(5);
      Sequence sequence=CreationUtils.createSequence(owner,name,increment,minValue,maxValue,start);
      if (name.endsWith("String_Node_Str")) {
        String tableName=name.substring(0,name.length() - "String_Node_Str".length());
        AbstractTable abstractTable=queries.getTable(tableName);
        if (abstractTable != null && abstractTable instanceof Table) {
          Table table=(Table)abstractTable;
          if (table.getPrimaryKey() != null && table.getPrimaryKey().getColumns().size() == 1) {
            Column column=table.getPrimaryKey().getColumns().get(0);
            column.setSequence(sequence);
          }
        }
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
 finally {
    JdbcUtils.closeStatement(pstmt);
    JdbcUtils.closeResultSet(rs);
  }
}