package androidx.concurrent.futures;

/* JADX INFO: loaded from: classes.dex */
public final class h {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public Object f991a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public k f992b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public l f993c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f994d;

    public final void a(Object obj) {
        this.f994d = true;
        k kVar = this.f992b;
        if (kVar == null || !kVar.f997b.set(obj)) {
            return;
        }
        this.f991a = null;
        this.f992b = null;
        this.f993c = null;
    }

    public final void b(Throwable th) {
        this.f994d = true;
        k kVar = this.f992b;
        if (kVar == null || !kVar.f997b.h(th)) {
            return;
        }
        this.f991a = null;
        this.f992b = null;
        this.f993c = null;
    }

    public final void finalize() {
        l lVar;
        k kVar = this.f992b;
        if (kVar != null) {
            j jVar = kVar.f997b;
            if (!jVar.isDone()) {
                jVar.h(new CallbackToFutureAdapter$FutureGarbageCollectedException("The completer object was garbage collected - this future would otherwise never complete. The tag was: " + this.f991a));
            }
        }
        if (this.f994d || (lVar = this.f993c) == null) {
            return;
        }
        lVar.set(null);
    }
}
