Program: 152694
Project: 152694
Buggy source:
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  if (DBG) {
    log("String_Node_Str" + db + "String_Node_Str"+ oldVersion+ "String_Node_Str"+ newVersion);
  }
  if (oldVersion < (5 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=5 << 16 | 6;
  }
  if (oldVersion < (6 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=6 << 16 | 6;
  }
  if (oldVersion < (7 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=7 << 16 | 6;
  }
  if (oldVersion < (8 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=8 << 16 | 6;
  }
  if (oldVersion < (9 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str"+ SubscriptionManager.INVALID_SUBSCRIPTION_ID+ "String_Node_Str");
    oldVersion=9 << 16 | 6;
  }
  if (oldVersion < (10 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=10 << 16 | 6;
  }
  if (oldVersion < (11 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=11 << 16 | 6;
  }
  if (oldVersion < (12 << 16 | 6)) {
    try {
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.MCC+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.MNC+ "String_Node_Str");
    }
 catch (    SQLiteException e) {
      if (DBG) {
        log("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ "String_Node_Str");
      }
    }
    oldVersion=12 << 16 | 6;
  }
  if (oldVersion < (13 << 16 | 6)) {
    try {
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CARRIER_NAME+ "String_Node_Str");
    }
 catch (    SQLiteException e) {
      if (DBG) {
        log("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ "String_Node_Str");
      }
    }
    oldVersion=13 << 16 | 6;
  }
  if (oldVersion < (14 << 16 | 6)) {
  }
  if (oldVersion < (15 << 16 | 6)) {
    Cursor c;
    String[] proj={"String_Node_Str"};
    if (VDBG) {
      c=db.query(CARRIERS_TABLE,proj,null,null,null,null,null);
      log("String_Node_Str" + c.getCount());
    }
    preserveUserAndCarrierApns(db);
    c=db.query(CARRIERS_TABLE,null,null,null,null,null,null);
    if (VDBG) {
      log("String_Node_Str" + "String_Node_Str" + ((c == null) ? 0 : c.getCount()));
    }
    createCarriersTable(db,CARRIERS_TABLE_TMP);
    copyPreservedApnsToNewTable(db,c);
    c.close();
    db.execSQL("String_Node_Str" + CARRIERS_TABLE);
    db.execSQL("String_Node_Str" + CARRIERS_TABLE_TMP + "String_Node_Str"+ CARRIERS_TABLE+ "String_Node_Str");
    if (VDBG) {
      c=db.query(CARRIERS_TABLE,proj,null,null,null,null,null);
      log("String_Node_Str" + c.getCount());
      c.close();
      c=db.query(CARRIERS_TABLE,proj,IS_UNEDITED,null,null,null,null);
      log("String_Node_Str" + IS_UNEDITED + "String_Node_Str"+ c.getCount());
      c.close();
      c=db.query(CARRIERS_TABLE,proj,IS_EDITED,null,null,null,null);
      log("String_Node_Str" + IS_EDITED + "String_Node_Str"+ c.getCount());
      c.close();
    }
    oldVersion=15 << 16 | 6;
  }
  if (oldVersion < (16 << 16 | 6)) {
    try {
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_EXTREME_THREAT_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_SEVERE_THREAT_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_AMBER_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_EMERGENCY_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ALERT_SOUND_DURATION+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ALERT_REMINDER_INTERVAL+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ALERT_VIBRATE+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ALERT_SPEECH+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ETWS_TEST_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_CHANNEL_50_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_CMAS_TEST_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_OPT_OUT_DIALOG+ "String_Node_Str");
    }
 catch (    SQLiteException e) {
      if (DBG) {
        log("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ "String_Node_Str");
      }
    }
    oldVersion=16 << 16 | 6;
  }
  if (oldVersion < (17 << 16 | 6)) {
    Cursor c=null;
    try {
      c=db.query(CARRIERS_TABLE,null,null,null,null,null,null,String.valueOf(1));
      if (c == null || c.getColumnIndex(USER_VISIBLE) == -1) {
        db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str"+ USER_VISIBLE+ "String_Node_Str");
      }
 else {
        if (DBG) {
          log("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str"+ USER_VISIBLE+ "String_Node_Str");
        }
      }
    }
  finally {
      if (c != null) {
        c.close();
      }
    }
    oldVersion=17 << 16 | 6;
  }
  if (DBG) {
    log("String_Node_Str" + db + "String_Node_Str"+ oldVersion+ "String_Node_Str"+ newVersion);
  }
}

Fixed version (ground truth):
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  if (DBG) {
    log("String_Node_Str" + db + "String_Node_Str"+ oldVersion+ "String_Node_Str"+ newVersion);
  }
  if (oldVersion < (5 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=5 << 16 | 6;
  }
  if (oldVersion < (6 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=6 << 16 | 6;
  }
  if (oldVersion < (7 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=7 << 16 | 6;
  }
  if (oldVersion < (8 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=8 << 16 | 6;
  }
  if (oldVersion < (9 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str"+ SubscriptionManager.INVALID_SUBSCRIPTION_ID+ "String_Node_Str");
    oldVersion=9 << 16 | 6;
  }
  if (oldVersion < (10 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=10 << 16 | 6;
  }
  if (oldVersion < (11 << 16 | 6)) {
    db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str");
    oldVersion=11 << 16 | 6;
  }
  if (oldVersion < (12 << 16 | 6)) {
    try {
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.MCC+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.MNC+ "String_Node_Str");
    }
 catch (    SQLiteException e) {
      if (DBG) {
        log("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ "String_Node_Str");
      }
    }
    oldVersion=12 << 16 | 6;
  }
  if (oldVersion < (13 << 16 | 6)) {
    try {
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CARRIER_NAME+ "String_Node_Str");
    }
 catch (    SQLiteException e) {
      if (DBG) {
        log("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ "String_Node_Str");
      }
    }
    oldVersion=13 << 16 | 6;
  }
  if (oldVersion < (14 << 16 | 6)) {
  }
  if (oldVersion < (15 << 16 | 6)) {
    Cursor c;
    String[] proj={"String_Node_Str"};
    if (VDBG) {
      c=db.query(CARRIERS_TABLE,proj,null,null,null,null,null);
      log("String_Node_Str" + c.getCount());
    }
    preserveUserAndCarrierApns(db);
    c=db.query(CARRIERS_TABLE,null,null,null,null,null,null);
    if (VDBG) {
      log("String_Node_Str" + "String_Node_Str" + ((c == null) ? 0 : c.getCount()));
    }
    createCarriersTable(db,CARRIERS_TABLE_TMP);
    copyPreservedApnsToNewTable(db,c);
    c.close();
    db.execSQL("String_Node_Str" + CARRIERS_TABLE);
    db.execSQL("String_Node_Str" + CARRIERS_TABLE_TMP + "String_Node_Str"+ CARRIERS_TABLE+ "String_Node_Str");
    if (VDBG) {
      c=db.query(CARRIERS_TABLE,proj,null,null,null,null,null);
      log("String_Node_Str" + c.getCount());
      c.close();
      c=db.query(CARRIERS_TABLE,proj,IS_UNEDITED,null,null,null,null);
      log("String_Node_Str" + IS_UNEDITED + "String_Node_Str"+ c.getCount());
      c.close();
      c=db.query(CARRIERS_TABLE,proj,IS_EDITED,null,null,null,null);
      log("String_Node_Str" + IS_EDITED + "String_Node_Str"+ c.getCount());
      c.close();
    }
    oldVersion=15 << 16 | 6;
  }
  if (oldVersion < (16 << 16 | 6)) {
    try {
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_EXTREME_THREAT_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_SEVERE_THREAT_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_AMBER_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_EMERGENCY_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ALERT_SOUND_DURATION+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ALERT_REMINDER_INTERVAL+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ALERT_VIBRATE+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ALERT_SPEECH+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_ETWS_TEST_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_CHANNEL_50_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_CMAS_TEST_ALERT+ "String_Node_Str");
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.CB_OPT_OUT_DIALOG+ "String_Node_Str");
    }
 catch (    SQLiteException e) {
      if (DBG) {
        log("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ "String_Node_Str");
      }
    }
    oldVersion=16 << 16 | 6;
  }
  if (oldVersion < (17 << 16 | 6)) {
    Cursor c=null;
    try {
      c=db.query(CARRIERS_TABLE,null,null,null,null,null,null,String.valueOf(1));
      if (c == null || c.getColumnIndex(USER_VISIBLE) == -1) {
        db.execSQL("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str"+ USER_VISIBLE+ "String_Node_Str");
      }
 else {
        if (DBG) {
          log("String_Node_Str" + CARRIERS_TABLE + "String_Node_Str"+ USER_VISIBLE+ "String_Node_Str");
        }
      }
    }
  finally {
      if (c != null) {
        c.close();
      }
    }
    oldVersion=17 << 16 | 6;
  }
  if (oldVersion < (18 << 16 | 6)) {
    try {
      db.execSQL("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ SubscriptionManager.SIM_PROVISIONING_STATUS+ "String_Node_Str"+ SubscriptionManager.SIM_PROVISIONED+ "String_Node_Str");
    }
 catch (    SQLiteException e) {
      if (DBG) {
        log("String_Node_Str" + SIMINFO_TABLE + "String_Node_Str"+ "String_Node_Str");
      }
    }
    oldVersion=18 << 16 | 6;
  }
  if (DBG) {
    log("String_Node_Str" + db + "String_Node_Str"+ oldVersion+ "String_Node_Str"+ newVersion);
  }
}