<commit_before>package com.procleus.brime;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;


public class Notes extends SQLiteOpenHelper {

    private static final int DATABASE_VERSION = 1;
    private static final String DATABASE_NAME = "notes";

    public Notes(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String createTextNotesTable = "CREATE TABLE textNotes (id INTEGER PRIMARY KEY AUTOINCREMENT, note text, title text, created TIMESTAMP default CURRENT_TIMESTAMP, edited TIMESTAMP default CURRENT_TIMESTAMP, owner integer,accessType text,isDeleted integer,label text)";
        Log.d("Sql Query Create :",createTextNotesTable);
        db.execSQL(createTextNotesTable);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        String createTextNotesTable = "CREATE TABLE if not exists textNotes (id INTEGER PRIMARY KEY AUTOINCREMENT, note text, title text, created TIMESTAMP default CURRENT_TIMESTAMP, edited TIMESTAMP default CURRENT_TIMESTAMP, owner integer,accessType text,isDeleted integer,label text)";
        db.execSQL(createTextNotesTable);
    }

    public void insertTextNote(String n, String t,String a, int o,String l) {
        SQLiteDatabase db = this.getWritableDatabase();
        String query="INSERT INTO textNotes(note,title,owner,accessType,isDeleted,label) VALUES('" + n + "','" + t + "'," + o +  ",'" + a + "',0,'"+ l + "')";
        db.execSQL(query);
        Log.d("Sql Query insert  ",query);
        db.close();
    }

    /*public void updateTextNote(int id, String n, String t) {
        SQLiteDatabase db = this.getWritableDatabase();
        db.execSQL("UPDATE textNotes set note = '" + n + "', title = '" + t + "', edited = now() WHERE id='" + id + "'");
        db.close();
    }*/
    public void accessChange(int id,String access) {

        SQLiteDatabase db = this.getWritableDatabase();<commit_msg>Update Notes.java<commit_after>package com.procleus.brime;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;


public class Notes extends SQLiteOpenHelper {

    private static final int DATABASE_VERSION = 1;
    private static final String DATABASE_NAME = "notes";

    public Notes(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String createTextNotesTable = "CREATE TABLE textNotes (id INTEGER PRIMARY KEY AUTOINCREMENT, note text, title text, created TIMESTAMP default CURRENT_TIMESTAMP, edited TIMESTAMP default CURRENT_TIMESTAMP, owner integer,accessType text,isDeleted integer,label text)";
        Log.d("Sql Query Create :",createTextNotesTable);
        db.execSQL(createTextNotesTable);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        String createTextNotesTable = "CREATE TABLE if not exists textNotes (id INTEGER PRIMARY KEY AUTOINCREMENT, note text, title text, created TIMESTAMP default CURRENT_TIMESTAMP, edited TIMESTAMP default CURRENT_TIMESTAMP, owner integer,accessType text,isDeleted integer,label text)";
        db.execSQL(createTextNotesTable);
    }

    public void insertTextNote(String n, String t,String a, int o,String l) {
        n = n.replaceAll("'", "''");
        t = t.replaceAll("'", "''");
        a = a.replaceAll("'", "''");
        SQLiteDatabase db = this.getWritableDatabase();
        String query="INSERT INTO textNotes(note,title,owner,accessType,isDeleted,label) VALUES('" + n + "','" + t + "'," + o +  ",'" + a + "',0,'"+ l + "')";
        db.execSQL(query);
        Log.d("Sql Query insert  ",query);
        db.close();
    }

    /*public void updateTextNote(int id, String n, String t) {
        SQLiteDatabase db = this.getWritableDatabase();
        db.execSQL("UPDATE textNotes set note = '" + n + "', title = '" + t + "', edited = now() WHERE id='" + id + "'");
        db.close();
    }*/
    public void accessChange(int id,String access) {

        SQLiteDatabase db = this.getWritableDatabase();
{'fraction_non_alphanumeric': 0.11347207009857613, 'fraction_numerical': 0.0008762322015334064, 'mean_word_length': 3.8266384778012683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2643137', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1321, 'n_words': 368}