package j0.l.a; import c.q.a.k.a; import rx.Subscriber; import rx.functions.Func2; /* compiled from: OperatorTakeWhile */ public class j2 extends Subscriber { public int i; public boolean j; public final /* synthetic */ Subscriber k; public final /* synthetic */ i2 l; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public j2(i2 i2Var, Subscriber subscriber, boolean z2, Subscriber subscriber2) { super(subscriber, z2); this.l = i2Var; this.k = subscriber2; } @Override // j0.g public void onCompleted() { if (!this.j) { this.k.onCompleted(); } } @Override // j0.g public void onError(Throwable th) { if (!this.j) { this.k.onError(th); } } @Override // j0.g public void onNext(T t) { try { Func2 func2 = this.l.i; int i = this.i; this.i = i + 1; if (func2.call(t, Integer.valueOf(i)).booleanValue()) { this.k.onNext(t); return; } this.j = true; this.k.onCompleted(); unsubscribe(); } catch (Throwable th) { this.j = true; a.b0(th, this.k, t); unsubscribe(); } } }