what-the-bank/sources/o/C13266fVj.java

160 lines
4.9 KiB
Java

package o;
import java.util.Collection;
import java.util.Objects;
/* renamed from: o.fVj, reason: case insensitive filesystem */
/* loaded from: classes6.dex */
public final class C13266fVj<T, U extends Collection<? super T>, B> extends fUX<T, U> {
private InterfaceC13169fSq<B> b;
private InterfaceC13189fTc<U> e;
public C13266fVj(InterfaceC13169fSq<T> interfaceC13169fSq, InterfaceC13169fSq<B> interfaceC13169fSq2, InterfaceC13189fTc<U> interfaceC13189fTc) {
super(interfaceC13169fSq);
this.b = interfaceC13169fSq2;
this.e = interfaceC13189fTc;
}
@Override // o.AbstractC13163fSk
public final void subscribeActual(InterfaceC13174fSv<? super U> interfaceC13174fSv) {
this.c.subscribe(new LWm(new C13406fZi(interfaceC13174fSv), this.e, this.b));
}
/* renamed from: o.fVj$LWm */
/* loaded from: classes6.dex */
static final class LWm<T, U extends Collection<? super T>, B> extends fTV<T, U, U> implements fSJ {
private fSJ f;
private InterfaceC13189fTc<U> g;
private InterfaceC13169fSq<B> h;
private U i;
private fSJ j;
@Override // o.fTV, o.InterfaceC13361fYY
public final /* synthetic */ void a(InterfaceC13174fSv interfaceC13174fSv, Object obj) {
this.a.onNext((Collection) obj);
}
LWm(InterfaceC13174fSv<? super U> interfaceC13174fSv, InterfaceC13189fTc<U> interfaceC13189fTc, InterfaceC13169fSq<B> interfaceC13169fSq) {
super(interfaceC13174fSv, new C13378fYq());
this.g = interfaceC13189fTc;
this.h = interfaceC13169fSq;
}
@Override // o.InterfaceC13174fSv
public final void onSubscribe(fSJ fsj) {
if (EnumC13192fTf.d(this.j, fsj)) {
this.j = fsj;
try {
this.i = (U) Objects.requireNonNull(this.g.d(), "The buffer supplied is null");
RVV rvv = new RVV(this);
this.f = rvv;
this.a.onSubscribe(this);
if (this.b) {
return;
}
this.h.subscribe(rvv);
} catch (Throwable th) {
C13147fSI.c(th);
this.b = true;
fsj.dispose();
EnumC13195fTi.a(th, this.a);
}
}
}
@Override // o.InterfaceC13174fSv
public final void onNext(T t) {
synchronized (this) {
U u = this.i;
if (u == null) {
return;
}
u.add(t);
}
}
@Override // o.InterfaceC13174fSv
public final void onError(Throwable th) {
dispose();
this.a.onError(th);
}
@Override // o.InterfaceC13174fSv
public final void onComplete() {
synchronized (this) {
U u = this.i;
if (u == null) {
return;
}
this.i = null;
this.d.b(u);
this.e = true;
if (this.c.getAndIncrement() == 0) {
C13360fYU.e(this.d, this.a, false, this, this);
}
}
}
@Override // o.fSJ
public final void dispose() {
if (this.b) {
return;
}
this.b = true;
this.f.dispose();
this.j.dispose();
if (this.c.getAndIncrement() == 0) {
this.d.e();
}
}
@Override // o.fSJ
public final boolean isDisposed() {
return this.b;
}
final void c() {
try {
U u = (U) Objects.requireNonNull(this.g.d(), "The buffer supplied is null");
synchronized (this) {
U u2 = this.i;
if (u2 == null) {
return;
}
this.i = u;
a((LWm<T, U, B>) u2, (fSJ) this);
}
} catch (Throwable th) {
C13147fSI.c(th);
dispose();
this.a.onError(th);
}
}
}
/* renamed from: o.fVj$RVV */
/* loaded from: classes6.dex */
static final class RVV<T, U extends Collection<? super T>, B> extends AbstractC13403fZf<B> {
private LWm<T, U, B> b;
RVV(LWm<T, U, B> lWm) {
this.b = lWm;
}
@Override // o.InterfaceC13174fSv
public final void onNext(B b) {
this.b.c();
}
@Override // o.InterfaceC13174fSv
public final void onError(Throwable th) {
this.b.onError(th);
}
@Override // o.InterfaceC13174fSv
public final void onComplete() {
this.b.onComplete();
}
}
}