[Demonstration 1]

[Buggy Method]
public static void onUpgradeDatabaseToDBV8AppV38(SQLiteDatabase sqLiteDatabase) {
    sqLiteDatabase.beginTransaction();
    try {
        String rename = "ALTER TABLE " + Contract.Field.TABLE_NAME + " RENAME TO " + "tempTable";
        sqLiteDatabase.execSQL(rename);
        sqLiteDatabase.execSQL(DatabaseHelper.CREATE_FIELD_TABLE);
        String copy = "INSERT INTO " + Contract.Field.TABLE_NAME + " ( " + Contract.COLUMN_ID + " , " + Contract.Field.COLUMN_FIELD_NAME + " , " + Contract.Field.COLUMN_FIELD_TYPE + " , " + Contract.Field.COLUMN_ENTRY_QUESTION_COLUMN_DATA_TYPE + " , " + Contract.Field.COLUMN_LOCALE + " , " + Contract.Field.COLUMN_CHECK_TYPE + " , " + Contract.Field.COLUMN_SORT_BY + " , " + Contract.Field.COLUMN_LIST_TEXT_SIZE + " , " + Contract.Field.COLUMN_QUESTION_AREA_SIZE + " , " + Contract.Field.COLUMN_ANSWER_AREA_SIZE + " , " + Contract.Field.COLUMN_TEST_TEXT_SIZE + " , " + Contract.Field.COLUMN_ACTION_BAR_SHOWN + " , " + Contract.Field.COLUMN_READ_ANSWER + " , " + Contract.Field.COLUMN_USAGE_COUNT + " , " + Contract.Field.COLUMN_CREATION_EMULATION_NUMBER + " , " + Contract.CREATION_DATE + " ) " + "SELECT " + Contract.COLUMN_ID + " , " + Contract.Field.COLUMN_FIELD_NAME + " , " + Contract.Field.COLUMN_FIELD_TYPE + " , " + Contract.Field.COLUMN_ENTRY_QUESTION_COLUMN_DATA_TYPE + " , " + Contract.Field.COLUMN_LOCALE + " , " + Contract.Field.COLUMN_CHECK_TYPE + " , " + Contract.Field.COLUMN_SORT_BY + " , " + Contract.Field.COLUMN_LIST_TEXT_SIZE + " , " + Contract.Field.COLUMN_QUESTION_AREA_SIZE + " , " + Contract.Field.COLUMN_ANSWER_AREA_SIZE + " , " + Contract.Field.COLUMN_TEST_TEXT_SIZE + " , " + Contract.Field.COLUMN_ACTION_BAR_SHOWN + " , " + Contract.Field.COLUMN_READ_ANSWER + " , " + Contract.Field.COLUMN_USAGE_COUNT + " , " + Contract.Field.COLUMN_CREATION_EMULATION_NUMBER + " , " + Contract.CREATION_DATE + " FROM " + "tempTable" + ";";
        sqLiteDatabase.execSQL(copy);
        String drop = "DROP TABLE IF EXISTS " + "tempTable" + ";";
        sqLiteDatabase.execSQL(drop);
        rename = "ALTER TABLE " + Contract.String_Entry.TABLE_NAME + " RENAME TO " + "tempTable";
        sqLiteDatabase.execSQL(rename);
        sqLiteDatabase.execSQL(DatabaseHelper.CREATE_STRING_ENTRY_TABLE);
        copy = "INSERT INTO " + Contract.String_Entry.TABLE_NAME + " ( " + Contract.COLUMN_ID + " , " + Contract.String_Entry.COLUMN_QUESTION + " , " + Contract.String_Entry.COLUMN_ANSWER + " , " + Contract.String_Entry.COLUMN_FIELD + " , " + Contract.Old_String_Entry.COLUMN_PAUSED_TEST_ORDER + " , " + Contract.String_Entry.COLUMN_PAUSED_STUDY_PERIOD_ORDER + " , " + Contract.String_Entry.COLUMN_ASKED_COUNT + " , " + Contract.String_Entry.COLUMN_WRONGLY_ANSWERED_COUNT + " , " + Contract.String_Entry.COLUMN_RANK + " , " + Contract.String_Entry.COLUMN_CREATION_EMULATED_DATE + " , " + Contract.CREATION_DATE + " ) " + "SELECT " + Contract.COLUMN_ID + " , " + Contract.String_Entry.COLUMN_QUESTION + " , " + Contract.String_Entry.COLUMN_ANSWER + " , " + Contract.String_Entry.COLUMN_FIELD + " , " + Contract.Old_String_Entry.COLUMN_PAUSED_TEST_ORDER + " , " + Contract.String_Entry.COLUMN_PAUSED_STUDY_PERIOD_ORDER + " , " + Contract.String_Entry.COLUMN_ASKED_COUNT + " , " + Contract.String_Entry.COLUMN_WRONGLY_ANSWERED_COUNT + " , " + Contract.String_Entry.COLUMN_RANK + " , " + Contract.String_Entry.COLUMN_CREATION_EMULATED_DATE + " , " + Contract.CREATION_DATE + " FROM " + "tempTable" + ";";
        sqLiteDatabase.execSQL(copy);
        drop = "DROP TABLE IF EXISTS " + "tempTable" + ";";
        sqLiteDatabase.execSQL(drop);
        sqLiteDatabase.execSQL(DatabaseHelper.CREATE_EXCLUDED_TIME_TABLE);
        sqLiteDatabase.execSQL(DatabaseHelper.CREATE_SCHEDULED_TIME_BACKUP_TABLE);
        sqLiteDatabase.setTransactionSuccessful();
    } finally {
        sqLiteDatabase.endTransaction();
    }
}

