JEB output JAD output
// Decompiled by JEB v0.9.0 alpha

package android.support.v4.app;

import android.util.Log;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;

final class BackStackRecord extends FragmentTransaction implements BackStackEntry, Runnable {
    final class Op {
        Op() {
            super();
        }
    }

    static final int OP_ADD = 1;
    static final int OP_ATTACH = 7;
    static final int OP_DETACH = 6;
    static final int OP_HIDE = 4;
    static final int OP_NULL = 0;
    static final int OP_REMOVE = 3;
    static final int OP_REPLACE = 2;
    static final int OP_SHOW = 5;
    static final String TAG = "BackStackEntry";
    boolean mAddToBackStack;
    boolean mAllowAddToBackStack;
    int mBreadCrumbShortTitleRes;
    CharSequence mBreadCrumbShortTitleText;
    int mBreadCrumbTitleRes;
    CharSequence mBreadCrumbTitleText;
    boolean mCommitted;
    int mEnterAnim;
    int mExitAnim;
    Op mHead;
    int mIndex;
    final FragmentManagerImpl mManager;
    String mName;
    int mNumOp;
    int mPopEnterAnim;
    int mPopExitAnim;
    Op mTail;
    int mTransition;
    int mTransitionStyle;

    public BackStackRecord(FragmentManagerImpl arg2) {
        super();
        this.mAllowAddToBackStack = true;
        this.mManager = arg2;
    }

    public FragmentTransaction add(int arg3, Fragment arg4) {
        this.doAddOp(arg3, arg4, 0, 1);
        return this;
    }

    public FragmentTransaction add(int arg2, Fragment arg3, String arg4) {
        this.doAddOp(arg2, arg3, arg4, 1);
        return this;
    }

    public FragmentTransaction add(Fragment arg3, String arg4) {
        this.doAddOp(0, arg3, arg4, 1);
        return this;
    }

    void addOp(Op arg2) {
        if(this.mHead == 0) {
            this.mTail = arg2;
            this.mHead = arg2;
        }
        else {
            arg2.prev = this.mTail;
            this.mTail.next = arg2;
            this.mTail = arg2;
        }

        arg2.enterAnim = this.mEnterAnim;
        arg2.exitAnim = this.mExitAnim;
        arg2.popEnterAnim = this.mPopEnterAnim;
        arg2.popExitAnim = this.mPopExitAnim;
        ++this.mNumOp;
    }

    public FragmentTransaction addToBackStack(String arg3) {
        if(!this.mAllowAddToBackStack) {
            throw new IllegalStateException("This FragmentTransaction is not allowed to be added to the back stack.");
        }

        this.mAddToBackStack = true;
        this.mName = arg3;
        return this;
    }

    public FragmentTransaction attach(Fragment arg3) {
        Op v0 = new Op();
        v0.cmd = 7;
        v0.fragment = arg3;
        this.addOp(v0);
        return this;
    }

    void bumpBackStackNesting(int arg7) {
        if(this.mAddToBackStack) {
            if(FragmentManagerImpl.DEBUG != false) {
                StringBuilder v4 = new StringBuilder();
                v4 = v4.append("Bump nesting in ");
                v4 = v4.append(((Object)this));
                v4 = v4.append(" by ");
                v4 = v4.append(arg7);
                String v4_1 = v4.toString();
                Log.v("BackStackEntry", v4_1);
            }

            Op v1 = this.mHead;
            while(v1 != 0) {
                if(v1.fragment != 0) {
                    v1.fragment.mBackStackNesting += arg7;
                    if(FragmentManagerImpl.DEBUG != false) {
                        v4 = new StringBuilder();
                        v4 = v4.append("Bump nesting of ");
                        v4 = v4.append(v1.fragment);
                        v4 = v4.append(" to ");
                        v4 = v4.append(v1.fragment.mBackStackNesting);
                        v4_1 = v4.toString();
                        Log.v("BackStackEntry", v4_1);
                    }

                }

                if(v1.removed != 0) {
                    int v0 = v1.removed.size() - 1;
                    while(v0 >= 0) {
                        Object v2 = v1.removed.get(v0);
                        ((Fragment)v2).mBackStackNesting += arg7;
                        if(FragmentManagerImpl.DEBUG != false) {
                            v4 = new StringBuilder();
                            v4 = v4.append("Bump nesting of ");
                            v4 = v4.append(v2);
                            v4 = v4.append(" to ");
                            v4 = v4.append(((Fragment)v2).mBackStackNesting);
                            v4_1 = v4.toString();
                            Log.v("BackStackEntry", v4_1);
                        }

                        --v0;
                    }

                }

                v1 = v1.next;
            }

        }

    }

    public int commit() {
        return this.commitInternal(false);
    }

    public int commitAllowingStateLoss() {
        return this.commitInternal(true);
    }

    int commitInternal(boolean arg4) {
        if(this.mCommitted) {
            throw new IllegalStateException("commit already called");
        }

        if(FragmentManagerImpl.DEBUG) {
            StringBuilder v1 = new StringBuilder();
            v1 = v1.append("Commit: ");
            v1 = v1.append(((Object)this));
            String v1_1 = v1.toString();
            Log.v("BackStackEntry", v1_1);
        }

        this.mCommitted = true;
        if(this.mAddToBackStack) {
            this.mIndex = this.mManager.allocBackStackIndex(this);
        }
        else {
            this.mIndex = 1;
        }

        this.mManager.enqueueAction(((Runnable)this), arg4);
        return this.mIndex;
    }

