package com.bytedance.ies.nle.editor_jni;

import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;

public class NLEBranch {
    public transient boolean LIZ;
    public transient long LIZIZ;

    static {
        Covode.recordClassIndex(29775);
    }

    public void finalize() {
        LIZIZ();
    }

    public NLEBranch() {
        this(NLEEditorJniJNI.new_NLEBranch());
        MethodCollector.i(18378);
        MethodCollector.o(18378);
    }

    public final NLECommit LIZ() {
        MethodCollector.i(18377);
        long NLEBranch_getHead = NLEEditorJniJNI.NLEBranch_getHead(this.LIZIZ, this);
        if (NLEBranch_getHead == 0) {
            MethodCollector.o(18377);
            return null;
        }
        NLECommit nLECommit = new NLECommit(NLEBranch_getHead);
        MethodCollector.o(18377);
        return nLECommit;
    }

    private synchronized void LIZIZ() {
        MethodCollector.i(18375);
        long j = this.LIZIZ;
        if (j != 0) {
            if (this.LIZ) {
                this.LIZ = false;
                NLEEditorJniJNI.delete_NLEBranch(j);
            }
            this.LIZIZ = 0;
        }
        MethodCollector.o(18375);
    }

    public NLEBranch(long j) {
        this.LIZ = true;
        this.LIZIZ = j;
    }
}
