<commit_before>package org.sqldroid;

import android.database.Cursor;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.Date;
import java.sql.NClob;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

public class SQLDroidPreparedStatement implements PreparedStatement {

  protected SQLiteDatabase db;
  protected SQLDroidConnection sqldroidConnection;
  protected SQLDroidResultSet rs = null;
  protected String sql;
  protected ArrayList<Object> l = new ArrayList<Object>();
  protected ArrayList<ArrayList<Object>> lBatch = new ArrayList<ArrayList<Object>>();
  private Integer maxRows = null;

  /** True if the sql statement is a select. */
  protected boolean isSelect;

  /** True if the sql statement MAY produce a result set.  For example, "create" and "drop" command will
   * produce a "false" value for this. */
  protected boolean potentialResultSet;

  /** The update count.  We don't know this, but need to respond in such a way that:
   * (from getMoreResults) There are no more results when the following is true:
   *
   *      // stmt is a Statement object
   *      ((stmt.getMoreResults() == false) &amp;&amp; (stmt.getUpdateCount() == -1))

   * This is used by <code>getUpdateCount()</code>.  If there is a resultSet
   * then getUpdateCount will return -1.  If there is no result set, then, presumably,
   * <code>execute()</code> was called and we have one result and so can return something
   * other than -1 on the first call to getUpdateCount.   In this case, the second call to getUpdateCount
   * we should return -1;
   * We set this to zero on execute() and decrement it on getUpdateCount.  If the value of updateCount
   * is -1 then we just return it from getUpdateCount.
   */
  public int updateCount = -1;

  public SQLDroidPreparedStatement(String sql, SQLDroidConnection sqldroid) {
    Log.v("new SqlDRoid prepared statement from " + sqldroid);
    this.sqldroidConnection = sqldroid;
    this.db = sqldroid.getDb();
    setSQL(sql);
  }


  private void ensureCap(int n) {
  }


  private void setObj(int n, Object obj) {

    // prapred statments count from 1, we count from 0 (in array)
    n--;

    // if arraylist is too small we add till it's grand enough
    // btw, why ain't there a l.setSize(n)?


    int additions = n - l.size() + 1;
    //System.out.println("adding " + additions + " elements");
    for(int i = 0 ; i < additions ; i++) {
     // System.out.println("ADD NULL");<commit_msg>Typo fix<commit_after>package org.sqldroid;

import android.database.Cursor;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.Date;
import java.sql.NClob;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

public class SQLDroidPreparedStatement implements PreparedStatement {

  protected SQLiteDatabase db;
  protected SQLDroidConnection sqldroidConnection;
  protected SQLDroidResultSet rs = null;
  protected String sql;
  protected ArrayList<Object> l = new ArrayList<Object>();
  protected ArrayList<ArrayList<Object>> lBatch = new ArrayList<ArrayList<Object>>();
  private Integer maxRows = null;

  /** True if the sql statement is a select. */
  protected boolean isSelect;

  /** True if the sql statement MAY produce a result set.  For example, "create" and "drop" command will
   * produce a "false" value for this. */
  protected boolean potentialResultSet;

  /** The update count.  We don't know this, but need to respond in such a way that:
   * (from getMoreResults) There are no more results when the following is true:
   *
   *      // stmt is a Statement object
   *      ((stmt.getMoreResults() == false) &amp;&amp; (stmt.getUpdateCount() == -1))

   * This is used by <code>getUpdateCount()</code>.  If there is a resultSet
   * then getUpdateCount will return -1.  If there is no result set, then, presumably,
   * <code>execute()</code> was called and we have one result and so can return something
   * other than -1 on the first call to getUpdateCount.   In this case, the second call to getUpdateCount
   * we should return -1;
   * We set this to zero on execute() and decrement it on getUpdateCount.  If the value of updateCount
   * is -1 then we just return it from getUpdateCount.
   */
  public int updateCount = -1;

  public SQLDroidPreparedStatement(String sql, SQLDroidConnection sqldroid) {
    Log.v("new SqlDroid prepared statement from " + sqldroid);
    this.sqldroidConnection = sqldroid;
    this.db = sqldroid.getDb();
    setSQL(sql);
  }


  private void ensureCap(int n) {
  }


  private void setObj(int n, Object obj) {

    // prapred statments count from 1, we count from 0 (in array)
    n--;

    // if arraylist is too small we add till it's grand enough
    // btw, why ain't there a l.setSize(n)?


    int additions = n - l.size() + 1;
    //System.out.println("adding " + additions + " elements");
    for(int i = 0 ; i < additions ; i++) {
     // System.out.println("ADD NULL");
{'fraction_non_alphanumeric': 0.10144686512556128, 'fraction_numerical': 0.0033261267254282387, 'mean_word_length': 3.7279874213836477, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3105909', 'n_tokens_mistral': 1816, 'n_tokens_neox': 1776, 'n_words': 642}