    public FragmentTransaction detach(Fragment arg3) {
        Op v0 = new Op();
        v0.cmd = 6;
        v0.fragment = arg3;
        this.addOp(v0);
        return this;
    }

    public FragmentTransaction disallowAddToBackStack() {
        if(this.mAddToBackStack) {
            throw new IllegalStateException("This transaction is already being added to the back stack");
        }

        this.mAllowAddToBackStack = false;
        return this;
    }

    private void doAddOp(int arg5, Fragment arg6, String arg7, int arg8) {
        arg6.mFragmentManager = this.mManager;
        if(arg7 != 0) {
            if(arg6.mTag != 0 && arg7.equals(arg6.mTag) == false) {
                StringBuilder v2 = new StringBuilder();
                v2 = v2.append("Can\'t change tag of fragment ");
                v2 = v2.append(((Object)arg6));
                v2 = v2.append(": was ");
                v2 = v2.append(arg6.mTag);
                v2 = v2.append(" now ");
                v2 = v2.append(arg7);
                String v2_1 = v2.toString();
                throw new IllegalStateException(v2_1);
            }

            arg6.mTag = arg7;
        }

        if(arg5 != 0) {
            if(arg6.mFragmentId != 0 && arg6.mFragmentId != arg5) {
                v2 = new StringBuilder();
                v2 = v2.append("Can\'t change container ID of fragment ");
                v2 = v2.append(((Object)arg6));
                v2 = v2.append(": was ");
                v2 = v2.append(arg6.mFragmentId);
                v2 = v2.append(" now ");
                v2 = v2.append(arg5);
                v2_1 = v2.toString();
                throw new IllegalStateException(v2_1);
            }

            arg6.mFragmentId = arg5;
            arg6.mContainerId = arg5;
        }

        Op v0 = new Op();
        v0.cmd = arg8;
        v0.fragment = arg6;
        this.addOp(v0);
    }

    public void dump(String arg7, FileDescriptor arg8, PrintWriter arg9, String[] arg10) {
        arg9.print(arg7);
        arg9.print("mName=");
        arg9.print(this.mName);
        arg9.print(" mIndex=");
        arg9.print(this.mIndex);
        arg9.print(" mCommitted=");
        arg9.println(this.mCommitted);
        if(this.mTransition != 0) {
            arg9.print(arg7);
            arg9.print("mTransition=#");
            String v4 = Integer.toHexString(this.mTransition);
            arg9.print(v4);
            arg9.print(" mTransitionStyle=#");
            v4 = Integer.toHexString(this.mTransitionStyle);
            arg9.println(v4);
        }

        if(this.mEnterAnim != 0 || this.mExitAnim != 0) {
            arg9.print(arg7);
            arg9.print("mEnterAnim=#");
            v4 = Integer.toHexString(this.mEnterAnim);
            arg9.print(v4);
            arg9.print(" mExitAnim=#");
            v4 = Integer.toHexString(this.mExitAnim);
            arg9.println(v4);
        }

        if(this.mPopEnterAnim != 0 || this.mPopExitAnim != 0) {
            arg9.print(arg7);
            arg9.print("mPopEnterAnim=#");
            v4 = Integer.toHexString(this.mPopEnterAnim);
            arg9.print(v4);
            arg9.print(" mPopExitAnim=#");
            v4 = Integer.toHexString(this.mPopExitAnim);
            arg9.println(v4);
        }

        if(this.mBreadCrumbTitleRes != 0 || this.mBreadCrumbTitleText != 0) {
            arg9.print(arg7);
            arg9.print("mBreadCrumbTitleRes=#");
            v4 = Integer.toHexString(this.mBreadCrumbTitleRes);
            arg9.print(v4);
            arg9.print(" mBreadCrumbTitleText=");
            arg9.println(this.mBreadCrumbTitleText);
        }

        if(this.mBreadCrumbShortTitleRes != 0 || this.mBreadCrumbShortTitleText != 0) {
            arg9.print(arg7);
            arg9.print("mBreadCrumbShortTitleRes=#");
            v4 = Integer.toHexString(this.mBreadCrumbShortTitleRes);
            arg9.print(v4);
            arg9.print(" mBreadCrumbShortTitleText=");
            arg9.println(this.mBreadCrumbShortTitleText);
        }

        if(this.mHead != 0) {
            arg9.print(arg7);
            arg9.println("Operations:");
            StringBuilder v4_1 = new StringBuilder();
            v4_1 = v4_1.append(arg7);
            v4_1 = v4_1.append("    ");
            String v1 = v4_1.toString();
            Op v3 = this.mHead;
            while(v3 != 0) {
                arg9.print(arg7);
                arg9.print("  Op #");
                arg9.print(0);
                arg9.println(":");
                arg9.print(v1);
                arg9.print("cmd=");
                arg9.print(v3.cmd);
                arg9.print(" fragment=");
                arg9.println(v3.fragment);
                if(v3.enterAnim != 0 || v3.exitAnim != 0) {
                    arg9.print(arg7);
                    arg9.print("enterAnim=#");
                    v4 = Integer.toHexString(v3.enterAnim);
                    arg9.print(v4);
                    arg9.print(" exitAnim=#");
                    v4 = Integer.toHexString(v3.exitAnim);
                    arg9.println(v4);
                }

                if(v3.popEnterAnim != 0 || v3.popExitAnim != 0) {
                    arg9.print(arg7);
                    arg9.print("popEnterAnim=#");
                    v4 = Integer.toHexString(v3.popEnterAnim);
                    arg9.print(v4);
                    arg9.print(" popExitAnim=#");
                    v4 = Integer.toHexString(v3.popExitAnim);
                    arg9.println(v4);
                }

                if(v3.removed != 0 && v3.removed.size() > 0) {
                    int v0 = 0;
                    while(v0 < v3.removed.size()) {
                        arg9.print(v1);
                        if(v3.removed.size() == 1) {
                            arg9.print("Removed: ");
                        }
                        else {
                            arg9.println("Removed:");
                            arg9.print(v1);
                            arg9.print("  #");
                            arg9.print(0);
                            arg9.print(": ");
                        }

                        Object v4_2 = v3.removed.get(v0);
                        arg9.println(v4_2);
                        ++v0;
                    }

                }

                v3 = v3.next;
            }

        }

    }