[Buggy Hunk]
sqLiteDatabase.execSQL(DatabaseHelper.CREATE_STRING_ENTRY_TABLE);

[Patch]
sqLiteDatabase.execSQL(DatabaseHelper.CREATE_STRING_ENTRY_TABLE_OLD);

[Demonstration 2]

[Buggy Method]
void zoomOutToBouncer() {
    if (mZoomInOutAnim != null && mZoomInOutAnim.isRunning()) {
        mZoomInOutAnim.cancel();
    }
    int curPage = getCurrentPage();
    View currentPage = getPageAt(curPage);
    if (shouldSetTopAlignedPivotForWidget(curPage)) {
        currentPage.setPivotY(0);
        // Note: we are working around the issue that setting the x-pivot to the same value as it
        //       was does not actually work.
        currentPage.setPivotX(0);
        currentPage.setPivotX(currentPage.getMeasuredWidth() / 2);
    }
    if (!(currentPage.getScaleX() < 1f || currentPage.getScaleY() < 1f)) {
        mZoomInOutAnim = new AnimatorSet();
        mZoomInOutAnim.playTogether(ObjectAnimator.ofFloat(currentPage, "scaleX", BOUNCER_SCALE_FACTOR), ObjectAnimator.ofFloat(currentPage, "scaleY", BOUNCER_SCALE_FACTOR));
        mZoomInOutAnim.setDuration(mBouncerZoomInOutDuration);
        mZoomInOutAnim.setInterpolator(new DecelerateInterpolator(1.5f));
        mZoomInOutAnim.start();
    }
    if (currentPage instanceof KeyguardWidgetFrame) {
        ((KeyguardWidgetFrame) currentPage).onBouncerShowing(true);
    }
}

[Buggy Hunk]
if (!(currentPage.getScaleX() < 1f || currentPage.getScaleY() < 1f)) {

[Patch]
if (currentPage != null && (!(currentPage.getScaleX() < 1f || currentPage.getScaleY() < 1f))) {

[Demonstration 3]

[Buggy Method]
@Override
public void onStepSelected(Step step) {
    if (mView.isDualPane()) {
        checkVideoAvailability(mSteps[mPosition]);
        mView.showStep(step);
    }
}

[Buggy Hunk]
checkVideoAvailability(mSteps[mPosition]);

[Patch]
checkVideoAvailability(step);