what-the-bank/sources/com/google/common/util/concurrent/AbstractFuture.java

1703 lines
61 KiB
Java

package com.google.common.util.concurrent;
import android.text.AndroidCharacter;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewConfiguration;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.internal.InternalFutureFailureAccess;
import com.google.common.util.concurrent.internal.InternalFutures;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Locale;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import java.util.concurrent.locks.LockSupport;
import java.util.logging.Level;
import java.util.logging.Logger;
import o.jTb;
import o.xzZ;
import sun.misc.Unsafe;
/* loaded from: classes2.dex */
public abstract class AbstractFuture<V> extends InternalFutureFailureAccess implements ListenableFuture<V> {
private static final byte[] $$a = {55, -23, -33, -19};
private static final int $$b = 83;
private static int $10 = 0;
private static int $11 = 1;
private static final AtomicHelper ATOMIC_HELPER;
private static final boolean GENERATE_CANCELLATION_CAUSES;
private static final Object NULL;
private static final long SPIN_THRESHOLD_NANOS = 1000;
private static char a;
private static int b;
private static char c;
private static char d;
private static char e;
private static int g;
private static final Logger log;
volatile Listener listeners;
volatile Object value;
volatile Waiter waiters;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public interface Trusted<V> extends ListenableFuture<V> {
}
/* JADX WARN: Removed duplicated region for block: B:10:0x0027 */
/* JADX WARN: Removed duplicated region for block: B:7:0x001f */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0027 -> B:4:0x002c). Please report as a decompilation issue!!! */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static void h(short r7, byte r8, short r9, java.lang.Object[] r10) {
/*
byte[] r0 = com.google.common.util.concurrent.AbstractFuture.$$a
int r8 = r8 * 3
int r8 = r8 + 4
int r7 = 67 - r7
int r9 = r9 * 2
int r9 = r9 + 1
byte[] r1 = new byte[r9]
r2 = 0
if (r0 != 0) goto L14
r3 = r8
r4 = r2
goto L2c
L14:
r3 = r2
r6 = r8
r8 = r7
r7 = r6
L18:
int r4 = r3 + 1
byte r5 = (byte) r8
r1[r3] = r5
if (r4 != r9) goto L27
java.lang.String r7 = new java.lang.String
r7.<init>(r1, r2)
r10[r2] = r7
return
L27:
r3 = r0[r7]
r6 = r3
r3 = r7
r7 = r6
L2c:
int r8 = r8 + r7
int r7 = r3 + 1
r3 = r4
goto L18
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.common.util.concurrent.AbstractFuture.h(short, byte, short, java.lang.Object[]):void");
}
static /* synthetic */ Object access$400(AbstractFuture abstractFuture) {
int i = 2 % 2;
int i2 = g + 7;
b = i2 % 128;
int i3 = i2 % 2;
Object obj = abstractFuture.value;
if (i3 != 0) {
Object obj2 = null;
obj2.hashCode();
throw null;
}
int i4 = g + 29;
b = i4 % 128;
if (i4 % 2 != 0) {
int i5 = 72 / 0;
}
return obj;
}
static /* synthetic */ Object access$402(AbstractFuture abstractFuture, Object obj) {
int i = 2 % 2;
int i2 = b + 111;
g = i2 % 128;
int i3 = i2 % 2;
abstractFuture.value = obj;
if (i3 == 0) {
throw null;
}
int i4 = g + 11;
b = i4 % 128;
int i5 = i4 % 2;
return obj;
}
static /* synthetic */ Object access$500(ListenableFuture listenableFuture) {
int i = 2 % 2;
int i2 = b + 17;
g = i2 % 128;
int i3 = i2 % 2;
Object futureValue = getFutureValue(listenableFuture);
if (i3 == 0) {
int i4 = 78 / 0;
}
return futureValue;
}
static /* synthetic */ void access$600(AbstractFuture abstractFuture) {
int i = 2 % 2;
int i2 = b + 123;
g = i2 % 128;
int i3 = i2 % 2;
complete(abstractFuture);
int i4 = g + 15;
b = i4 % 128;
int i5 = i4 % 2;
}
static /* synthetic */ Waiter access$800(AbstractFuture abstractFuture) {
int i = 2 % 2;
int i2 = g + 49;
b = i2 % 128;
int i3 = i2 % 2;
Waiter waiter = abstractFuture.waiters;
int i4 = b + 29;
g = i4 % 128;
if (i4 % 2 != 0) {
return waiter;
}
throw null;
}
static /* synthetic */ Waiter access$802(AbstractFuture abstractFuture, Waiter waiter) {
int i = 2 % 2;
int i2 = g + 55;
b = i2 % 128;
int i3 = i2 % 2;
abstractFuture.waiters = waiter;
int i4 = b + 1;
g = i4 % 128;
if (i4 % 2 != 0) {
return waiter;
}
throw null;
}
static /* synthetic */ Listener access$900(AbstractFuture abstractFuture) {
int i = 2 % 2;
int i2 = b + 51;
g = i2 % 128;
int i3 = i2 % 2;
Listener listener = abstractFuture.listeners;
int i4 = b + 41;
g = i4 % 128;
int i5 = i4 % 2;
return listener;
}
static /* synthetic */ Listener access$902(AbstractFuture abstractFuture, Listener listener) {
int i = 2 % 2;
int i2 = b + 9;
g = i2 % 128;
int i3 = i2 % 2;
abstractFuture.listeners = listener;
int i4 = g + 77;
b = i4 % 128;
if (i4 % 2 != 0) {
int i5 = 58 / 0;
}
return listener;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v1, types: [java.lang.Throwable] */
/* JADX WARN: Type inference failed for: r0v6, types: [java.util.logging.Logger] */
/* JADX WARN: Type inference failed for: r11v0, types: [com.google.common.util.concurrent.AbstractFuture$SafeAtomicHelper] */
/* JADX WARN: Type inference failed for: r1v10, types: [java.lang.Throwable] */
/* JADX WARN: Type inference failed for: r1v13 */
/* JADX WARN: Type inference failed for: r1v8, types: [com.google.common.util.concurrent.AbstractFuture$1] */
/* JADX WARN: Type inference failed for: r1v9 */
/* JADX WARN: Type inference failed for: r4v3, types: [com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper] */
static {
SynchronizedHelper synchronizedHelper;
boolean z = false;
b = 0;
g = 1;
e();
try {
z = Boolean.parseBoolean(System.getProperty("guava.concurrent.generate_cancellation_cause", "false"));
int i = g + 87;
b = i % 128;
int i2 = i % 2;
int i3 = 2 % 2;
} catch (SecurityException unused) {
}
GENERATE_CANCELLATION_CAUSES = z;
log = Logger.getLogger(AbstractFuture.class.getName());
?? r1 = 0;
r1 = 0;
try {
synchronizedHelper = new UnsafeAtomicHelper();
th = null;
} catch (Throwable th) {
th = th;
try {
synchronizedHelper = new SafeAtomicHelper(AtomicReferenceFieldUpdater.newUpdater(Waiter.class, Thread.class, "thread"), AtomicReferenceFieldUpdater.newUpdater(Waiter.class, Waiter.class, "next"), AtomicReferenceFieldUpdater.newUpdater(AbstractFuture.class, Waiter.class, "waiters"), AtomicReferenceFieldUpdater.newUpdater(AbstractFuture.class, Listener.class, "listeners"), AtomicReferenceFieldUpdater.newUpdater(AbstractFuture.class, Object.class, AppMeasurementSdk.ConditionalUserProperty.VALUE));
} catch (Throwable th2) {
synchronizedHelper = new SynchronizedHelper();
r1 = th2;
}
}
ATOMIC_HELPER = synchronizedHelper;
if (r1 != 0) {
?? r0 = log;
r0.log(Level.SEVERE, "UnsafeAtomicHelper is broken!", th);
r0.log(Level.SEVERE, "SafeAtomicHelper is broken!", r1);
int i4 = 2 % 2;
}
NULL = new Object();
int i5 = b + 1;
g = i5 % 128;
int i6 = i5 % 2;
}
/* loaded from: classes2.dex */
public static abstract class TrustedFuture<V> extends AbstractFuture<V> implements Trusted<V> {
@Override // com.google.common.util.concurrent.AbstractFuture, java.util.concurrent.Future
public final V get() throws InterruptedException, ExecutionException {
return (V) super.get();
}
@Override // com.google.common.util.concurrent.AbstractFuture, java.util.concurrent.Future
public final V get(long j, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException {
return (V) super.get(j, timeUnit);
}
@Override // com.google.common.util.concurrent.AbstractFuture, java.util.concurrent.Future
public final boolean isDone() {
return super.isDone();
}
@Override // com.google.common.util.concurrent.AbstractFuture, java.util.concurrent.Future
public final boolean isCancelled() {
return super.isCancelled();
}
@Override // com.google.common.util.concurrent.AbstractFuture, com.google.common.util.concurrent.ListenableFuture
public final void addListener(Runnable runnable, Executor executor) {
super.addListener(runnable, executor);
}
@Override // com.google.common.util.concurrent.AbstractFuture, java.util.concurrent.Future
public final boolean cancel(boolean z) {
return super.cancel(z);
}
}
/* JADX WARN: Multi-variable type inference failed */
private static void f(char[] cArr, int i, Object[] objArr) {
int i2 = 2 % 2;
jTb jtb = new jTb();
char[] cArr2 = new char[cArr.length];
int i3 = 0;
jtb.b = 0;
char[] cArr3 = new char[2];
while (jtb.b < cArr.length) {
cArr3[i3] = cArr[jtb.b];
cArr3[1] = cArr[jtb.b + 1];
int i4 = 58224;
int i5 = i3;
while (i5 < 16) {
char c2 = cArr3[1];
char c3 = cArr3[i3];
int i6 = i5;
int i7 = (c3 + i4) ^ ((c3 << 4) + ((char) (e ^ 41718355337583039L)));
int i8 = c3 >>> 5;
try {
Object[] objArr2 = new Object[4];
objArr2[3] = Integer.valueOf(d);
objArr2[2] = Integer.valueOf(i8);
objArr2[1] = Integer.valueOf(i7);
objArr2[i3] = Integer.valueOf(c2);
Object obj = xzZ.y.get(597144044);
if (obj == null) {
Class cls = (Class) xzZ.c(412 - (ViewConfiguration.getJumpTapTimeout() >> 16), 5 - (TypedValue.complexToFloat(i3) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(i3) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)), (char) (ViewConfiguration.getMaximumFlingVelocity() >> 16));
byte b2 = (byte) ($$b & 5);
byte b3 = (byte) (b2 - 1);
Object[] objArr3 = new Object[1];
h(b2, b3, b3, objArr3);
String str = (String) objArr3[i3];
Class<?>[] clsArr = new Class[4];
clsArr[i3] = Integer.TYPE;
clsArr[1] = Integer.TYPE;
clsArr[2] = Integer.TYPE;
clsArr[3] = Integer.TYPE;
obj = cls.getMethod(str, clsArr);
xzZ.y.put(597144044, obj);
}
char charValue = ((Character) ((Method) obj).invoke(null, objArr2)).charValue();
cArr3[1] = charValue;
char[] cArr4 = cArr3;
Object[] objArr4 = {Integer.valueOf(cArr3[i3]), Integer.valueOf((charValue + i4) ^ ((charValue << 4) + ((char) (a ^ 41718355337583039L)))), Integer.valueOf(charValue >>> 5), Integer.valueOf(c)};
Object obj2 = xzZ.y.get(597144044);
if (obj2 == null) {
Class cls2 = (Class) xzZ.c(412 - (ViewConfiguration.getScrollBarSize() >> 8), 5 - (ViewConfiguration.getTapTimeout() >> 16), (char) (AndroidCharacter.getMirror('0') - '0'));
byte b4 = (byte) ($$b & 5);
byte b5 = (byte) (b4 - 1);
Object[] objArr5 = new Object[1];
h(b4, b5, b5, objArr5);
obj2 = cls2.getMethod((String) objArr5[0], Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE);
xzZ.y.put(597144044, obj2);
}
cArr4[0] = ((Character) ((Method) obj2).invoke(null, objArr4)).charValue();
i4 -= 40503;
i5 = i6 + 1;
int i9 = $11 + 31;
$10 = i9 % 128;
int i10 = i9 % 2;
cArr3 = cArr4;
i3 = 0;
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause == null) {
throw th;
}
throw cause;
}
}
char[] cArr5 = cArr3;
cArr2[jtb.b] = cArr5[0];
cArr2[jtb.b + 1] = cArr5[1];
Object[] objArr6 = {jtb, jtb};
Object obj3 = xzZ.y.get(943004485);
if (obj3 == null) {
Class cls3 = (Class) xzZ.c(Gravity.getAbsoluteGravity(0, 0) + 98, 5 - KeyEvent.getDeadChar(0, 0), (char) (TextUtils.lastIndexOf("", '0', 0, 0) + 1));
byte b6 = (byte) 0;
byte b7 = b6;
Object[] objArr7 = new Object[1];
h(b6, b7, b7, objArr7);
obj3 = cls3.getMethod((String) objArr7[0], Object.class, Object.class);
xzZ.y.put(943004485, obj3);
}
((Method) obj3).invoke(null, objArr6);
cArr3 = cArr5;
i3 = 0;
}
String str2 = new String(cArr2, 0, i);
int i11 = $10 + 45;
$11 = i11 % 128;
if (i11 % 2 != 0) {
objArr[0] = str2;
} else {
Object obj4 = null;
obj4.hashCode();
throw null;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public static final class Waiter {
static final Waiter TOMBSTONE = new Waiter(false);
volatile Waiter next;
volatile Thread thread;
Waiter(boolean z) {
}
Waiter() {
AbstractFuture.access$200().putThread(this, Thread.currentThread());
}
final void setNext(Waiter waiter) {
AbstractFuture.access$200().putNext(this, waiter);
}
final void unpark() {
Thread thread = this.thread;
if (thread != null) {
this.thread = null;
LockSupport.unpark(thread);
}
}
}
private void removeWaiter(Waiter waiter) {
int i = 2 % 2;
int i2 = g + 69;
b = i2 % 128;
if (i2 % 2 != 0) {
waiter.thread = null;
throw null;
}
waiter.thread = null;
while (true) {
Waiter waiter2 = this.waiters;
if (waiter2 == Waiter.TOMBSTONE) {
int i3 = b + 7;
g = i3 % 128;
if (i3 % 2 == 0) {
throw null;
}
return;
}
Waiter waiter3 = null;
while (waiter2 != null) {
Waiter waiter4 = waiter2.next;
if (waiter2.thread != null) {
int i4 = b + 87;
g = i4 % 128;
if (i4 % 2 == 0) {
int i5 = 81 / 0;
}
waiter3 = waiter2;
} else if (waiter3 != null) {
int i6 = b + 23;
g = i6 % 128;
if (i6 % 2 == 0) {
waiter3.next = waiter4;
Thread thread = waiter3.thread;
throw null;
}
waiter3.next = waiter4;
if (waiter3.thread == null) {
break;
}
} else if (ATOMIC_HELPER.casWaiters(this, waiter2, waiter4)) {
}
waiter2 = waiter4;
}
return;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public static final class Listener {
static final Listener TOMBSTONE = new Listener(null, null);
final Executor executor;
Listener next;
final Runnable task;
Listener(Runnable runnable, Executor executor) {
this.task = runnable;
this.executor = executor;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public static final class Failure {
static final Failure FALLBACK_INSTANCE = new Failure(new Throwable("Failure occurred while trying to finish a future.") { // from class: com.google.common.util.concurrent.AbstractFuture.Failure.1
@Override // java.lang.Throwable
public Throwable fillInStackTrace() {
synchronized (this) {
}
return this;
}
});
final Throwable exception;
Failure(Throwable th) {
this.exception = (Throwable) Preconditions.checkNotNull(th);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public static final class Cancellation {
static final Cancellation CAUSELESS_CANCELLED;
static final Cancellation CAUSELESS_INTERRUPTED;
final Throwable cause;
final boolean wasInterrupted;
static {
if (AbstractFuture.access$300()) {
CAUSELESS_CANCELLED = null;
CAUSELESS_INTERRUPTED = null;
} else {
CAUSELESS_CANCELLED = new Cancellation(false, null);
CAUSELESS_INTERRUPTED = new Cancellation(true, null);
}
}
Cancellation(boolean z, Throwable th) {
this.wasInterrupted = z;
this.cause = th;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public static final class SetFuture<V> implements Runnable {
final ListenableFuture<? extends V> future;
final AbstractFuture<V> owner;
SetFuture(AbstractFuture<V> abstractFuture, ListenableFuture<? extends V> listenableFuture) {
this.owner = abstractFuture;
this.future = listenableFuture;
}
@Override // java.lang.Runnable
public final void run() {
if (AbstractFuture.access$400(this.owner) != this) {
return;
}
if (AbstractFuture.access$200().casValue(this.owner, this, AbstractFuture.access$500(this.future))) {
AbstractFuture.access$600(this.owner);
}
}
}
@Override // java.util.concurrent.Future
public V get(long j, TimeUnit timeUnit) throws InterruptedException, TimeoutException, ExecutionException {
boolean z;
int i = 2 % 2;
long nanos = timeUnit.toNanos(j);
if (Thread.interrupted()) {
throw new InterruptedException();
}
Object obj = this.value;
if ((obj != null) && (!(obj instanceof SetFuture))) {
return getDoneValue(obj);
}
long j2 = 0;
long nanoTime = nanos > 0 ? System.nanoTime() + nanos : 0L;
if (nanos >= SPIN_THRESHOLD_NANOS) {
int i2 = b + 69;
g = i2 % 128;
int i3 = i2 % 2;
Waiter waiter = this.waiters;
if (waiter != Waiter.TOMBSTONE) {
Waiter waiter2 = new Waiter();
do {
waiter2.setNext(waiter);
if (ATOMIC_HELPER.casWaiters(this, waiter, waiter2)) {
do {
OverflowAvoidingLockSupport.parkNanos(this, nanos);
if (Thread.interrupted()) {
removeWaiter(waiter2);
throw new InterruptedException();
}
Object obj2 = this.value;
if (obj2 != null) {
int i4 = b + 1;
g = i4 % 128;
int i5 = i4 % 2;
z = true;
} else {
int i6 = b + 23;
g = i6 % 128;
int i7 = i6 % 2;
z = false;
}
if (z && (!(obj2 instanceof SetFuture))) {
int i8 = g + 123;
b = i8 % 128;
int i9 = i8 % 2;
return getDoneValue(obj2);
}
nanos = nanoTime - System.nanoTime();
} while (nanos >= SPIN_THRESHOLD_NANOS);
removeWaiter(waiter2);
j2 = 0;
} else {
waiter = this.waiters;
}
} while (waiter != Waiter.TOMBSTONE);
}
V doneValue = getDoneValue(this.value);
int i10 = b + 111;
g = i10 % 128;
if (i10 % 2 == 0) {
int i11 = 33 / 0;
}
return doneValue;
}
while (nanos > j2) {
Object obj3 = this.value;
if ((obj3 != null) && (!(obj3 instanceof SetFuture))) {
return getDoneValue(obj3);
}
if (Thread.interrupted()) {
throw new InterruptedException();
}
nanos = nanoTime - System.nanoTime();
j2 = 0;
}
String obj4 = toString();
String lowerCase = timeUnit.toString().toLowerCase(Locale.ROOT);
String lowerCase2 = timeUnit.toString().toLowerCase(Locale.ROOT);
StringBuilder sb = new StringBuilder(String.valueOf(lowerCase2).length() + 28);
sb.append("Waited ");
sb.append(j);
sb.append(" ");
sb.append(lowerCase2);
String obj5 = sb.toString();
if (nanos + SPIN_THRESHOLD_NANOS < 0) {
String concat = String.valueOf(obj5).concat(" (plus ");
long j3 = -nanos;
long convert = timeUnit.convert(j3, TimeUnit.NANOSECONDS);
long nanos2 = j3 - timeUnit.toNanos(convert);
boolean z2 = convert == 0 || nanos2 > SPIN_THRESHOLD_NANOS;
if (convert > 0) {
String valueOf = String.valueOf(concat);
StringBuilder sb2 = new StringBuilder(String.valueOf(valueOf).length() + 21 + String.valueOf(lowerCase).length());
sb2.append(valueOf);
sb2.append(convert);
sb2.append(" ");
sb2.append(lowerCase);
String obj6 = sb2.toString();
if (z2) {
obj6 = String.valueOf(obj6).concat(",");
}
concat = String.valueOf(obj6).concat(" ");
}
if (z2) {
String valueOf2 = String.valueOf(concat);
StringBuilder sb3 = new StringBuilder(String.valueOf(valueOf2).length() + 33);
sb3.append(valueOf2);
sb3.append(nanos2);
sb3.append(" nanoseconds ");
concat = sb3.toString();
}
obj5 = String.valueOf(concat).concat("delay)");
}
if (isDone()) {
throw new TimeoutException(String.valueOf(obj5).concat(" but future completed as timeout expired"));
}
StringBuilder sb4 = new StringBuilder(String.valueOf(obj5).length() + 5 + String.valueOf(obj4).length());
sb4.append(obj5);
sb4.append(" for ");
sb4.append(obj4);
throw new TimeoutException(sb4.toString());
}
@Override // java.util.concurrent.Future
public V get() throws InterruptedException, ExecutionException {
Object obj;
int i = 2 % 2;
if (Thread.interrupted()) {
throw new InterruptedException();
}
int i2 = b + 99;
g = i2 % 128;
if (i2 % 2 == 0) {
throw null;
}
Object obj2 = this.value;
if ((obj2 != null) && (!(obj2 instanceof SetFuture))) {
int i3 = g + 103;
b = i3 % 128;
int i4 = i3 % 2;
return getDoneValue(obj2);
}
Waiter waiter = this.waiters;
if (waiter != Waiter.TOMBSTONE) {
Waiter waiter2 = new Waiter();
do {
waiter2.setNext(waiter);
if (ATOMIC_HELPER.casWaiters(this, waiter, waiter2)) {
do {
LockSupport.park(this);
if (Thread.interrupted()) {
removeWaiter(waiter2);
throw new InterruptedException();
}
obj = this.value;
} while (!((obj != null) & (!(obj instanceof SetFuture))));
int i5 = g + 43;
b = i5 % 128;
if (i5 % 2 == 0) {
return getDoneValue(obj);
}
getDoneValue(obj);
throw null;
}
waiter = this.waiters;
} while (waiter != Waiter.TOMBSTONE);
}
return getDoneValue(this.value);
}
/* JADX WARN: Multi-variable type inference failed */
private V getDoneValue(Object obj) throws ExecutionException {
int i = 2 % 2;
if (obj instanceof Cancellation) {
throw cancellationExceptionWithCause("Task was cancelled.", ((Cancellation) obj).cause);
}
int i2 = g + 65;
int i3 = i2 % 128;
b = i3;
int i4 = i2 % 2;
if (obj instanceof Failure) {
throw new ExecutionException(((Failure) obj).exception);
}
if (obj != NULL) {
return obj;
}
int i5 = i3 + 25;
g = i5 % 128;
int i6 = i5 % 2;
int i7 = i3 + 69;
g = i7 % 128;
int i8 = i7 % 2;
return null;
}
@Override // java.util.concurrent.Future
public boolean isDone() {
boolean z;
int i = 2 % 2;
if (this.value != null) {
int i2 = b + 49;
g = i2 % 128;
int i3 = i2 % 2;
z = true;
} else {
z = false;
}
boolean z2 = (!(r1 instanceof SetFuture)) & z;
int i4 = g + 73;
b = i4 % 128;
if (i4 % 2 == 0) {
return z2;
}
Object obj = null;
obj.hashCode();
throw null;
}
@Override // java.util.concurrent.Future
public boolean isCancelled() {
int i = 2 % 2;
int i2 = g + 31;
b = i2 % 128;
if (i2 % 2 == 0) {
return this.value instanceof Cancellation;
}
int i3 = 76 / 0;
return this.value instanceof Cancellation;
}
@Override // java.util.concurrent.Future
public boolean cancel(boolean z) {
Cancellation cancellation;
int i = 2 % 2;
Object obj = this.value;
if (!(obj == null) && !(obj instanceof SetFuture)) {
return false;
}
if (GENERATE_CANCELLATION_CAUSES) {
cancellation = new Cancellation(z, new CancellationException("Future.cancel() was called."));
int i2 = g + 65;
b = i2 % 128;
int i3 = i2 % 2;
} else {
cancellation = !(z ^ true) ? Cancellation.CAUSELESS_INTERRUPTED : Cancellation.CAUSELESS_CANCELLED;
}
int i4 = b + 119;
g = i4 % 128;
int i5 = i4 % 2;
AbstractFuture<V> abstractFuture = this;
boolean z2 = false;
while (true) {
if (ATOMIC_HELPER.casValue(abstractFuture, obj, cancellation)) {
if (z) {
int i6 = b + 25;
g = i6 % 128;
int i7 = i6 % 2;
abstractFuture.interruptTask();
int i8 = g + 115;
b = i8 % 128;
int i9 = i8 % 2;
}
complete(abstractFuture);
if (!(obj instanceof SetFuture)) {
break;
}
ListenableFuture<? extends V> listenableFuture = ((SetFuture) obj).future;
if (!(listenableFuture instanceof Trusted)) {
listenableFuture.cancel(z);
break;
}
abstractFuture = (AbstractFuture) listenableFuture;
obj = abstractFuture.value;
if (!(obj == null) && !(obj instanceof SetFuture)) {
break;
}
int i10 = g + 39;
b = i10 % 128;
int i11 = i10 % 2;
z2 = true;
} else {
obj = abstractFuture.value;
if (!(obj instanceof SetFuture)) {
return z2;
}
}
}
return true;
}
/* JADX INFO: Access modifiers changed from: protected */
public final boolean wasInterrupted() {
int i = 2 % 2;
int i2 = g + 17;
b = i2 % 128;
if (i2 % 2 != 0) {
boolean z = this.value instanceof Cancellation;
Object obj = null;
obj.hashCode();
throw null;
}
Object obj2 = this.value;
if (!(!(obj2 instanceof Cancellation)) && ((Cancellation) obj2).wasInterrupted) {
return true;
}
int i3 = g + 73;
b = i3 % 128;
int i4 = i3 % 2;
return false;
}
@Override // com.google.common.util.concurrent.ListenableFuture
public void addListener(Runnable runnable, Executor executor) {
int i = 2 % 2;
int i2 = b + 91;
g = i2 % 128;
int i3 = i2 % 2;
Preconditions.checkNotNull(runnable, "Runnable was null.");
Preconditions.checkNotNull(executor, "Executor was null.");
if (!isDone()) {
int i4 = g + 69;
b = i4 % 128;
int i5 = i4 % 2;
Listener listener = this.listeners;
if (listener != Listener.TOMBSTONE) {
Listener listener2 = new Listener(runnable, executor);
int i6 = b + 105;
g = i6 % 128;
int i7 = i6 % 2;
do {
listener2.next = listener;
if (ATOMIC_HELPER.casListeners(this, listener, listener2)) {
return;
} else {
listener = this.listeners;
}
} while (listener != Listener.TOMBSTONE);
}
}
executeListener(runnable, executor);
}
public boolean set(V v) {
int i = 2 % 2;
int i2 = g;
int i3 = i2 + 23;
b = i3 % 128;
int i4 = i3 % 2;
if (v == null) {
v = (V) NULL;
int i5 = i2 + 71;
b = i5 % 128;
int i6 = i5 % 2;
}
if (!ATOMIC_HELPER.casValue(this, null, v)) {
return false;
}
int i7 = b + 69;
g = i7 % 128;
int i8 = i7 % 2;
complete(this);
return true;
}
public boolean setException(Throwable th) {
int i = 2 % 2;
Object obj = null;
if (ATOMIC_HELPER.casValue(this, null, new Failure((Throwable) Preconditions.checkNotNull(th)))) {
int i2 = g + 1;
b = i2 % 128;
int i3 = i2 % 2;
complete(this);
return true;
}
int i4 = g + 9;
b = i4 % 128;
if (i4 % 2 == 0) {
return false;
}
obj.hashCode();
throw null;
}
/* JADX INFO: Access modifiers changed from: protected */
public boolean setFuture(ListenableFuture<? extends V> listenableFuture) {
Failure failure;
int i = 2 % 2;
Preconditions.checkNotNull(listenableFuture);
Object obj = this.value;
if (obj == null) {
int i2 = g + 95;
b = i2 % 128;
int i3 = i2 % 2;
if (listenableFuture.isDone()) {
int i4 = g + 53;
b = i4 % 128;
if (i4 % 2 != 0) {
ATOMIC_HELPER.casValue(this, null, getFutureValue(listenableFuture));
throw null;
}
if (!ATOMIC_HELPER.casValue(this, null, getFutureValue(listenableFuture))) {
return false;
}
complete(this);
return true;
}
SetFuture setFuture = new SetFuture(this, listenableFuture);
if (ATOMIC_HELPER.casValue(this, null, setFuture)) {
try {
listenableFuture.addListener(setFuture, DirectExecutor.INSTANCE);
} catch (Throwable th) {
try {
failure = new Failure(th);
} catch (Throwable unused) {
failure = Failure.FALLBACK_INSTANCE;
}
ATOMIC_HELPER.casValue(this, setFuture, failure);
}
return true;
}
obj = this.value;
}
if (obj instanceof Cancellation) {
int i5 = g + 63;
b = i5 % 128;
int i6 = i5 % 2;
listenableFuture.cancel(((Cancellation) obj).wasInterrupted);
}
return false;
}
/* JADX WARN: Multi-variable type inference failed */
private static Object getFutureValue(ListenableFuture<?> listenableFuture) {
Throwable tryInternalFastPathGetFailure;
int i = 2 % 2;
if (listenableFuture instanceof Trusted) {
Object obj = ((AbstractFuture) listenableFuture).value;
if (!(obj instanceof Cancellation)) {
return obj;
}
int i2 = g + 43;
b = i2 % 128;
int i3 = i2 % 2;
Cancellation cancellation = (Cancellation) obj;
return cancellation.wasInterrupted ? cancellation.cause != null ? new Cancellation(false, cancellation.cause) : Cancellation.CAUSELESS_CANCELLED : obj;
}
if ((listenableFuture instanceof InternalFutureFailureAccess) && (tryInternalFastPathGetFailure = InternalFutures.tryInternalFastPathGetFailure((InternalFutureFailureAccess) listenableFuture)) != null) {
return new Failure(tryInternalFastPathGetFailure);
}
boolean isCancelled = listenableFuture.isCancelled();
if ((!GENERATE_CANCELLATION_CAUSES) && isCancelled) {
return Cancellation.CAUSELESS_CANCELLED;
}
try {
Object uninterruptibly = getUninterruptibly(listenableFuture);
if (!isCancelled) {
return uninterruptibly == null ? NULL : uninterruptibly;
}
String valueOf = String.valueOf(listenableFuture);
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 84);
sb.append("get() did not throw CancellationException, despite reporting isCancelled() == true: ");
sb.append(valueOf);
return new Cancellation(false, new IllegalArgumentException(sb.toString()));
} catch (CancellationException e2) {
if (!isCancelled) {
String valueOf2 = String.valueOf(listenableFuture);
StringBuilder sb2 = new StringBuilder(String.valueOf(valueOf2).length() + 77);
sb2.append("get() threw CancellationException, despite reporting isCancelled() == false: ");
sb2.append(valueOf2);
return new Failure(new IllegalArgumentException(sb2.toString(), e2));
}
Cancellation cancellation2 = new Cancellation(false, e2);
int i4 = b + 13;
g = i4 % 128;
if (i4 % 2 == 0) {
int i5 = 81 / 0;
}
return cancellation2;
} catch (ExecutionException e3) {
if (!isCancelled) {
return new Failure(e3.getCause());
}
String valueOf3 = String.valueOf(listenableFuture);
StringBuilder sb3 = new StringBuilder(String.valueOf(valueOf3).length() + 84);
sb3.append("get() did not throw CancellationException, despite reporting isCancelled() == true: ");
sb3.append(valueOf3);
return new Cancellation(false, new IllegalArgumentException(sb3.toString(), e3));
} catch (Throwable th) {
return new Failure(th);
}
}
private static <V> V getUninterruptibly(Future<V> future) throws ExecutionException {
V v;
int i = 2 % 2;
int i2 = g + 29;
b = i2 % 128;
int i3 = i2 % 2;
boolean z = false;
while (true) {
try {
v = future.get();
break;
} catch (InterruptedException unused) {
z = true;
} catch (Throwable th) {
if (z) {
Thread.currentThread().interrupt();
}
throw th;
}
}
if (z) {
int i4 = g + 7;
b = i4 % 128;
if (i4 % 2 != 0) {
Thread.currentThread().interrupt();
Object obj = null;
obj.hashCode();
throw null;
}
Thread.currentThread().interrupt();
}
return v;
}
private static void complete(AbstractFuture<?> abstractFuture) {
int i = 2 % 2;
int i2 = g + 95;
b = i2 % 128;
Listener listener = null;
if (i2 % 2 != 0) {
throw null;
}
while (true) {
abstractFuture.releaseWaiters();
abstractFuture.afterDone();
Listener clearListeners = abstractFuture.clearListeners(listener);
int i3 = g + 71;
b = i3 % 128;
int i4 = i3 % 2;
while (clearListeners != null) {
listener = clearListeners.next;
Runnable runnable = clearListeners.task;
if (runnable instanceof SetFuture) {
SetFuture setFuture = (SetFuture) runnable;
abstractFuture = setFuture.owner;
if (abstractFuture.value == setFuture) {
if (ATOMIC_HELPER.casValue(abstractFuture, setFuture, getFutureValue(setFuture.future))) {
break;
}
} else {
continue;
}
} else {
executeListener(runnable, clearListeners.executor);
}
clearListeners = listener;
}
return;
}
}
@Override // com.google.common.util.concurrent.internal.InternalFutureFailureAccess
public final Throwable tryInternalFastPathGetFailure() {
int i = 2 % 2;
Object obj = null;
if (this instanceof Trusted) {
Object obj2 = this.value;
if (!(!(obj2 instanceof Failure))) {
int i2 = b + 59;
g = i2 % 128;
int i3 = i2 % 2;
Throwable th = ((Failure) obj2).exception;
if (i3 != 0) {
return th;
}
obj.hashCode();
throw null;
}
}
int i4 = g + 53;
b = i4 % 128;
if (i4 % 2 != 0) {
int i5 = 78 / 0;
}
return null;
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void maybePropagateCancellationTo(Future<?> future) {
boolean z;
int i = 2 % 2;
if (future != null) {
z = true;
} else {
int i2 = g + 85;
b = i2 % 128;
int i3 = i2 % 2;
z = false;
}
if (true ^ (z & isCancelled())) {
return;
}
int i4 = g + 109;
b = i4 % 128;
int i5 = i4 % 2;
future.cancel(wasInterrupted());
}
private void releaseWaiters() {
Waiter waiter;
int i = 2 % 2;
do {
waiter = this.waiters;
} while (!ATOMIC_HELPER.casWaiters(this, waiter, Waiter.TOMBSTONE));
while (waiter != null) {
int i2 = b + 47;
g = i2 % 128;
int i3 = i2 % 2;
waiter.unpark();
waiter = waiter.next;
}
int i4 = b + 47;
g = i4 % 128;
int i5 = i4 % 2;
}
private Listener clearListeners(Listener listener) {
Listener listener2;
int i = 2 % 2;
do {
listener2 = this.listeners;
} while (!ATOMIC_HELPER.casListeners(this, listener2, Listener.TOMBSTONE));
int i2 = b + 109;
g = i2 % 128;
if (i2 % 2 == 0) {
throw null;
}
Listener listener3 = listener;
Listener listener4 = listener2;
while (listener4 != null) {
Listener listener5 = listener4.next;
listener4.next = listener3;
listener3 = listener4;
listener4 = listener5;
}
int i3 = b + 21;
g = i3 % 128;
if (i3 % 2 != 0) {
return listener3;
}
throw null;
}
public String toString() {
int i = 2 % 2;
StringBuilder sb = new StringBuilder();
if (!getClass().getName().startsWith("com.google.common.util.concurrent.")) {
sb.append(getClass().getName());
} else {
int i2 = g + 67;
b = i2 % 128;
if (i2 % 2 != 0) {
sb.append(getClass().getSimpleName());
throw null;
}
sb.append(getClass().getSimpleName());
}
sb.append('@');
sb.append(Integer.toHexString(System.identityHashCode(this)));
sb.append("[status=");
if (isCancelled()) {
int i3 = g + 77;
b = i3 % 128;
int i4 = i3 % 2;
sb.append("CANCELLED");
} else if (isDone()) {
addDoneString(sb);
} else {
addPendingString(sb);
int i5 = b + 43;
g = i5 % 128;
int i6 = i5 % 2;
}
sb.append("]");
return sb.toString();
}
/* JADX INFO: Access modifiers changed from: protected */
/* JADX WARN: Multi-variable type inference failed */
public String pendingToString() {
int i = 2 % 2;
int i2 = b + 25;
int i3 = i2 % 128;
g = i3;
Object obj = null;
if (i2 % 2 == 0) {
boolean z = this instanceof ScheduledFuture;
obj.hashCode();
throw null;
}
if (!(this instanceof ScheduledFuture)) {
int i4 = i3 + 39;
b = i4 % 128;
if (i4 % 2 != 0) {
int i5 = 26 / 0;
}
return null;
}
long delay = ((ScheduledFuture) this).getDelay(TimeUnit.MILLISECONDS);
StringBuilder sb = new StringBuilder(41);
sb.append("remaining delay=[");
sb.append(delay);
sb.append(" ms]");
return sb.toString();
}
private void addPendingString(StringBuilder sb) {
String obj;
int i = 2 % 2;
int i2 = g + 27;
b = i2 % 128;
int i3 = i2 % 2;
int length = sb.length();
sb.append("PENDING");
Object obj2 = this.value;
if (!(!(obj2 instanceof SetFuture))) {
sb.append(", setFuture=[");
appendUserObject(sb, ((SetFuture) obj2).future);
sb.append("]");
} else {
try {
obj = Strings.emptyToNull(pendingToString());
} catch (RuntimeException | StackOverflowError e2) {
String valueOf = String.valueOf(e2.getClass());
StringBuilder sb2 = new StringBuilder(String.valueOf(valueOf).length() + 38);
sb2.append("Exception thrown from implementation: ");
sb2.append(valueOf);
obj = sb2.toString();
int i4 = g + 103;
b = i4 % 128;
int i5 = i4 % 2;
}
if (obj != null) {
int i6 = b + 93;
g = i6 % 128;
if (i6 % 2 == 0) {
sb.append(", info=[");
sb.append(obj);
sb.append("]");
int i7 = 67 / 0;
} else {
sb.append(", info=[");
sb.append(obj);
sb.append("]");
}
}
}
if (!isDone()) {
return;
}
sb.delete(length, sb.length());
addDoneString(sb);
}
private void addDoneString(StringBuilder sb) {
int i = 2 % 2;
int i2 = b + 115;
g = i2 % 128;
int i3 = i2 % 2;
try {
Object uninterruptibly = getUninterruptibly(this);
sb.append("SUCCESS, result=[");
appendResultObject(sb, uninterruptibly);
sb.append("]");
int i4 = g + 65;
b = i4 % 128;
if (i4 % 2 != 0) {
int i5 = 55 / 0;
}
} catch (CancellationException unused) {
sb.append("CANCELLED");
} catch (RuntimeException e2) {
sb.append("UNKNOWN, cause=[");
sb.append(e2.getClass());
sb.append(" thrown from get()]");
} catch (ExecutionException e3) {
sb.append("FAILURE, cause=[");
sb.append(e3.getCause());
sb.append("]");
}
}
private void appendResultObject(StringBuilder sb, Object obj) {
int i = 2 % 2;
int i2 = b;
int i3 = i2 + 97;
g = i3 % 128;
if (i3 % 2 == 0) {
Object obj2 = null;
obj2.hashCode();
throw null;
}
if (obj == null) {
Object[] objArr = new Object[1];
f(new char[]{25271, 2858, 6027, 55289}, 4 - View.getDefaultSize(0, 0), objArr);
sb.append(((String) objArr[0]).intern());
return;
}
if (obj != this) {
sb.append(obj.getClass().getName());
sb.append("@");
sb.append(Integer.toHexString(System.identityHashCode(obj)));
} else {
int i4 = i2 + 89;
g = i4 % 128;
int i5 = i4 % 2;
sb.append("this future");
}
}
private void appendUserObject(StringBuilder sb, Object obj) {
int i = 2 % 2;
int i2 = b + 61;
g = i2 % 128;
int i3 = i2 % 2;
try {
if (obj == this) {
sb.append("this future");
int i4 = b + 103;
g = i4 % 128;
int i5 = i4 % 2;
return;
}
sb.append(obj);
} catch (RuntimeException | StackOverflowError e2) {
sb.append("Exception thrown from implementation: ");
sb.append(e2.getClass());
}
}
private static void executeListener(Runnable runnable, Executor executor) {
int i = 2 % 2;
int i2 = b + 57;
g = i2 % 128;
try {
if (i2 % 2 != 0) {
executor.execute(runnable);
} else {
executor.execute(runnable);
throw null;
}
} catch (RuntimeException e2) {
Logger logger = log;
Level level = Level.SEVERE;
String valueOf = String.valueOf(runnable);
String valueOf2 = String.valueOf(executor);
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 57 + String.valueOf(valueOf2).length());
sb.append("RuntimeException while executing runnable ");
sb.append(valueOf);
sb.append(" with executor ");
sb.append(valueOf2);
logger.log(level, sb.toString(), (Throwable) e2);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public static abstract class AtomicHelper {
abstract boolean casListeners(AbstractFuture<?> abstractFuture, Listener listener, Listener listener2);
abstract boolean casValue(AbstractFuture<?> abstractFuture, Object obj, Object obj2);
abstract boolean casWaiters(AbstractFuture<?> abstractFuture, Waiter waiter, Waiter waiter2);
abstract void putNext(Waiter waiter, Waiter waiter2);
abstract void putThread(Waiter waiter, Thread thread);
private AtomicHelper() {
}
}
/* loaded from: classes2.dex */
static final class UnsafeAtomicHelper extends AtomicHelper {
static final long LISTENERS_OFFSET;
static final Unsafe UNSAFE;
static final long VALUE_OFFSET;
static final long WAITERS_OFFSET;
static final long WAITER_NEXT_OFFSET;
static final long WAITER_THREAD_OFFSET;
private UnsafeAtomicHelper() {
super();
}
static {
Unsafe unsafe;
try {
try {
unsafe = Unsafe.getUnsafe();
} catch (SecurityException unused) {
unsafe = (Unsafe) AccessController.doPrivileged(new PrivilegedExceptionAction<Unsafe>() { // from class: com.google.common.util.concurrent.AbstractFuture.UnsafeAtomicHelper.1
@Override // java.security.PrivilegedExceptionAction
public Unsafe run() throws Exception {
for (Field field : Unsafe.class.getDeclaredFields()) {
field.setAccessible(true);
Object obj = field.get(null);
if (Unsafe.class.isInstance(obj)) {
return (Unsafe) Unsafe.class.cast(obj);
}
}
throw new NoSuchFieldError("the Unsafe");
}
});
}
try {
WAITERS_OFFSET = unsafe.objectFieldOffset(AbstractFuture.class.getDeclaredField("waiters"));
LISTENERS_OFFSET = unsafe.objectFieldOffset(AbstractFuture.class.getDeclaredField("listeners"));
VALUE_OFFSET = unsafe.objectFieldOffset(AbstractFuture.class.getDeclaredField(AppMeasurementSdk.ConditionalUserProperty.VALUE));
WAITER_THREAD_OFFSET = unsafe.objectFieldOffset(Waiter.class.getDeclaredField("thread"));
WAITER_NEXT_OFFSET = unsafe.objectFieldOffset(Waiter.class.getDeclaredField("next"));
UNSAFE = unsafe;
} catch (Exception e) {
Throwables.throwIfUnchecked(e);
throw new RuntimeException(e);
}
} catch (PrivilegedActionException e2) {
throw new RuntimeException("Could not initialize intrinsics", e2.getCause());
}
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final void putThread(Waiter waiter, Thread thread) {
UNSAFE.putObject(waiter, WAITER_THREAD_OFFSET, thread);
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final void putNext(Waiter waiter, Waiter waiter2) {
UNSAFE.putObject(waiter, WAITER_NEXT_OFFSET, waiter2);
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casWaiters(AbstractFuture<?> abstractFuture, Waiter waiter, Waiter waiter2) {
return Striped$SmallLazyStriped$$ExternalSyntheticBackportWithForwarding0.m(UNSAFE, abstractFuture, WAITERS_OFFSET, waiter, waiter2);
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casListeners(AbstractFuture<?> abstractFuture, Listener listener, Listener listener2) {
return Striped$SmallLazyStriped$$ExternalSyntheticBackportWithForwarding0.m(UNSAFE, abstractFuture, LISTENERS_OFFSET, listener, listener2);
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casValue(AbstractFuture<?> abstractFuture, Object obj, Object obj2) {
return Striped$SmallLazyStriped$$ExternalSyntheticBackportWithForwarding0.m(UNSAFE, abstractFuture, VALUE_OFFSET, obj, obj2);
}
}
/* loaded from: classes2.dex */
static final class SafeAtomicHelper extends AtomicHelper {
final AtomicReferenceFieldUpdater<AbstractFuture, Listener> listenersUpdater;
final AtomicReferenceFieldUpdater<AbstractFuture, Object> valueUpdater;
final AtomicReferenceFieldUpdater<Waiter, Waiter> waiterNextUpdater;
final AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater;
final AtomicReferenceFieldUpdater<AbstractFuture, Waiter> waitersUpdater;
SafeAtomicHelper(AtomicReferenceFieldUpdater<Waiter, Thread> atomicReferenceFieldUpdater, AtomicReferenceFieldUpdater<Waiter, Waiter> atomicReferenceFieldUpdater2, AtomicReferenceFieldUpdater<AbstractFuture, Waiter> atomicReferenceFieldUpdater3, AtomicReferenceFieldUpdater<AbstractFuture, Listener> atomicReferenceFieldUpdater4, AtomicReferenceFieldUpdater<AbstractFuture, Object> atomicReferenceFieldUpdater5) {
super();
this.waiterThreadUpdater = atomicReferenceFieldUpdater;
this.waiterNextUpdater = atomicReferenceFieldUpdater2;
this.waitersUpdater = atomicReferenceFieldUpdater3;
this.listenersUpdater = atomicReferenceFieldUpdater4;
this.valueUpdater = atomicReferenceFieldUpdater5;
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final void putThread(Waiter waiter, Thread thread) {
this.waiterThreadUpdater.lazySet(waiter, thread);
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final void putNext(Waiter waiter, Waiter waiter2) {
this.waiterNextUpdater.lazySet(waiter, waiter2);
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casListeners(AbstractFuture<?> abstractFuture, Listener listener, Listener listener2) {
AtomicReferenceFieldUpdater<AbstractFuture, Listener> atomicReferenceFieldUpdater = this.listenersUpdater;
while (!atomicReferenceFieldUpdater.compareAndSet(abstractFuture, listener, listener2)) {
if (atomicReferenceFieldUpdater.get(abstractFuture) != listener) {
return false;
}
}
return true;
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casValue(AbstractFuture<?> abstractFuture, Object obj, Object obj2) {
AtomicReferenceFieldUpdater<AbstractFuture, Object> atomicReferenceFieldUpdater = this.valueUpdater;
while (!atomicReferenceFieldUpdater.compareAndSet(abstractFuture, obj, obj2)) {
if (atomicReferenceFieldUpdater.get(abstractFuture) != obj) {
return false;
}
}
return true;
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casWaiters(AbstractFuture<?> abstractFuture, Waiter waiter, Waiter waiter2) {
AtomicReferenceFieldUpdater<AbstractFuture, Waiter> atomicReferenceFieldUpdater = this.waitersUpdater;
while (!atomicReferenceFieldUpdater.compareAndSet(abstractFuture, waiter, waiter2)) {
if (atomicReferenceFieldUpdater.get(abstractFuture) != waiter) {
return false;
}
}
return true;
}
}
/* loaded from: classes2.dex */
static final class SynchronizedHelper extends AtomicHelper {
private SynchronizedHelper() {
super();
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final void putThread(Waiter waiter, Thread thread) {
waiter.thread = thread;
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final void putNext(Waiter waiter, Waiter waiter2) {
waiter.next = waiter2;
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casWaiters(AbstractFuture<?> abstractFuture, Waiter waiter, Waiter waiter2) {
synchronized (abstractFuture) {
if (AbstractFuture.access$800(abstractFuture) != waiter) {
return false;
}
AbstractFuture.access$802(abstractFuture, waiter2);
return true;
}
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casListeners(AbstractFuture<?> abstractFuture, Listener listener, Listener listener2) {
synchronized (abstractFuture) {
if (AbstractFuture.access$900(abstractFuture) != listener) {
return false;
}
AbstractFuture.access$902(abstractFuture, listener2);
return true;
}
}
@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper
final boolean casValue(AbstractFuture<?> abstractFuture, Object obj, Object obj2) {
synchronized (abstractFuture) {
if (AbstractFuture.access$400(abstractFuture) != obj) {
return false;
}
AbstractFuture.access$402(abstractFuture, obj2);
return true;
}
}
}
private static CancellationException cancellationExceptionWithCause(String str, Throwable th) {
int i = 2 % 2;
CancellationException cancellationException = new CancellationException(str);
cancellationException.initCause(th);
int i2 = b + 47;
g = i2 % 128;
if (i2 % 2 != 0) {
return cancellationException;
}
throw null;
}
static void e() {
a = (char) 61044;
c = (char) 21817;
e = (char) 44643;
d = (char) 50678;
}
protected void interruptTask() {
int i = 2 % 2;
int i2 = b + 113;
g = i2 % 128;
int i3 = i2 % 2;
}
/* JADX INFO: Access modifiers changed from: protected */
public void afterDone() {
int i = 2 % 2;
int i2 = g + 29;
b = i2 % 128;
int i3 = i2 % 2;
}
static /* synthetic */ boolean access$300() {
int i = 2 % 2;
int i2 = b;
int i3 = i2 + 39;
g = i3 % 128;
int i4 = i3 % 2;
boolean z = GENERATE_CANCELLATION_CAUSES;
int i5 = i2 + 45;
g = i5 % 128;
if (i5 % 2 == 0) {
int i6 = 1 / 0;
}
return z;
}
static /* synthetic */ AtomicHelper access$200() {
int i = 2 % 2;
int i2 = g;
int i3 = i2 + 65;
b = i3 % 128;
Object obj = null;
if (i3 % 2 != 0) {
obj.hashCode();
throw null;
}
AtomicHelper atomicHelper = ATOMIC_HELPER;
int i4 = i2 + 87;
b = i4 % 128;
if (i4 % 2 == 0) {
return atomicHelper;
}
throw null;
}
}