    public CharSequence getBreadCrumbShortTitle() {
        if(this.mBreadCrumbShortTitleRes != 0) {
            CharSequence v0 = this.mManager.mActivity.getText(this.mBreadCrumbShortTitleRes);
        }
        else {
            v0 = this.mBreadCrumbShortTitleText;
        }

        return v0;
    }

    public int getBreadCrumbShortTitleRes() {
        return this.mBreadCrumbShortTitleRes;
    }

    public CharSequence getBreadCrumbTitle() {
        if(this.mBreadCrumbTitleRes != 0) {
            CharSequence v0 = this.mManager.mActivity.getText(this.mBreadCrumbTitleRes);
        }
        else {
            v0 = this.mBreadCrumbTitleText;
        }

        return v0;
    }

    public int getBreadCrumbTitleRes() {
        return this.mBreadCrumbTitleRes;
    }

    public int getId() {
        return this.mIndex;
    }

    public String getName() {
        return this.mName;
    }

    public int getTransition() {
        return this.mTransition;
    }

    public int getTransitionStyle() {
        return this.mTransitionStyle;
    }

    public FragmentTransaction hide(Fragment arg3) {
        Op v0 = new Op();
        v0.cmd = 4;
        v0.fragment = arg3;
        this.addOp(v0);
        return this;
    }

    public boolean isAddToBackStackAllowed() {
        return this.mAllowAddToBackStack;
    }

    public boolean isEmpty() {
        if(this.mNumOp == 0) {
            boolean v0 = true;
        }
        else {
            v0 = false;
        }

        return v0;
    }

