[Demonstration 1]

[Buggy Method]
@Override
public void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
    if (firebaseAuth.getCurrentUser() != null) {
        startActivity(new Intent(getApplicationContext(), DashboardActivity.class));
    } else {
        AccessToken currentFBAccessToken = AccessToken.getCurrentAccessToken();
        if (currentFBAccessToken != null && !currentFBAccessToken.isExpired()) {
            CustomToast.displayMessage(getApplicationContext(), "User already logged into facebook.");
            handleFacebookAccessToken(currentFBAccessToken);
        } else {
            registerFBLoginCallbacks();
            setContentView(R.layout.activity_login);
            LoginButton loginButton = (LoginButton) findViewById(R.id.login_button);
            loginButton.setReadPermissions("email", "public_profile");
        }
    }
}

[Buggy Hunk]
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();

[Patch]
firebaseAuth = FirebaseAuth.getInstance();

[Demonstration 2]

[Buggy Method]
private void addFailure(Block<Throwable> block) {
    synchronized (this) {
        if (read.getCount() == 0) {
            if (throwable != null) {
                block.apply(throwable);
            }
        } else if (success == null) {
            failed = block;
        } else {
            failed = Blocks.chain(failed, block);
        }
    }
}

[Buggy Hunk]
} else if (success == null) {

[Patch]
} else if (failed == null) {

[Demonstration 3]

[Buggy Method]
private void removePointer(Integer pointerId, ButtonRecord record) {
    int foundId = record.activePointers.size();
    while ((--foundId + 1) >= 0) {
        if (record.activePointers.get(foundId) == pointerId) {
            record.activePointers.remove(foundId);
            foundId = -1;
        }
    }
    if (record.activePointers.size() == 0) {
        record.state = 0;
        createEvent(pointerToButton.get(pointerId), 0);
    }
    pointerToButton.remove(pointerId);
}

[Buggy Hunk]
while ((--foundId + 1) >= 0) {

[Patch]
while (--foundId + 1 >= 0) {