// Path: sherlock-no-op/src/main/java/com/singhajit/sherlock/core/investigation/Crash.java
// public class Crash {
//   public static final String DATE_FORMAT = "EEE MMM dd kk:mm:ss z yyyy";
// 
//   public Crash(String place, String reason, String stackTrace) {
//   }
// 
//   public Crash(int id, String placeOfCrash, String reasonOfCrash, String stacktrace, String date) {
//   }
// 
//   public DeviceInfo getDeviceInfo() {
//     return new DeviceInfo.Builder().build();
//   }
// 
//   public AppInfo getAppInfo() {
//     return new AppInfo();
//   }
// 
//   public void setId(int id) {
//   }
// 
//   public Class<Crash> getType() {
//     return Crash.class;
//   }
// 
//   public String getReason() {
//     return "";
//   }
// 
//   public String getStackTrace() {
//     return "";
//   }
// 
//   public String getPlace() {
//     return "";
//   }
// 
//   public int getId() {
//     return 0;
//   }
// 
//   public Date getDate() {
//     return new Date();
//   }
// }


import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.support.annotation.NonNull;
import com.singhajit.sherlock.core.investigation.Crash;
import java.util.ArrayList;
import java.util.List;
package com.singhajit.sherlock.core.database;




public class SherlockDatabaseHelper extends SQLiteOpenHelper {
  private static final int VERSION = 2;
  private static final String DB_NAME = "Sherlock";

  public SherlockDatabaseHelper(Context context) {
    super(context, DB_NAME, null, VERSION);
  }

  @Override
  public void onCreate(SQLiteDatabase database) {
    database.execSQL(CrashTable.CREATE_QUERY);
  }

  @Override
  public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
    sqLiteDatabase.execSQL(CrashTable.DROP_QUERY);
    sqLiteDatabase.execSQL(CrashTable.CREATE_QUERY);
  }

  public int insertCrash(CrashRecord crashRecord) {
    ContentValues values = new ContentValues();
    values.put(CrashTable.PLACE, crashRecord.getPlace());
    values.put(CrashTable.REASON, crashRecord.getReason());
    values.put(CrashTable.STACKTRACE, crashRecord.getStackTrace());
    values.put(CrashTable.DATE, crashRecord.getDate());

    SQLiteDatabase database = getWritableDatabase();
    long id = database.insert(CrashTable.TABLE_NAME, null, values);
    database.close();

    return Long.valueOf(id).intValue();
  }

// Path: sherlock-no-op/src/main/java/com/singhajit/sherlock/core/investigation/Crash.java
// public class Crash {
//   public static final String DATE_FORMAT = "EEE MMM dd kk:mm:ss z yyyy";
// 
//   public Crash(String place, String reason, String stackTrace) {
//   }
// 
//   public Crash(int id, String placeOfCrash, String reasonOfCrash, String stacktrace, String date) {
//   }
// 
//   public DeviceInfo getDeviceInfo() {
//     return new DeviceInfo.Builder().build();
//   }
// 
//   public AppInfo getAppInfo() {
//     return new AppInfo();
//   }
// 
//   public void setId(int id) {
//   }
// 
//   public Class<Crash> getType() {
//     return Crash.class;
//   }
// 
//   public String getReason() {
//     return "";
//   }
// 
//   public String getStackTrace() {
//     return "";
//   }
// 
//   public String getPlace() {
//     return "";
//   }
// 
//   public int getId() {
//     return 0;
//   }
// 
//   public Date getDate() {
//     return new Date();
//   }
// }


// Path: sherlock/src/main/java/com/singhajit/sherlock/core/database/SherlockDatabaseHelper.java
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.support.annotation.NonNull;
import com.singhajit.sherlock.core.investigation.Crash;
import java.util.ArrayList;
import java.util.List;

package com.singhajit.sherlock.core.database;




public class SherlockDatabaseHelper extends SQLiteOpenHelper {
  private static final int VERSION = 2;
  private static final String DB_NAME = "Sherlock";

  public SherlockDatabaseHelper(Context context) {
    super(context, DB_NAME, null, VERSION);
  }

  @Override
  public void onCreate(SQLiteDatabase database) {
    database.execSQL(CrashTable.CREATE_QUERY);
  }

  @Override
  public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
    sqLiteDatabase.execSQL(CrashTable.DROP_QUERY);
    sqLiteDatabase.execSQL(CrashTable.CREATE_QUERY);
  }

  public int insertCrash(CrashRecord crashRecord) {
    ContentValues values = new ContentValues();
    values.put(CrashTable.PLACE, crashRecord.getPlace());
    values.put(CrashTable.REASON, crashRecord.getReason());
    values.put(CrashTable.STACKTRACE, crashRecord.getStackTrace());
    values.put(CrashTable.DATE, crashRecord.getDate());

    SQLiteDatabase database = getWritableDatabase();
    long id = database.insert(CrashTable.TABLE_NAME, null, values);
    database.close();

    return Long.valueOf(id).intValue();
  }

  public List<Crash> getCrashes() {