    public void popFromBackStack(boolean arg11) {
        int v9 = 1;
        if(FragmentManagerImpl.DEBUG) {
            StringBuilder v5 = new StringBuilder();
            v5 = v5.append("popFromBackStack: ");
            v5 = v5.append(((Object)this));
            String v5_1 = v5.toString();
            Log.v("BackStackEntry", v5_1);
        }

        this.bumpBackStackNesting(v9);
        Op v3 = this.mTail;
        while(v3 != 0) {
            switch(v3.cmd) {
                case 0x1: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.popExitAnim;
                    v4 = this.mManager;
                    v5_2 = FragmentManagerImpl.reverseTransit(this.mTransition);
                    v4.removeFragment(v0, v5_2, this.mTransitionStyle);
                    break;
                }
                case 0x2: {
                    v0 = v3.fragment;
                    if(v0 != 0) {
                        v0.mNextAnim = v3.popExitAnim;
                        FragmentManagerImpl v4 = this.mManager;
                        int v5_2 = FragmentManagerImpl.reverseTransit(this.mTransition);
                        v4.removeFragment(v0, v5_2, this.mTransitionStyle);
                    }

                    if(v3.removed == 0) {
                        goto label_32;
                    }

                    int v1 = 0;
                    while(v1 < v3.removed.size()) {
                        Object v2 = v3.removed.get(v1);
                        ((Fragment)v2).mNextAnim = v3.popEnterAnim;
                        this.mManager.addFragment(((Fragment)v2), false);
                        ++v1;
                    }

                }
                case 0x3: {
                    Fragment v0 = v3.fragment;
                    v0.mNextAnim = v3.popEnterAnim;
                    this.mManager.addFragment(v0, false);
                    break;
                }
                case 0x4: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.popEnterAnim;
                    v4 = this.mManager;
                    v5_2 = FragmentManagerImpl.reverseTransit(this.mTransition);
                    v4.showFragment(v0, v5_2, this.mTransitionStyle);
                    break;
                }
                case 0x5: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.popExitAnim;
                    v4 = this.mManager;
                    v5_2 = FragmentManagerImpl.reverseTransit(this.mTransition);
                    v4.hideFragment(v0, v5_2, this.mTransitionStyle);
                    break;
                }
                case 0x6: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.popEnterAnim;
                    v4 = this.mManager;
                    v5_2 = FragmentManagerImpl.reverseTransit(this.mTransition);
                    v4.attachFragment(v0, v5_2, this.mTransitionStyle);
                    break;
                }
                case 0x7: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.popEnterAnim;
                    v4 = this.mManager;
                    v5_2 = FragmentManagerImpl.reverseTransit(this.mTransition);
                    v4.detachFragment(v0, v5_2, this.mTransitionStyle);
                    break;
                }
                default: {
                    v5 = new StringBuilder();
                    v5 = v5.append("Unknown cmd: ");
                    v5 = v5.append(v3.cmd);
                    v5_1 = v5.toString();
                    throw new IllegalArgumentException(v5_1);
                }
            }

        label_32:
            v3 = v3.prev;
        }

        if(arg11) {
            v4 = this.mManager;
            v5_2 = this.mManager.mCurState;
            int v6 = FragmentManagerImpl.reverseTransit(this.mTransition);
            v4.moveToState(v5_2, v6, this.mTransitionStyle, true);
        }

        if(this.mIndex >= 0) {
            this.mManager.freeBackStackIndex(this.mIndex);
            this.mIndex = v9;
        }

    }

    public FragmentTransaction remove(Fragment arg3) {
        Op v0 = new Op();
        v0.cmd = 3;
        v0.fragment = arg3;
        this.addOp(v0);
        return this;
    }

    public FragmentTransaction replace(int arg2, Fragment arg3) {
        return this.replace(arg2, arg3, 0);
    }

    public FragmentTransaction replace(int arg3, Fragment arg4, String arg5) {
        if(arg3 == 0) {
            throw new IllegalArgumentException("Must use non-zero containerViewId");
        }

        this.doAddOp(arg3, arg4, arg5, 2);
        return this;
    }

    public void run() {
        if(FragmentManagerImpl.DEBUG) {
            StringBuilder v5 = new StringBuilder();
            v5 = v5.append("Run: ");
            v5 = v5.append(((Object)this));
            String v5_1 = v5.toString();
            Log.v("BackStackEntry", v5_1);
        }

        if(this.mAddToBackStack) {
            if(this.mIndex >= 0) {
                goto label_18;
            }

            goto label_15;
        }

    label_18:
        this.bumpBackStackNesting(1);
        Op v3 = this.mHead;
        while(v3 != 0) {
            switch(v3.cmd) {
                case 0x1: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.enterAnim;
                    this.mManager.addFragment(v0, false);
                    break;
                }
                case 0x2: {
                    v0 = v3.fragment;
                    if(this.mManager.mAdded != 0) {
                        int v1 = 0;
                        while(v1 < this.mManager.mAdded.size()) {
                            Object v2 = this.mManager.mAdded.get(v1);
                            if(FragmentManagerImpl.DEBUG != false) {
                                v5 = new StringBuilder();
                                v5 = v5.append("OP_REPLACE: adding=");
                                v5 = v5.append(((Object)v0));
                                v5 = v5.append(" old=");
                                v5 = v5.append(v2);
                                v5_1 = v5.toString();
                                Log.v("BackStackEntry", v5_1);
                            }

                            if(v0 == 0 || ((Fragment)v2).mContainerId == v0.mContainerId) {
                                if((((Fragment)v2)) == v0) {
                                    Object v0_1 = 0;
                                    v3.fragment = v0;
                                }
                                else {
                                    if(v3.removed == 0) {
                                        v3.removed = new ArrayList();
                                    }

                                    v3.removed.add(v2);
                                    ((Fragment)v2).mNextAnim = v3.exitAnim;
                                    if(this.mAddToBackStack != false) {
                                        ++((Fragment)v2).mBackStackNesting;
                                        if(FragmentManagerImpl.DEBUG != false) {
                                            v5 = new StringBuilder();
                                            v5 = v5.append("Bump nesting of ");
                                            v5 = v5.append(v2);
                                            v5 = v5.append(" to ");
                                            v5 = v5.append(((Fragment)v2).mBackStackNesting);
                                            v5_1 = v5.toString();
                                            Log.v("BackStackEntry", v5_1);
                                        }

                                    }

                                    this.mManager.removeFragment(((Fragment)v2), this.mTransition, this.mTransitionStyle);
                                }

                            }

                            ++v1;
                        }

                    }

                    if(v0 == 0) {
                        goto label_36;
                    }

                    v0.mNextAnim = v3.enterAnim;
                    this.mManager.addFragment(v0, false);
                    break;
                }
                case 0x3: {
                    Fragment v0 = v3.fragment;
                    v0.mNextAnim = v3.exitAnim;
                    this.mManager.removeFragment(v0, this.mTransition, this.mTransitionStyle);
                    break;
                }
                case 0x4: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.exitAnim;
                    this.mManager.hideFragment(v0, this.mTransition, this.mTransitionStyle);
                    break;
                }
                case 0x5: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.enterAnim;
                    this.mManager.showFragment(v0, this.mTransition, this.mTransitionStyle);
                    break;
                }
                case 0x6: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.exitAnim;
                    this.mManager.detachFragment(v0, this.mTransition, this.mTransitionStyle);
                    break;
                }
                case 0x7: {
                    v0 = v3.fragment;
                    v0.mNextAnim = v3.enterAnim;
                    this.mManager.attachFragment(v0, this.mTransition, this.mTransitionStyle);
                    break;
                }
                default: {
                    v5 = new StringBuilder();
                    v5 = v5.append("Unknown cmd: ");
                    v5 = v5.append(v3.cmd);
                    v5_1 = v5.toString();
                    throw new IllegalArgumentException(v5_1);
                }
            }

        label_36:
            v3 = v3.next;
        }

        this.mManager.moveToState(this.mManager.mCurState, this.mTransition, this.mTransitionStyle, true);
        if(this.mAddToBackStack) {
            this.mManager.addBackStackState(this);
        }

        return;
    label_15:
        throw new IllegalStateException("addToBackStack() called after commit()");
    }

    public FragmentTransaction setBreadCrumbShortTitle(int arg2) {
        this.mBreadCrumbShortTitleRes = arg2;
        this.mBreadCrumbShortTitleText = 0;
        return this;
    }

    public FragmentTransaction setBreadCrumbShortTitle(CharSequence arg2) {
        this.mBreadCrumbShortTitleRes = 0;
        this.mBreadCrumbShortTitleText = arg2;
        return this;
    }

    public FragmentTransaction setBreadCrumbTitle(int arg2) {
        this.mBreadCrumbTitleRes = arg2;
        this.mBreadCrumbTitleText = 0;
        return this;
    }

    public FragmentTransaction setBreadCrumbTitle(CharSequence arg2) {
        this.mBreadCrumbTitleRes = 0;
        this.mBreadCrumbTitleText = arg2;
        return this;
    }

    public FragmentTransaction setCustomAnimations(int arg2, int arg3) {
        return this.setCustomAnimations(arg2, arg3, 0, 0);
    }

    public FragmentTransaction setCustomAnimations(int arg1, int arg2, int arg3, int arg4) {
        this.mEnterAnim = arg1;
        this.mExitAnim = arg2;
        this.mPopEnterAnim = arg3;
        this.mPopExitAnim = arg4;
        return this;
    }

    public FragmentTransaction setTransition(int arg1) {
        this.mTransition = arg1;
        return this;
    }

    public FragmentTransaction setTransitionStyle(int arg1) {
        this.mTransitionStyle = arg1;
        return this;
    }

    public FragmentTransaction show(Fragment arg3) {
        Op v0 = new Op();
        v0.cmd = 5;
        v0.fragment = arg3;
        this.addOp(v0);
        return this;
    }
}
// Decompiled by Jad v1.5.8g

