<commit_before>package com.xtremelabs.robolectric.tester.android.util;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

public class TestFragmentTransaction extends FragmentTransaction {

    private TestFragmentManager fragmentManager;
    private int containerViewId;
    private String tag;
    private Fragment fragment;
    private boolean isReplacing;

    public TestFragmentTransaction(TestFragmentManager fragmentManager) {
        this.fragmentManager = fragmentManager;
    }

    @Override
    public FragmentTransaction add(Fragment fragment, String tag) {
        this.containerViewId = View.NO_ID;
        this.tag = tag;
        this.fragment = fragment;
        return this;
    }

    @Override
    public FragmentTransaction add(int containerViewId, Fragment fragment) {
        this.containerViewId = containerViewId;
        this.fragment = fragment;
        return this;
    }

    @Override
    public FragmentTransaction add(int containerViewId, Fragment fragment, String tag) {
        this.containerViewId = containerViewId;
        this.tag = tag;
        this.fragment = fragment;
        return this;
    }

    @Override
    public FragmentTransaction replace(int containerViewId, Fragment fragment) {
        this.containerViewId = containerViewId;
        this.fragment = fragment;
        this.isReplacing = true;
        return this;
    }

    @Override
    public FragmentTransaction replace(int containerViewId, Fragment fragment, String tag) {
        this.containerViewId = containerViewId;
        this.tag = tag;
        this.fragment = fragment;
        this.isReplacing = true;
        return this;
    }

    @Override
    public FragmentTransaction remove(Fragment fragment) {
        return null;
    }

    @Override
    public FragmentTransaction hide(Fragment fragment) {
        return null;
    }

    @Override
    public FragmentTransaction show(Fragment fragment) {
        return null;
    }

    @Override
    public FragmentTransaction detach(Fragment fragment) {
        return null;
    }

    @Override
    public FragmentTransaction attach(Fragment fragment) {
        return null;
    }

    @Override
    public boolean isEmpty() {
        return false;
    }

    @Override
    public FragmentTransaction setCustomAnimations(int enter, int exit) {
        return null;
    }

    @Override
    public FragmentTransaction setCustomAnimations(int enter, int exit, int popEnter, int popExit) {
        return null;
    }

    @Override
    public FragmentTransaction setTransition(int transit) {
        return null;
    }

    @Override
    public FragmentTransaction setTransitionStyle(int styleRes) {
        return null;
    }

    @Override
    public FragmentTransaction addToBackStack(String name) {
        return null;
    }

    @Override
    public boolean isAddToBackStackAllowed() {
        return false;
    }

    @Override
    public FragmentTransaction disallowAddToBackStack() {
        return null;
    }

    @Override
    public FragmentTransaction setBreadCrumbTitle(int res) {
        return null;
    }

    @Override
    public FragmentTransaction setBreadCrumbTitle(CharSequence text) {
        return null;
    }

    @Override
    public FragmentTransaction setBreadCrumbShortTitle(int res) {
        return null;
    }

    @Override
    public FragmentTransaction setBreadCrumbShortTitle(CharSequence text) {
        return null;
    }

    @Override
    public int commit() {
        fragmentManager.addFragment(containerViewId, tag, fragment, isReplacing);
        return 0;
    }

    @Override
    public int commitAllowingStateLoss() {
        return 0;
    }
}
<commit_msg>TestFragmentTransaction simulates real Android behavior of posting the commit<commit_after>package com.xtremelabs.robolectric.tester.android.util;

import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

public class TestFragmentTransaction extends FragmentTransaction {

    private TestFragmentManager fragmentManager;
    private int containerViewId;
    private String tag;
    private Fragment fragment;
    private boolean isReplacing;

    public TestFragmentTransaction(TestFragmentManager fragmentManager) {
        this.fragmentManager = fragmentManager;
    }

    @Override
    public FragmentTransaction add(Fragment fragment, String tag) {
        this.containerViewId = View.NO_ID;
        this.tag = tag;
        this.fragment = fragment;
        return this;
    }

    @Override
    public FragmentTransaction add(int containerViewId, Fragment fragment) {
        this.containerViewId = containerViewId;
        this.fragment = fragment;
        return this;
    }

    @Override
    public FragmentTransaction add(int containerViewId, Fragment fragment, String tag) {
        this.containerViewId = containerViewId;
        this.tag = tag;
        this.fragment = fragment;
        return this;
    }

    @Override
    public FragmentTransaction replace(int containerViewId, Fragment fragment) {
        this.containerViewId = containerViewId;
        this.fragment = fragment;
        this.isReplacing = true;
        return this;
    }

    @Override
    public FragmentTransaction replace(int containerViewId, Fragment fragment, String tag) {
        this.containerViewId = containerViewId;
        this.tag = tag;
        this.fragment = fragment;
        this.isReplacing = true;
        return this;
    }

    @Override
    public FragmentTransaction remove(Fragment fragment) {
        return null;
    }

    @Override
    public FragmentTransaction hide(Fragment fragment) {
        return null;
    }

    @Override
    public FragmentTransaction show(Fragment fragment) {
        return null;
    }

    @Override
    public FragmentTransaction detach(Fragment fragment) {
        return null;
    }

    @Override
    public FragmentTransaction attach(Fragment fragment) {
        return null;
    }

    @Override
    public boolean isEmpty() {
        return false;
    }

    @Override
    public FragmentTransaction setCustomAnimations(int enter, int exit) {
        return null;
    }

    @Override
    public FragmentTransaction setCustomAnimations(int enter, int exit, int popEnter, int popExit) {
        return null;
    }

    @Override
    public FragmentTransaction setTransition(int transit) {
        return null;
    }

    @Override
    public FragmentTransaction setTransitionStyle(int styleRes) {
        return null;
    }

    @Override
    public FragmentTransaction addToBackStack(String name) {
        return null;
    }

    @Override
    public boolean isAddToBackStackAllowed() {
        return false;
    }

    @Override
    public FragmentTransaction disallowAddToBackStack() {
        return null;
    }

    @Override
    public FragmentTransaction setBreadCrumbTitle(int res) {
        return null;
    }

    @Override
    public FragmentTransaction setBreadCrumbTitle(CharSequence text) {
        return null;
    }

    @Override
    public FragmentTransaction setBreadCrumbShortTitle(int res) {
        return null;
    }

    @Override
    public FragmentTransaction setBreadCrumbShortTitle(CharSequence text) {
        return null;
    }

    @Override
    public int commit() {
        new Handler().post(new Runnable() {
            @Override
            public void run() {
                fragmentManager.addFragment(containerViewId, tag, fragment, isReplacing);
            }
        });
        return 0;
    }

    @Override
    public int commitAllowingStateLoss() {
        return 0;
    }
}

{'fraction_non_alphanumeric': 0.0656886927171232, 'fraction_numerical': 0.0010385564065948333, 'mean_word_length': 2.608430913348946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6724997', 'n_tokens_mistral': 2044, 'n_tokens_neox': 1920, 'n_words': 521}