Program: 152491
Project: 152491
Buggy source:
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  if (oldVersion < 99) {
    Log.i(TAG,"String_Node_Str" + oldVersion + "String_Node_Str"+ newVersion+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.CONTACTS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.RAW_CONTACTS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.PACKAGES + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.MIMETYPES + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.DATA + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.PHONE_LOOKUP + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.NAME_LOOKUP + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.NICKNAME_LOOKUP + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.GROUPS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.ACTIVITIES + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.CALLS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.SETTINGS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.STATUS_UPDATES + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.AGGREGATION_EXCEPTIONS + "String_Node_Str");
    onCreate(db);
    return;
  }
  Log.i(TAG,"String_Node_Str" + oldVersion + "String_Node_Str"+ newVersion);
  boolean upgradeViewsAndTriggers=false;
  if (oldVersion == 99) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 100) {
    db.execSQL("String_Node_Str" + Tables.MIMETYPES + "String_Node_Str"+ MimetypesColumns.MIMETYPE+ "String_Node_Str"+ MimetypesColumns._ID+ "String_Node_Str");
    updateIndexStats(db,Tables.MIMETYPES,"String_Node_Str","String_Node_Str");
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 101) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 102) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 103) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 104 || oldVersion == 201) {
    LegacyApiSupport.createSettingsTable(db);
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 105) {
    upgradeToVersion202(db);
    oldVersion=202;
  }
  if (oldVersion == 202) {
    upgradeToVersion203(db);
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 203) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 204) {
    upgradeToVersion205(db);
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 205) {
    upgrateToVersion206(db);
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 206) {
    upgrateToVersion300(db);
    oldVersion=300;
  }
  if (upgradeViewsAndTriggers) {
    createContactsViews(db);
    createGroupsView(db);
    createContactEntitiesView(db);
    createContactsTriggers(db);
    LegacyApiSupport.createViews(db);
  }
  if (oldVersion != newVersion) {
    throw new IllegalStateException("String_Node_Str" + newVersion);
  }
}

Fixed version (ground truth):
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  if (oldVersion < 99) {
    Log.i(TAG,"String_Node_Str" + oldVersion + "String_Node_Str"+ newVersion+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.CONTACTS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.RAW_CONTACTS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.PACKAGES + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.MIMETYPES + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.DATA + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.PHONE_LOOKUP + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.NAME_LOOKUP + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.NICKNAME_LOOKUP + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.GROUPS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.ACTIVITIES + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.CALLS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.SETTINGS + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.STATUS_UPDATES + "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.AGGREGATION_EXCEPTIONS + "String_Node_Str");
    onCreate(db);
    return;
  }
  Log.i(TAG,"String_Node_Str" + oldVersion + "String_Node_Str"+ newVersion);
  boolean upgradeViewsAndTriggers=false;
  if (oldVersion == 99) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 100) {
    db.execSQL("String_Node_Str" + Tables.MIMETYPES + "String_Node_Str"+ MimetypesColumns.MIMETYPE+ "String_Node_Str"+ MimetypesColumns._ID+ "String_Node_Str");
    updateIndexStats(db,Tables.MIMETYPES,"String_Node_Str","String_Node_Str");
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 101) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 102) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 103) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 104 || oldVersion == 201) {
    LegacyApiSupport.createSettingsTable(db);
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 105) {
    upgradeToVersion202(db);
    oldVersion=202;
  }
  if (oldVersion == 202) {
    upgradeToVersion203(db);
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 203) {
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 204) {
    upgradeToVersion205(db);
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 205) {
    upgrateToVersion206(db);
    upgradeViewsAndTriggers=true;
    oldVersion++;
  }
  if (oldVersion == 206) {
    upgrateToVersion300(db);
    oldVersion=300;
  }
  if (oldVersion == 300) {
    upgradeViewsAndTriggers=true;
    oldVersion=301;
  }
  if (upgradeViewsAndTriggers) {
    createContactsViews(db);
    createGroupsView(db);
    createContactEntitiesView(db);
    createContactsTriggers(db);
    LegacyApiSupport.createViews(db);
  }
  if (oldVersion != newVersion) {
    throw new IllegalStateException("String_Node_Str" + newVersion);
  }
}