package android.support.v4.app;

import android.util.Log;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;

// Referenced classes of package android.support.v4.app:
//            FragmentTransaction, Fragment, FragmentManagerImpl, FragmentActivity

final class BackStackRecord extends FragmentTransaction
    implements FragmentManager.BackStackEntry, Runnable
{
    /* member class not found */
    class Op {}


    public BackStackRecord(FragmentManagerImpl fragmentmanagerimpl)
    {
        mAllowAddToBackStack = true;
        mManager = fragmentmanagerimpl;
    }

    private void doAddOp(int i, Fragment fragment, String s, int j)
    {
        fragment.mFragmentManager = mManager;
        if(s != null)
        {
            if(fragment.mTag != null && !s.equals(fragment.mTag))
                throw new IllegalStateException((new StringBuilder()).append("Can't change tag of fragment ").append(fragment).append(": was ").append(fragment.mTag).append(" now ").append(s).toString());
            fragment.mTag = s;
        }
        if(i != 0)
        {
            if(fragment.mFragmentId != 0 && fragment.mFragmentId != i)
                throw new IllegalStateException((new StringBuilder()).append("Can't change container ID of fragment ").append(fragment).append(": was ").append(fragment.mFragmentId).append(" now ").append(i).toString());
            fragment.mFragmentId = i;
            fragment.mContainerId = i;
        }
        Op op = new Op();
        op.cmd = j;
        op.fragment = fragment;
        addOp(op);
    }

    public FragmentTransaction add(int i, Fragment fragment)
    {
        doAddOp(i, fragment, null, 1);
        return this;
    }

    public FragmentTransaction add(int i, Fragment fragment, String s)
    {
        doAddOp(i, fragment, s, 1);
        return this;
    }

    public FragmentTransaction add(Fragment fragment, String s)
    {
        doAddOp(0, fragment, s, 1);
        return this;
    }

    void addOp(Op op)
    {
        if(mHead == null)
        {
            mTail = op;
            mHead = op;
        } else
        {
            op.prev = mTail;
            mTail.next = op;
            mTail = op;
        }
        op.enterAnim = mEnterAnim;
        op.exitAnim = mExitAnim;
        op.popEnterAnim = mPopEnterAnim;
        op.popExitAnim = mPopExitAnim;
        mNumOp = 1 + mNumOp;
    }

    public FragmentTransaction addToBackStack(String s)
    {
        if(!mAllowAddToBackStack)
        {
            throw new IllegalStateException("This FragmentTransaction is not allowed to be added to the back stack.");
        } else
        {
            mAddToBackStack = true;
            mName = s;
            return this;
        }
    }

    public FragmentTransaction attach(Fragment fragment)
    {
        Op op = new Op();
        op.cmd = 7;
        op.fragment = fragment;
        addOp(op);
        return this;
    }

    void bumpBackStackNesting(int i)
    {
        if(mAddToBackStack)
        {
            if(FragmentManagerImpl.DEBUG)
                Log.v("BackStackEntry", (new StringBuilder()).append("Bump nesting in ").append(this).append(" by ").append(i).toString());
            Op op = mHead;
            while(op != null) 
            {
                if(op.fragment != null)
                {
                    Fragment fragment1 = op.fragment;
                    fragment1.mBackStackNesting = i + fragment1.mBackStackNesting;
                    if(FragmentManagerImpl.DEBUG)
                        Log.v("BackStackEntry", (new StringBuilder()).append("Bump nesting of ").append(op.fragment).append(" to ").append(op.fragment.mBackStackNesting).toString());
                }
                if(op.removed != null)
                {
                    for(int j = -1 + op.removed.size(); j >= 0; j--)
                    {
                        Fragment fragment = (Fragment)op.removed.get(j);
                        fragment.mBackStackNesting = i + fragment.mBackStackNesting;
                        if(FragmentManagerImpl.DEBUG)
                            Log.v("BackStackEntry", (new StringBuilder()).append("Bump nesting of ").append(fragment).append(" to ").append(fragment.mBackStackNesting).toString());
                    }

                }
                op = op.next;
            }
        }
    }

    public int commit()
    {
        return commitInternal(false);
    }

    public int commitAllowingStateLoss()
    {
        return commitInternal(true);
    }

    int commitInternal(boolean flag)
    {
        if(mCommitted)
            throw new IllegalStateException("commit already called");
        if(FragmentManagerImpl.DEBUG)
            Log.v("BackStackEntry", (new StringBuilder()).append("Commit: ").append(this).toString());
        mCommitted = true;
        if(mAddToBackStack)
            mIndex = mManager.allocBackStackIndex(this);
        else
            mIndex = -1;
        mManager.enqueueAction(this, flag);
        return mIndex;
    }

    public FragmentTransaction detach(Fragment fragment)
    {
        Op op = new Op();
        op.cmd = 6;
        op.fragment = fragment;
        addOp(op);
        return this;
    }

    public FragmentTransaction disallowAddToBackStack()
    {
        if(mAddToBackStack)
        {
            throw new IllegalStateException("This transaction is already being added to the back stack");
        } else
        {
            mAllowAddToBackStack = false;
            return this;
        }
    }

    public void dump(String s, FileDescriptor filedescriptor, PrintWriter printwriter, String as[])
    {
        printwriter.print(s);
        printwriter.print("mName=");
        printwriter.print(mName);
        printwriter.print(" mIndex=");
        printwriter.print(mIndex);
        printwriter.print(" mCommitted=");
        printwriter.println(mCommitted);
        if(mTransition != 0)
        {
            printwriter.print(s);
            printwriter.print("mTransition=#");
            printwriter.print(Integer.toHexString(mTransition));
            printwriter.print(" mTransitionStyle=#");
            printwriter.println(Integer.toHexString(mTransitionStyle));
        }
        if(mEnterAnim != 0 || mExitAnim != 0)
        {
            printwriter.print(s);
            printwriter.print("mEnterAnim=#");
            printwriter.print(Integer.toHexString(mEnterAnim));
            printwriter.print(" mExitAnim=#");
            printwriter.println(Integer.toHexString(mExitAnim));
        }
        if(mPopEnterAnim != 0 || mPopExitAnim != 0)
        {
            printwriter.print(s);
            printwriter.print("mPopEnterAnim=#");
            printwriter.print(Integer.toHexString(mPopEnterAnim));
            printwriter.print(" mPopExitAnim=#");
            printwriter.println(Integer.toHexString(mPopExitAnim));
        }
        if(mBreadCrumbTitleRes != 0 || mBreadCrumbTitleText != null)
        {
            printwriter.print(s);
            printwriter.print("mBreadCrumbTitleRes=#");
            printwriter.print(Integer.toHexString(mBreadCrumbTitleRes));
            printwriter.print(" mBreadCrumbTitleText=");
            printwriter.println(mBreadCrumbTitleText);
        }
        if(mBreadCrumbShortTitleRes != 0 || mBreadCrumbShortTitleText != null)
        {
            printwriter.print(s);
            printwriter.print("mBreadCrumbShortTitleRes=#");
            printwriter.print(Integer.toHexString(mBreadCrumbShortTitleRes));
            printwriter.print(" mBreadCrumbShortTitleText=");
            printwriter.println(mBreadCrumbShortTitleText);
        }
        if(mHead != null)
        {
            printwriter.print(s);
            printwriter.println("Operations:");
            String s1 = (new StringBuilder()).append(s).append("    ").toString();
label0:
            for(Op op = mHead; op != null; op = op.next)
            {
                printwriter.print(s);
                printwriter.print("  Op #");
                printwriter.print(0);
                printwriter.println(":");
                printwriter.print(s1);
                printwriter.print("cmd=");
                printwriter.print(op.cmd);
                printwriter.print(" fragment=");
                printwriter.println(op.fragment);
                if(op.enterAnim != 0 || op.exitAnim != 0)
                {
                    printwriter.print(s);
                    printwriter.print("enterAnim=#");
                    printwriter.print(Integer.toHexString(op.enterAnim));
                    printwriter.print(" exitAnim=#");
                    printwriter.println(Integer.toHexString(op.exitAnim));
                }
                if(op.popEnterAnim != 0 || op.popExitAnim != 0)
                {
                    printwriter.print(s);
                    printwriter.print("popEnterAnim=#");
                    printwriter.print(Integer.toHexString(op.popEnterAnim));
                    printwriter.print(" popExitAnim=#");
                    printwriter.println(Integer.toHexString(op.popExitAnim));
                }
                if(op.removed == null || op.removed.size() <= 0)
                    continue;
                int i = 0;
                do
                {
                    if(i >= op.removed.size())
                        continue label0;
                    printwriter.print(s1);
                    if(op.removed.size() == 1)
                    {
                        printwriter.print("Removed: ");
                    } else
                    {
                        printwriter.println("Removed:");
                        printwriter.print(s1);
                        printwriter.print("  #");
                        printwriter.print(0);
                        printwriter.print(": ");
                    }
                    printwriter.println(op.removed.get(i));
                    i++;
                } while(true);
            }

        }
    }

    public CharSequence getBreadCrumbShortTitle()
    {
        CharSequence charsequence;
        if(mBreadCrumbShortTitleRes != 0)
            charsequence = mManager.mActivity.getText(mBreadCrumbShortTitleRes);
        else
            charsequence = mBreadCrumbShortTitleText;
        return charsequence;
    }

    public int getBreadCrumbShortTitleRes()
    {
        return mBreadCrumbShortTitleRes;
    }

    public CharSequence getBreadCrumbTitle()
    {
        CharSequence charsequence;
        if(mBreadCrumbTitleRes != 0)
            charsequence = mManager.mActivity.getText(mBreadCrumbTitleRes);
        else
            charsequence = mBreadCrumbTitleText;
        return charsequence;
    }

    public int getBreadCrumbTitleRes()
    {
        return mBreadCrumbTitleRes;
    }

    public int getId()
    {
        return mIndex;
    }

    public String getName()
    {
        return mName;
    }

    public int getTransition()
    {
        return mTransition;
    }

    public int getTransitionStyle()
    {
        return mTransitionStyle;
    }

    public FragmentTransaction hide(Fragment fragment)
    {
        Op op = new Op();
        op.cmd = 4;
        op.fragment = fragment;
        addOp(op);
        return this;
    }

    public boolean isAddToBackStackAllowed()
    {
        return mAllowAddToBackStack;
    }

    public boolean isEmpty()
    {
        boolean flag;
        if(mNumOp == 0)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public void popFromBackStack(boolean flag)
    {
        Op op;
        if(FragmentManagerImpl.DEBUG)
            Log.v("BackStackEntry", (new StringBuilder()).append("popFromBackStack: ").append(this).toString());
        bumpBackStackNesting(-1);
        op = mTail;
_L10:
        if(op == null)
            break MISSING_BLOCK_LABEL_444;
        op.cmd;
        JVM INSTR tableswitch 1 7: default 92
    //                   1 123
    //                   2 166
    //                   3 267
    //                   4 295
    //                   5 333
    //                   6 371
    //                   7 409;
           goto _L1 _L2 _L3 _L4 _L5 _L6 _L7 _L8
_L8:
        break MISSING_BLOCK_LABEL_409;
_L3:
        break; /* Loop/switch isn't completed */
_L1:
        throw new IllegalArgumentException((new StringBuilder()).append("Unknown cmd: ").append(op.cmd).toString());
_L2:
        Fragment fragment7 = op.fragment;
        fragment7.mNextAnim = op.popExitAnim;
        mManager.removeFragment(fragment7, FragmentManagerImpl.reverseTransit(mTransition), mTransitionStyle);
_L11:
        op = op.prev;
        if(true) goto _L10; else goto _L9
_L9:
        Fragment fragment5 = op.fragment;
        if(fragment5 != null)
        {
            fragment5.mNextAnim = op.popExitAnim;
            mManager.removeFragment(fragment5, FragmentManagerImpl.reverseTransit(mTransition), mTransitionStyle);
        }
        if(op.removed != null)
        {
            int i = 0;
            while(i < op.removed.size()) 
            {
                Fragment fragment6 = (Fragment)op.removed.get(i);
                fragment6.mNextAnim = op.popEnterAnim;
                mManager.addFragment(fragment6, false);
                i++;
            }
        }
          goto _L11
_L4:
        Fragment fragment4 = op.fragment;
        fragment4.mNextAnim = op.popEnterAnim;
        mManager.addFragment(fragment4, false);
          goto _L11
_L5:
        Fragment fragment3 = op.fragment;
        fragment3.mNextAnim = op.popEnterAnim;
        mManager.showFragment(fragment3, FragmentManagerImpl.reverseTransit(mTransition), mTransitionStyle);
          goto _L11
_L6:
        Fragment fragment2 = op.fragment;
        fragment2.mNextAnim = op.popExitAnim;
        mManager.hideFragment(fragment2, FragmentManagerImpl.reverseTransit(mTransition), mTransitionStyle);
          goto _L11
_L7:
        Fragment fragment1 = op.fragment;
        fragment1.mNextAnim = op.popEnterAnim;
        mManager.attachFragment(fragment1, FragmentManagerImpl.reverseTransit(mTransition), mTransitionStyle);
          goto _L11
        Fragment fragment = op.fragment;
        fragment.mNextAnim = op.popEnterAnim;
        mManager.detachFragment(fragment, FragmentManagerImpl.reverseTransit(mTransition), mTransitionStyle);
          goto _L11
        if(flag)
            mManager.moveToState(mManager.mCurState, FragmentManagerImpl.reverseTransit(mTransition), mTransitionStyle, true);
        if(mIndex >= 0)
        {
            mManager.freeBackStackIndex(mIndex);
            mIndex = -1;
        }
        return;
    }

    public FragmentTransaction remove(Fragment fragment)
    {
        Op op = new Op();
        op.cmd = 3;
        op.fragment = fragment;
        addOp(op);
        return this;
    }

    public FragmentTransaction replace(int i, Fragment fragment)
    {
        return replace(i, fragment, null);
    }

    public FragmentTransaction replace(int i, Fragment fragment, String s)
    {
        if(i == 0)
        {
            throw new IllegalArgumentException("Must use non-zero containerViewId");
        } else
        {
            doAddOp(i, fragment, s, 2);
            return this;
        }
    }

    public void run()
    {
        Op op;
        if(FragmentManagerImpl.DEBUG)
            Log.v("BackStackEntry", (new StringBuilder()).append("Run: ").append(this).toString());
        if(mAddToBackStack && mIndex < 0)
            throw new IllegalStateException("addToBackStack() called after commit()");
        bumpBackStackNesting(1);
        op = mHead;
_L10:
        if(op == null)
            break MISSING_BLOCK_LABEL_631;
        op.cmd;
        JVM INSTR tableswitch 1 7: default 116
    //                   1 147
    //                   2 180
    //                   3 462
    //                   4 497
    //                   5 532
    //                   6 567
    //                   7 599;
           goto _L1 _L2 _L3 _L4 _L5 _L6 _L7 _L8
_L8:
        break MISSING_BLOCK_LABEL_599;
_L3:
        break; /* Loop/switch isn't completed */
_L1:
        throw new IllegalArgumentException((new StringBuilder()).append("Unknown cmd: ").append(op.cmd).toString());
_L2:
        Fragment fragment7 = op.fragment;
        fragment7.mNextAnim = op.enterAnim;
        mManager.addFragment(fragment7, false);
_L11:
        op = op.next;
        if(true) goto _L10; else goto _L9
_L9:
        Fragment fragment5 = op.fragment;
        if(mManager.mAdded != null)
        {
            int i = 0;
            while(i < mManager.mAdded.size()) 
            {
                Fragment fragment6 = (Fragment)mManager.mAdded.get(i);
                if(FragmentManagerImpl.DEBUG)
                    Log.v("BackStackEntry", (new StringBuilder()).append("OP_REPLACE: adding=").append(fragment5).append(" old=").append(fragment6).toString());
                if(fragment5 == null || fragment6.mContainerId == fragment5.mContainerId)
                    if(fragment6 == fragment5)
                    {
                        fragment5 = null;
                        op.fragment = null;
                    } else
                    {
                        if(op.removed == null)
                            op.removed = new ArrayList();
                        op.removed.add(fragment6);
                        fragment6.mNextAnim = op.exitAnim;
                        if(mAddToBackStack)
                        {
                            fragment6.mBackStackNesting = 1 + fragment6.mBackStackNesting;
                            if(FragmentManagerImpl.DEBUG)
                                Log.v("BackStackEntry", (new StringBuilder()).append("Bump nesting of ").append(fragment6).append(" to ").append(fragment6.mBackStackNesting).toString());
                        }
                        mManager.removeFragment(fragment6, mTransition, mTransitionStyle);
                    }
                i++;
            }
        }
        if(fragment5 != null)
        {
            fragment5.mNextAnim = op.enterAnim;
            mManager.addFragment(fragment5, false);
        }
          goto _L11
_L4:
        Fragment fragment4 = op.fragment;
        fragment4.mNextAnim = op.exitAnim;
        mManager.removeFragment(fragment4, mTransition, mTransitionStyle);
          goto _L11
_L5:
        Fragment fragment3 = op.fragment;
        fragment3.mNextAnim = op.exitAnim;
        mManager.hideFragment(fragment3, mTransition, mTransitionStyle);
          goto _L11
_L6:
        Fragment fragment2 = op.fragment;
        fragment2.mNextAnim = op.enterAnim;
        mManager.showFragment(fragment2, mTransition, mTransitionStyle);
          goto _L11
_L7:
        Fragment fragment1 = op.fragment;
        fragment1.mNextAnim = op.exitAnim;
        mManager.detachFragment(fragment1, mTransition, mTransitionStyle);
          goto _L11
        Fragment fragment = op.fragment;
        fragment.mNextAnim = op.enterAnim;
        mManager.attachFragment(fragment, mTransition, mTransitionStyle);
          goto _L11
        mManager.moveToState(mManager.mCurState, mTransition, mTransitionStyle, true);
        if(mAddToBackStack)
            mManager.addBackStackState(this);
        return;
    }

    public FragmentTransaction setBreadCrumbShortTitle(int i)
    {
        mBreadCrumbShortTitleRes = i;
        mBreadCrumbShortTitleText = null;
        return this;
    }

    public FragmentTransaction setBreadCrumbShortTitle(CharSequence charsequence)
    {
        mBreadCrumbShortTitleRes = 0;
        mBreadCrumbShortTitleText = charsequence;
        return this;
    }

    public FragmentTransaction setBreadCrumbTitle(int i)
    {
        mBreadCrumbTitleRes = i;
        mBreadCrumbTitleText = null;
        return this;
    }

    public FragmentTransaction setBreadCrumbTitle(CharSequence charsequence)
    {
        mBreadCrumbTitleRes = 0;
        mBreadCrumbTitleText = charsequence;
        return this;
    }

    public FragmentTransaction setCustomAnimations(int i, int j)
    {
        return setCustomAnimations(i, j, 0, 0);
    }

    public FragmentTransaction setCustomAnimations(int i, int j, int k, int l)
    {
        mEnterAnim = i;
        mExitAnim = j;
        mPopEnterAnim = k;
        mPopExitAnim = l;
        return this;
    }

    public FragmentTransaction setTransition(int i)
    {
        mTransition = i;
        return this;
    }

    public FragmentTransaction setTransitionStyle(int i)
    {
        mTransitionStyle = i;
        return this;
    }

    public FragmentTransaction show(Fragment fragment)
    {
        Op op = new Op();
        op.cmd = 5;
        op.fragment = fragment;
        addOp(op);
        return this;
    }

    static final int OP_ADD = 1;
    static final int OP_ATTACH = 7;
    static final int OP_DETACH = 6;
    static final int OP_HIDE = 4;
    static final int OP_NULL = 0;
    static final int OP_REMOVE = 3;
    static final int OP_REPLACE = 2;
    static final int OP_SHOW = 5;
    static final String TAG = "BackStackEntry";
    boolean mAddToBackStack;
    boolean mAllowAddToBackStack;
    int mBreadCrumbShortTitleRes;
    CharSequence mBreadCrumbShortTitleText;
    int mBreadCrumbTitleRes;
    CharSequence mBreadCrumbTitleText;
    boolean mCommitted;
    int mEnterAnim;
    int mExitAnim;
    Op mHead;
    int mIndex;
    final FragmentManagerImpl mManager;
    String mName;
    int mNumOp;
    int mPopEnterAnim;
    int mPopExitAnim;
    Op mTail;
    int mTransition;
    int mTransitionStyle;
}