soul-browser/sources/java/j$/util/concurrent/ConcurrentHashMap.java
KaKi87 550ddb0413
Decompile and recreate Soul Browser v1.4.85 with APK CI builds (#1)
* Decompile and recreate Soul Browser v1.4.85 with APK CI builds

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix CI build: include bundled google.jks and remove PR trigger

The apktool build failed in CI because app/unknown/.../google.jks was
excluded by the *.jks gitignore rule. Whitelist app-bundled JKS files
and commit the missing resource.

Also remove the redundant pull_request workflow trigger.

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Change package ID to com.github.kaki87.soulbrowser

Rename the application ID so the rebuilt APK can be installed
alongside the original Soul Browser from Google Play.

- Update AndroidManifest package, permissions, providers, and actions
- Update R class references in smali (com/github/kaki87/soulbrowser/R)
- Update shortcuts.xml targetPackage
- Rename app label to "Soul Rebuild" for easy identification

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix install compatibility: remove split APK metadata and bundle native libs

The rebuilt APK still declared requiredSplitTypes and Play Store split
metadata, causing Android to reject standalone installs as incompatible.

- Remove requiredSplitTypes and split-related manifest meta-data
- Merge native libs from all ABI splits with uncompressed storage
- Page-align before signing for extractNativeLibs=false
- Add .so to apktool doNotCompress list

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix install failure: use apksigner v2/v3 and bundle arm64 native libs

Target SDK 36 requires APK Signature Scheme v2+, but jarsigner only
produces v1 signatures, causing Android to reject the install.

- Sign with apksigner (v1+v2+v3) instead of jarsigner
- Add arm64-v8a native libraries from universal Soul Browser 1.4.79
- Set extractNativeLibs=true for reliable sideload installs
- Commit stable debug keystore for consistent signatures across builds

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Add committed debug keystore for consistent APK signatures

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix startup crash: use original classes2.dex desugar libraries

Apktool recompiles smali_classes2 into a broken classes2.dex, causing
ClassNotFoundException for j$.com.android.tools.r8.a at ML Kit init.

Inject the original classes2.dex (Java 8+ desugar libs) after apktool
build instead of using the recompiled version.

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix missing drawable resources from density split APKs

The base APK is an app bundle module; density-specific drawables like
seek_thumb_nor_b live in config.xhdpi.apk and were missing after rebuild,
causing Resources$NotFoundException at runtime.

- Merge non-9-patch resources from split APKs before apktool build
- Sync public.xml IDs from R smali only when backing files exist
- Add 713 density-specific resource IDs to public.xml

Co-authored-by: KaKi87 <KaKi87@pm.me>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-10 16:07:14 +02:00

1401 lines
52 KiB
Java

package j$.util.concurrent;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
/* loaded from: classes2.dex */
public class ConcurrentHashMap<K, V> extends AbstractMap<K, V> implements java.util.concurrent.ConcurrentMap<K, V>, Serializable, ConcurrentMap<K, V> {
public static final int g = Runtime.getRuntime().availableProcessors();
public static final j$.sun.misc.a h;
public static final long i;
public static final long j;
public static final long k;
public static final long l;
public static final long m;
public static final int n;
public static final int o;
private static final ObjectStreamField[] serialPersistentFields;
private static final long serialVersionUID = 7249069246763182397L;
/* renamed from: a, reason: collision with root package name */
public volatile transient l[] f21305a;
public volatile transient l[] b;
private volatile transient long baseCount;
/* renamed from: c, reason: collision with root package name */
public volatile transient c[] f21306c;
private volatile transient int cellsBusy;
public transient i d;
public transient s e;
public transient e f;
private volatile transient int sizeCtl;
private volatile transient int transferIndex;
public static final int i(int i2) {
return (i2 ^ (i2 >>> 16)) & Integer.MAX_VALUE;
}
static {
Class cls = Integer.TYPE;
serialPersistentFields = new ObjectStreamField[]{new ObjectStreamField("segments", n[].class), new ObjectStreamField("segmentMask", cls), new ObjectStreamField("segmentShift", cls)};
j$.sun.misc.a aVar = j$.sun.misc.a.b;
h = aVar;
i = aVar.h(ConcurrentHashMap.class, "sizeCtl");
j = aVar.h(ConcurrentHashMap.class, "transferIndex");
k = aVar.h(ConcurrentHashMap.class, "baseCount");
l = aVar.h(ConcurrentHashMap.class, "cellsBusy");
m = aVar.h(c.class, "value");
n = aVar.a(l[].class);
int b = aVar.b(l[].class);
if (((b - 1) & b) != 0) {
throw new ExceptionInInitializerError("array index scale not a power of two");
}
o = 31 - Integer.numberOfLeadingZeros(b);
}
public static final int l(int i2) {
int numberOfLeadingZeros = (-1) >>> Integer.numberOfLeadingZeros(i2 - 1);
if (numberOfLeadingZeros < 0) {
return 1;
}
if (numberOfLeadingZeros >= 1073741824) {
return 1073741824;
}
return numberOfLeadingZeros + 1;
}
public static Class c(Object obj) {
Type[] actualTypeArguments;
if (!(obj instanceof Comparable)) {
return null;
}
Class<?> cls = obj.getClass();
if (cls != String.class) {
Type[] genericInterfaces = cls.getGenericInterfaces();
if (genericInterfaces == null) {
return null;
}
for (Type type : genericInterfaces) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
if (parameterizedType.getRawType() == Comparable.class && (actualTypeArguments = parameterizedType.getActualTypeArguments()) != null && actualTypeArguments.length == 1 && actualTypeArguments[0] == cls) {
}
}
}
return null;
}
return cls;
}
public static final l k(l[] lVarArr, int i2) {
return (l) h.f(lVarArr, (i2 << o) + n);
}
public static final boolean b(l[] lVarArr, int i2, l lVar) {
return j$.com.android.tools.r8.a.L(h.f21130a, lVarArr, (i2 << o) + n, lVar);
}
public static final void h(l[] lVarArr, int i2, l lVar) {
h.j(lVarArr, (i2 << o) + n, lVar);
}
public ConcurrentHashMap() {
}
public ConcurrentHashMap(int i2) {
this(i2, 0.75f, 1);
}
public ConcurrentHashMap(Map<? extends K, ? extends V> map) {
this.sizeCtl = 16;
putAll(map);
}
public ConcurrentHashMap(int i2, float f, int i3) {
if (f <= 0.0f || i2 < 0 || i3 <= 0) {
throw new IllegalArgumentException();
}
long j2 = (long) (((i2 < i3 ? i3 : i2) / f) + 1.0d);
this.sizeCtl = j2 >= 1073741824 ? 1073741824 : l((int) j2);
}
@Override // java.util.AbstractMap, java.util.Map
public int size() {
long j2 = j();
if (j2 < 0) {
return 0;
}
if (j2 > 2147483647L) {
return Integer.MAX_VALUE;
}
return (int) j2;
}
@Override // java.util.AbstractMap, java.util.Map
public boolean isEmpty() {
return j() <= 0;
}
/* JADX WARN: Code restructure failed: missing block: B:28:0x004c, code lost:
return (V) r1.f21313c;
*/
@Override // java.util.AbstractMap, java.util.Map
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public V get(java.lang.Object r4) {
/*
r3 = this;
int r0 = r4.hashCode()
int r0 = i(r0)
j$.util.concurrent.l[] r1 = r3.f21305a
if (r1 == 0) goto L4d
int r2 = r1.length
if (r2 <= 0) goto L4d
int r2 = r2 + (-1)
r2 = r2 & r0
j$.util.concurrent.l r1 = k(r1, r2)
if (r1 == 0) goto L4d
int r2 = r1.f21312a
if (r2 != r0) goto L2b
java.lang.Object r2 = r1.b
if (r2 == r4) goto L28
if (r2 == 0) goto L36
boolean r2 = r4.equals(r2)
if (r2 == 0) goto L36
L28:
java.lang.Object r4 = r1.f21313c
return r4
L2b:
if (r2 >= 0) goto L36
j$.util.concurrent.l r4 = r1.a(r0, r4)
if (r4 == 0) goto L4d
java.lang.Object r4 = r4.f21313c
return r4
L36:
j$.util.concurrent.l r1 = r1.d
if (r1 == 0) goto L4d
int r2 = r1.f21312a
if (r2 != r0) goto L36
java.lang.Object r2 = r1.b
if (r2 == r4) goto L4a
if (r2 == 0) goto L36
boolean r2 = r4.equals(r2)
if (r2 == 0) goto L36
L4a:
java.lang.Object r4 = r1.f21313c
return r4
L4d:
r4 = 0
return r4
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.ConcurrentHashMap.get(java.lang.Object):java.lang.Object");
}
@Override // java.util.AbstractMap, java.util.Map
public boolean containsKey(Object obj) {
return get(obj) != null;
}
@Override // java.util.AbstractMap, java.util.Map
public final boolean containsValue(Object obj) {
obj.getClass();
l[] lVarArr = this.f21305a;
if (lVarArr != null) {
p pVar = new p(lVarArr, lVarArr.length, 0, lVarArr.length);
while (true) {
l a2 = pVar.a();
if (a2 == null) {
break;
}
Object obj2 = a2.f21313c;
if (obj2 == obj) {
return true;
}
if (obj2 != null && obj.equals(obj2)) {
return true;
}
}
}
return false;
}
@Override // java.util.AbstractMap, java.util.Map
public V put(K k2, V v) {
return (V) f(k2, v, false);
}
/* JADX WARN: Code restructure failed: missing block: B:57:0x00b4, code lost:
a(1, r3);
*/
/* JADX WARN: Code restructure failed: missing block: B:58:0x00b9, code lost:
return null;
*/
/* JADX WARN: Code restructure failed: missing block: B:81:0x00a5, code lost:
throw new java.lang.IllegalStateException("Recursive update");
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object f(java.lang.Object r9, java.lang.Object r10, boolean r11) {
/*
Method dump skipped, instructions count: 195
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.ConcurrentHashMap.f(java.lang.Object, java.lang.Object, boolean):java.lang.Object");
}
@Override // java.util.AbstractMap, java.util.Map
public void putAll(Map<? extends K, ? extends V> map) {
o(map.size());
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
f(entry.getKey(), entry.getValue(), false);
}
}
@Override // java.util.AbstractMap, java.util.Map
public V remove(Object obj) {
return (V) g(obj, null, null);
}
/* JADX WARN: Code restructure failed: missing block: B:78:0x00ae, code lost:
throw new java.lang.IllegalStateException("Recursive update");
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object g(java.lang.Object r13, java.lang.Object r14, java.lang.Object r15) {
/*
r12 = this;
int r0 = r13.hashCode()
int r0 = i(r0)
j$.util.concurrent.l[] r1 = r12.f21305a
La:
r2 = 0
if (r1 == 0) goto Lc0
int r3 = r1.length
if (r3 == 0) goto Lc0
int r3 = r3 + (-1)
r3 = r3 & r0
j$.util.concurrent.l r4 = k(r1, r3)
if (r4 != 0) goto L1b
goto Lc0
L1b:
int r5 = r4.f21312a
r6 = -1
if (r5 != r6) goto L25
j$.util.concurrent.l[] r1 = r12.d(r1, r4)
goto La
L25:
monitor-enter(r4)
j$.util.concurrent.l r7 = k(r1, r3) // Catch: java.lang.Throwable -> L42
if (r7 != r4) goto Laf
r7 = 1
if (r5 < 0) goto L6e
r8 = r2
r5 = r4
L31:
int r9 = r5.f21312a // Catch: java.lang.Throwable -> L42
if (r9 != r0) goto L65
java.lang.Object r9 = r5.b // Catch: java.lang.Throwable -> L42
if (r9 == r13) goto L45
if (r9 == 0) goto L65
boolean r9 = r13.equals(r9) // Catch: java.lang.Throwable -> L42
if (r9 == 0) goto L65
goto L45
L42:
r13 = move-exception
goto Lbe
L45:
java.lang.Object r9 = r5.f21313c // Catch: java.lang.Throwable -> L42
if (r15 == 0) goto L53
if (r15 == r9) goto L53
if (r9 == 0) goto Lb0
boolean r10 = r15.equals(r9) // Catch: java.lang.Throwable -> L42
if (r10 == 0) goto Lb0
L53:
if (r14 == 0) goto L58
r5.f21313c = r14 // Catch: java.lang.Throwable -> L42
goto Lb1
L58:
if (r8 == 0) goto L5f
j$.util.concurrent.l r3 = r5.d // Catch: java.lang.Throwable -> L42
r8.d = r3 // Catch: java.lang.Throwable -> L42
goto Lb1
L5f:
j$.util.concurrent.l r5 = r5.d // Catch: java.lang.Throwable -> L42
h(r1, r3, r5) // Catch: java.lang.Throwable -> L42
goto Lb1
L65:
j$.util.concurrent.l r8 = r5.d // Catch: java.lang.Throwable -> L42
if (r8 != 0) goto L6a
goto Lb0
L6a:
r11 = r8
r8 = r5
r5 = r11
goto L31
L6e:
boolean r5 = r4 instanceof j$.util.concurrent.q // Catch: java.lang.Throwable -> L42
if (r5 == 0) goto La2
r5 = r4
j$.util.concurrent.q r5 = (j$.util.concurrent.q) r5 // Catch: java.lang.Throwable -> L42
j$.util.concurrent.r r8 = r5.e // Catch: java.lang.Throwable -> L42
if (r8 == 0) goto Lb0
j$.util.concurrent.r r8 = r8.b(r0, r13, r2) // Catch: java.lang.Throwable -> L42
if (r8 == 0) goto Lb0
java.lang.Object r9 = r8.f21313c // Catch: java.lang.Throwable -> L42
if (r15 == 0) goto L8d
if (r15 == r9) goto L8d
if (r9 == 0) goto Lb0
boolean r10 = r15.equals(r9) // Catch: java.lang.Throwable -> L42
if (r10 == 0) goto Lb0
L8d:
if (r14 == 0) goto L92
r8.f21313c = r14 // Catch: java.lang.Throwable -> L42
goto Lb1
L92:
boolean r8 = r5.f(r8) // Catch: java.lang.Throwable -> L42
if (r8 == 0) goto Lb1
j$.util.concurrent.r r5 = r5.f // Catch: java.lang.Throwable -> L42
j$.util.concurrent.l r5 = p(r5) // Catch: java.lang.Throwable -> L42
h(r1, r3, r5) // Catch: java.lang.Throwable -> L42
goto Lb1
La2:
boolean r3 = r4 instanceof j$.util.concurrent.m // Catch: java.lang.Throwable -> L42
if (r3 != 0) goto La7
goto Laf
La7:
java.lang.IllegalStateException r13 = new java.lang.IllegalStateException // Catch: java.lang.Throwable -> L42
java.lang.String r14 = "Recursive update"
r13.<init>(r14) // Catch: java.lang.Throwable -> L42
throw r13 // Catch: java.lang.Throwable -> L42
Laf:
r7 = 0
Lb0:
r9 = r2
Lb1:
monitor-exit(r4) // Catch: java.lang.Throwable -> L42
if (r7 == 0) goto La
if (r9 == 0) goto Lc0
if (r14 != 0) goto Lbd
r13 = -1
r12.a(r13, r6)
Lbd:
return r9
Lbe:
monitor-exit(r4) // Catch: java.lang.Throwable -> L42
throw r13
Lc0:
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.ConcurrentHashMap.g(java.lang.Object, java.lang.Object, java.lang.Object):java.lang.Object");
}
@Override // java.util.AbstractMap, java.util.Map
public void clear() {
l k2;
l lVar;
l[] lVarArr = this.f21305a;
long j2 = 0;
loop0: while (true) {
int i2 = 0;
while (lVarArr != null && i2 < lVarArr.length) {
k2 = k(lVarArr, i2);
if (k2 == null) {
i2++;
} else {
int i3 = k2.f21312a;
if (i3 == -1) {
break;
}
synchronized (k2) {
try {
if (k(lVarArr, i2) == k2) {
if (i3 >= 0) {
lVar = k2;
} else {
lVar = k2 instanceof q ? ((q) k2).f : null;
}
while (lVar != null) {
j2--;
lVar = lVar.d;
}
h(lVarArr, i2, null);
i2++;
}
} finally {
}
}
}
}
lVarArr = d(lVarArr, k2);
}
if (j2 != 0) {
a(j2, -1);
}
}
@Override // java.util.AbstractMap, java.util.Map
public Set<K> keySet() {
i iVar = this.d;
if (iVar != null) {
return iVar;
}
i iVar2 = (Set<K>) new b(this);
this.d = iVar2;
return iVar2;
}
@Override // java.util.AbstractMap, java.util.Map
public Collection<V> values() {
s sVar = this.e;
if (sVar != null) {
return sVar;
}
b bVar = new b(this);
this.e = bVar;
return bVar;
}
@Override // java.util.AbstractMap, java.util.Map
public Set<Map.Entry<K, V>> entrySet() {
e eVar = this.f;
if (eVar != null) {
return eVar;
}
e eVar2 = (Set<Map.Entry<K, V>>) new b(this);
this.f = eVar2;
return eVar2;
}
@Override // java.util.AbstractMap, java.util.Map
public final int hashCode() {
l[] lVarArr = this.f21305a;
int i2 = 0;
if (lVarArr != null) {
p pVar = new p(lVarArr, lVarArr.length, 0, lVarArr.length);
while (true) {
l a2 = pVar.a();
if (a2 == null) {
break;
}
i2 += a2.f21313c.hashCode() ^ a2.b.hashCode();
}
}
return i2;
}
@Override // java.util.AbstractMap
public final String toString() {
l[] lVarArr = this.f21305a;
int length = lVarArr == null ? 0 : lVarArr.length;
p pVar = new p(lVarArr, length, 0, length);
StringBuilder sb = new StringBuilder("{");
l a2 = pVar.a();
if (a2 != null) {
while (true) {
Object obj = a2.b;
Object obj2 = a2.f21313c;
if (obj == this) {
obj = "(this Map)";
}
sb.append(obj);
sb.append('=');
if (obj2 == this) {
obj2 = "(this Map)";
}
sb.append(obj2);
a2 = pVar.a();
if (a2 == null) {
break;
}
sb.append(", ");
}
}
sb.append('}');
return sb.toString();
}
@Override // java.util.AbstractMap, java.util.Map
public final boolean equals(Object obj) {
V value;
V v;
if (obj == this) {
return true;
}
if (!(obj instanceof Map)) {
return false;
}
Map map = (Map) obj;
l[] lVarArr = this.f21305a;
int length = lVarArr == null ? 0 : lVarArr.length;
p pVar = new p(lVarArr, length, 0, length);
while (true) {
l a2 = pVar.a();
if (a2 != null) {
Object obj2 = a2.f21313c;
Object obj3 = map.get(a2.b);
if (obj3 == null || (obj3 != obj2 && !obj3.equals(obj2))) {
break;
}
} else {
for (Map.Entry<K, V> entry : map.entrySet()) {
K key = entry.getKey();
if (key == null || (value = entry.getValue()) == null || (v = get(key)) == null || (value != v && !value.equals(v))) {
return false;
}
}
return true;
}
}
return false;
}
/* JADX WARN: Multi-variable type inference failed */
private void writeObject(ObjectOutputStream objectOutputStream) {
int i2 = 0;
int i3 = 1;
while (i3 < 16) {
i2++;
i3 <<= 1;
}
int i4 = 32 - i2;
int i5 = i3 - 1;
n[] nVarArr = new n[16];
for (int i6 = 0; i6 < 16; i6++) {
nVarArr[i6] = new ReentrantLock();
}
ObjectOutputStream.PutField putFields = objectOutputStream.putFields();
putFields.put("segments", nVarArr);
putFields.put("segmentShift", i4);
putFields.put("segmentMask", i5);
objectOutputStream.writeFields();
l[] lVarArr = this.f21305a;
if (lVarArr != null) {
p pVar = new p(lVarArr, lVarArr.length, 0, lVarArr.length);
while (true) {
l a2 = pVar.a();
if (a2 == null) {
break;
}
objectOutputStream.writeObject(a2.b);
objectOutputStream.writeObject(a2.f21313c);
}
}
objectOutputStream.writeObject(null);
objectOutputStream.writeObject(null);
}
private void readObject(ObjectInputStream objectInputStream) {
long j2;
long j3;
Object obj;
this.sizeCtl = -1;
objectInputStream.defaultReadObject();
long j4 = 0;
long j5 = 0;
l lVar = null;
while (true) {
Object readObject = objectInputStream.readObject();
Object readObject2 = objectInputStream.readObject();
j2 = 1;
if (readObject == null || readObject2 == null) {
break;
}
j5++;
lVar = new l(i(readObject.hashCode()), readObject, readObject2, lVar);
}
if (j5 == 0) {
this.sizeCtl = 0;
return;
}
long j6 = (long) ((((float) j5) / 0.75f) + 1.0d);
int l2 = j6 >= 1073741824 ? 1073741824 : l((int) j6);
l[] lVarArr = new l[l2];
int i2 = l2 - 1;
while (lVar != null) {
l lVar2 = lVar.d;
int i3 = lVar.f21312a;
int i4 = i3 & i2;
l k2 = k(lVarArr, i4);
boolean z = true;
if (k2 == null) {
j3 = j2;
} else {
Object obj2 = lVar.b;
if (k2.f21312a < 0) {
if (((q) k2).e(i3, obj2, lVar.f21313c) == null) {
j4 += j2;
}
j3 = j2;
} else {
j3 = j2;
int i5 = 0;
for (l lVar3 = k2; lVar3 != null; lVar3 = lVar3.d) {
if (lVar3.f21312a == i3 && ((obj = lVar3.b) == obj2 || (obj != null && obj2.equals(obj)))) {
z = false;
break;
}
i5++;
}
if (z && i5 >= 8) {
j4 += j3;
lVar.d = k2;
l lVar4 = lVar;
r rVar = null;
r rVar2 = null;
while (lVar4 != null) {
r rVar3 = new r(lVar4.f21312a, lVar4.b, lVar4.f21313c, null, null);
rVar3.h = rVar2;
if (rVar2 == null) {
rVar = rVar3;
} else {
rVar2.d = rVar3;
}
lVar4 = lVar4.d;
rVar2 = rVar3;
}
h(lVarArr, i4, new q(rVar));
}
}
z = false;
}
if (z) {
j4 += j3;
lVar.d = k2;
h(lVarArr, i4, lVar);
}
lVar = lVar2;
j2 = j3;
}
this.f21305a = lVarArr;
this.sizeCtl = l2 - (l2 >>> 2);
this.baseCount = j4;
}
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.Map
public V putIfAbsent(K k2, V v) {
return (V) f(k2, v, true);
}
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.Map
public boolean remove(Object obj, Object obj2) {
obj.getClass();
return (obj2 == null || g(obj, null, obj2) == null) ? false : true;
}
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.Map
public final boolean replace(Object obj, Object obj2, Object obj3) {
if (obj == null || obj2 == null || obj3 == null) {
throw null;
}
return g(obj, obj3, obj2) != null;
}
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.Map
public final Object replace(Object obj, Object obj2) {
if (obj == null) {
throw null;
}
if (obj2 == null) {
throw null;
}
return g(obj, obj2, null);
}
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.concurrent.ConcurrentMap, j$.util.Map
public final Object getOrDefault(Object obj, Object obj2) {
V v = get(obj);
return v == null ? obj2 : v;
}
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.concurrent.ConcurrentMap, j$.util.Map
public final void forEach(BiConsumer biConsumer) {
biConsumer.getClass();
l[] lVarArr = this.f21305a;
if (lVarArr == null) {
return;
}
p pVar = new p(lVarArr, lVarArr.length, 0, lVarArr.length);
while (true) {
l a2 = pVar.a();
if (a2 == null) {
return;
} else {
biConsumer.accept(a2.b, a2.f21313c);
}
}
}
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.concurrent.ConcurrentMap, j$.util.Map
public final void replaceAll(BiFunction biFunction) {
biFunction.getClass();
l[] lVarArr = this.f21305a;
if (lVarArr == null) {
return;
}
p pVar = new p(lVarArr, lVarArr.length, 0, lVarArr.length);
while (true) {
l a2 = pVar.a();
if (a2 == null) {
return;
}
Object obj = a2.f21313c;
Object obj2 = a2.b;
do {
Object apply = biFunction.apply(obj2, obj);
apply.getClass();
if (g(obj2, apply, obj) == null) {
obj = get(obj2);
}
} while (obj != null);
}
}
/* JADX WARN: Code restructure failed: missing block: B:65:0x00f2, code lost:
if (r5 == null) goto L100;
*/
/* JADX WARN: Code restructure failed: missing block: B:66:0x00f4, code lost:
a(1, r4);
*/
/* JADX WARN: Code restructure failed: missing block: B:67:0x00f9, code lost:
return r5;
*/
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.concurrent.ConcurrentMap, j$.util.Map
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object computeIfAbsent(java.lang.Object r12, java.util.function.Function r13) {
/*
Method dump skipped, instructions count: 259
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.ConcurrentHashMap.computeIfAbsent(java.lang.Object, java.util.function.Function):java.lang.Object");
}
/* JADX WARN: Code restructure failed: missing block: B:66:0x00aa, code lost:
throw new java.lang.IllegalStateException("Recursive update");
*/
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.concurrent.ConcurrentMap, j$.util.Map
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object computeIfPresent(java.lang.Object r14, java.util.function.BiFunction r15) {
/*
r13 = this;
r0 = 0
if (r14 == 0) goto Lbd
if (r15 == 0) goto Lbd
int r1 = r14.hashCode()
int r1 = i(r1)
j$.util.concurrent.l[] r2 = r13.f21305a
r3 = 0
r5 = r0
r4 = r3
L12:
if (r2 == 0) goto Lb7
int r6 = r2.length
if (r6 != 0) goto L19
goto Lb7
L19:
int r6 = r6 + (-1)
r6 = r6 & r1
j$.util.concurrent.l r7 = k(r2, r6)
if (r7 != 0) goto L24
goto Lae
L24:
int r8 = r7.f21312a
r9 = -1
if (r8 != r9) goto L2e
j$.util.concurrent.l[] r2 = r13.d(r2, r7)
goto L12
L2e:
monitor-enter(r7)
j$.util.concurrent.l r10 = k(r2, r6) // Catch: java.lang.Throwable -> L4b
if (r10 != r7) goto Lab
if (r8 < 0) goto L70
r4 = 1
r10 = r0
r8 = r7
L3a:
int r11 = r8.f21312a // Catch: java.lang.Throwable -> L4b
if (r11 != r1) goto L65
java.lang.Object r11 = r8.b // Catch: java.lang.Throwable -> L4b
if (r11 == r14) goto L4e
if (r11 == 0) goto L65
boolean r11 = r14.equals(r11) // Catch: java.lang.Throwable -> L4b
if (r11 == 0) goto L65
goto L4e
L4b:
r14 = move-exception
goto Lb5
L4e:
java.lang.Object r5 = r8.f21313c // Catch: java.lang.Throwable -> L4b
java.lang.Object r5 = r15.apply(r14, r5) // Catch: java.lang.Throwable -> L4b
if (r5 == 0) goto L59
r8.f21313c = r5 // Catch: java.lang.Throwable -> L4b
goto Lab
L59:
j$.util.concurrent.l r3 = r8.d // Catch: java.lang.Throwable -> L4b
if (r10 == 0) goto L60
r10.d = r3 // Catch: java.lang.Throwable -> L4b
goto L63
L60:
h(r2, r6, r3) // Catch: java.lang.Throwable -> L4b
L63:
r3 = r9
goto Lab
L65:
j$.util.concurrent.l r10 = r8.d // Catch: java.lang.Throwable -> L4b
if (r10 != 0) goto L6a
goto Lab
L6a:
int r4 = r4 + 1
r12 = r10
r10 = r8
r8 = r12
goto L3a
L70:
boolean r8 = r7 instanceof j$.util.concurrent.q // Catch: java.lang.Throwable -> L4b
if (r8 == 0) goto L9e
r4 = r7
j$.util.concurrent.q r4 = (j$.util.concurrent.q) r4 // Catch: java.lang.Throwable -> L4b
j$.util.concurrent.r r8 = r4.e // Catch: java.lang.Throwable -> L4b
if (r8 == 0) goto L9c
j$.util.concurrent.r r8 = r8.b(r1, r14, r0) // Catch: java.lang.Throwable -> L4b
if (r8 == 0) goto L9c
java.lang.Object r5 = r8.f21313c // Catch: java.lang.Throwable -> L4b
java.lang.Object r5 = r15.apply(r14, r5) // Catch: java.lang.Throwable -> L4b
if (r5 == 0) goto L8c
r8.f21313c = r5 // Catch: java.lang.Throwable -> L4b
goto L9c
L8c:
boolean r3 = r4.f(r8) // Catch: java.lang.Throwable -> L4b
if (r3 == 0) goto L9b
j$.util.concurrent.r r3 = r4.f // Catch: java.lang.Throwable -> L4b
j$.util.concurrent.l r3 = p(r3) // Catch: java.lang.Throwable -> L4b
h(r2, r6, r3) // Catch: java.lang.Throwable -> L4b
L9b:
r3 = r9
L9c:
r4 = 2
goto Lab
L9e:
boolean r6 = r7 instanceof j$.util.concurrent.m // Catch: java.lang.Throwable -> L4b
if (r6 != 0) goto La3
goto Lab
La3:
java.lang.IllegalStateException r14 = new java.lang.IllegalStateException // Catch: java.lang.Throwable -> L4b
java.lang.String r15 = "Recursive update"
r14.<init>(r15) // Catch: java.lang.Throwable -> L4b
throw r14 // Catch: java.lang.Throwable -> L4b
Lab:
monitor-exit(r7) // Catch: java.lang.Throwable -> L4b
if (r4 == 0) goto L12
Lae:
if (r3 == 0) goto Lb4
long r14 = (long) r3
r13.a(r14, r4)
Lb4:
return r5
Lb5:
monitor-exit(r7) // Catch: java.lang.Throwable -> L4b
throw r14
Lb7:
j$.util.concurrent.l[] r2 = r13.e()
goto L12
Lbd:
throw r0
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.ConcurrentHashMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction):java.lang.Object");
}
/* JADX WARN: Code restructure failed: missing block: B:89:0x010e, code lost:
if (r4 == 0) goto L102;
*/
/* JADX WARN: Code restructure failed: missing block: B:90:0x0110, code lost:
a(r4, r3);
*/
/* JADX WARN: Code restructure failed: missing block: B:91:0x0114, code lost:
return r5;
*/
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.concurrent.ConcurrentMap, j$.util.Map
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object compute(java.lang.Object r14, java.util.function.BiFunction r15) {
/*
Method dump skipped, instructions count: 286
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.ConcurrentHashMap.compute(java.lang.Object, java.util.function.BiFunction):java.lang.Object");
}
/* JADX WARN: Code restructure failed: missing block: B:73:0x00dd, code lost:
throw new java.lang.IllegalStateException("Recursive update");
*/
@Override // java.util.Map, java.util.concurrent.ConcurrentMap, j$.util.concurrent.ConcurrentMap, j$.util.Map
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object merge(java.lang.Object r18, java.lang.Object r19, java.util.function.BiFunction r20) {
/*
Method dump skipped, instructions count: 250
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.ConcurrentHashMap.merge(java.lang.Object, java.lang.Object, java.util.function.BiFunction):java.lang.Object");
}
public final l[] e() {
while (true) {
l[] lVarArr = this.f21305a;
if (lVarArr != null && lVarArr.length != 0) {
return lVarArr;
}
int i2 = this.sizeCtl;
if (i2 < 0) {
Thread.yield();
} else if (h.c(this, i, i2, -1)) {
try {
l[] lVarArr2 = this.f21305a;
if (lVarArr2 != null) {
if (lVarArr2.length == 0) {
}
this.sizeCtl = i2;
return lVarArr2;
}
int i3 = i2 > 0 ? i2 : 16;
l[] lVarArr3 = new l[i3];
this.f21305a = lVarArr3;
i2 = i3 - (i3 >>> 2);
lVarArr2 = lVarArr3;
this.sizeCtl = i2;
return lVarArr2;
} catch (Throwable th) {
this.sizeCtl = i2;
throw th;
}
}
}
}
/* JADX WARN: Code restructure failed: missing block: B:125:0x0140, code lost:
if (r1.f21306c != r6) goto L150;
*/
/* JADX WARN: Code restructure failed: missing block: B:126:0x0142, code lost:
r1.f21306c = (j$.util.concurrent.c[]) java.util.Arrays.copyOf(r6, r7 << 1);
*/
/* JADX WARN: Code restructure failed: missing block: B:4:0x0017, code lost:
if (r0.d(r1, r2, r4, r6) == false) goto L6;
*/
/* JADX WARN: Removed duplicated region for block: B:92:0x01ab A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:94:0x00c2 A[SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(long r25, int r27) {
/*
Method dump skipped, instructions count: 432
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.ConcurrentHashMap.a(long, int):void");
}
public final l[] d(l[] lVarArr, l lVar) {
int i2;
if (lVar instanceof g) {
l[] lVarArr2 = ((g) lVar).e;
int numberOfLeadingZeros = Integer.numberOfLeadingZeros(lVarArr.length) | 32768;
while (lVarArr2 == this.b && this.f21305a == lVarArr && (i2 = this.sizeCtl) < 0 && (i2 >>> 16) == numberOfLeadingZeros && i2 != numberOfLeadingZeros + 1 && i2 != 65535 + numberOfLeadingZeros && this.transferIndex > 0) {
if (h.c(this, i, i2, i2 + 1)) {
m(lVarArr, lVarArr2);
break;
}
}
return lVarArr2;
}
return this.f21305a;
}
public final void o(int i2) {
int length;
int l2 = i2 >= 536870912 ? 1073741824 : l(i2 + (i2 >>> 1) + 1);
while (true) {
int i3 = this.sizeCtl;
if (i3 >= 0) {
l[] lVarArr = this.f21305a;
if (lVarArr != null && (length = lVarArr.length) != 0) {
if (l2 <= i3 || length >= 1073741824) {
break;
} else if (lVarArr == this.f21305a) {
if (h.c(this, i, i3, ((Integer.numberOfLeadingZeros(length) | 32768) << 16) + 2)) {
m(lVarArr, null);
}
}
} else {
int i4 = i3 > l2 ? i3 : l2;
if (h.c(this, i, i3, -1)) {
try {
if (this.f21305a == lVarArr) {
this.f21305a = new l[i4];
i3 = i4 - (i4 >>> 2);
}
} finally {
this.sizeCtl = i3;
}
} else {
continue;
}
}
} else {
break;
}
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r10v11, types: [j$.util.concurrent.l] */
/* JADX WARN: Type inference failed for: r10v9, types: [j$.util.concurrent.l] */
/* JADX WARN: Type inference failed for: r5v5, types: [j$.util.concurrent.l] */
/* JADX WARN: Type inference failed for: r8v10, types: [j$.util.concurrent.l] */
/* JADX WARN: Type inference failed for: r8v15, types: [j$.util.concurrent.l] */
public final void m(l[] lVarArr, l[] lVarArr2) {
l[] lVarArr3;
int i2;
int i3;
int i4;
int i5;
boolean z;
char c2;
int i6;
int i7;
l qVar;
l qVar2;
r rVar;
int i8;
ConcurrentHashMap<K, V> concurrentHashMap = this;
int length = lVarArr.length;
int i9 = g;
boolean z2 = true;
int i10 = i9 > 1 ? (length >>> 3) / i9 : length;
char c3 = 16;
int i11 = i10 < 16 ? 16 : i10;
if (lVarArr2 == null) {
try {
l[] lVarArr4 = new l[length << 1];
concurrentHashMap.b = lVarArr4;
concurrentHashMap.transferIndex = length;
lVarArr3 = lVarArr4;
} catch (Throwable unused) {
concurrentHashMap.sizeCtl = Integer.MAX_VALUE;
return;
}
} else {
lVarArr3 = lVarArr2;
}
int length2 = lVarArr3.length;
g gVar = new g(lVarArr3);
boolean z3 = true;
int i12 = 0;
int i13 = 0;
boolean z4 = false;
while (true) {
if (z3) {
int i14 = i12 - 1;
if (i14 >= i13 || z4) {
i13 = i13;
i12 = i14;
} else {
int i15 = concurrentHashMap.transferIndex;
if (i15 <= 0) {
i12 = -1;
} else {
j$.sun.misc.a aVar = h;
int i16 = i13;
long j2 = j;
if (i15 > i11) {
i3 = i16;
i4 = i15 - i11;
i2 = i14;
} else {
i2 = i14;
i3 = i16;
i4 = 0;
}
boolean c4 = aVar.c(concurrentHashMap, j2, i15, i4);
i13 = i4;
if (c4) {
i12 = i15 - 1;
} else {
i13 = i3;
i12 = i2;
}
}
}
z3 = false;
} else {
int i17 = i13;
r rVar2 = null;
if (i12 < 0 || i12 >= length || (i7 = i12 + length) >= length2) {
i5 = length;
z = z2;
c2 = c3;
i6 = i11;
if (z4) {
concurrentHashMap.b = null;
concurrentHashMap.f21305a = lVarArr3;
concurrentHashMap.sizeCtl = (i5 << 1) - (i5 >>> 1);
return;
}
int i18 = i12;
j$.sun.misc.a aVar2 = h;
long j3 = i;
int i19 = concurrentHashMap.sizeCtl;
if (!aVar2.c(concurrentHashMap, j3, i19, i19 - 1)) {
i12 = i18;
} else {
if (i19 - 2 != ((Integer.numberOfLeadingZeros(i5) | 32768) << 16)) {
return;
}
z3 = z;
z4 = z3;
i12 = i5;
}
} else {
?? k2 = k(lVarArr, i12);
if (k2 == 0) {
z3 = b(lVarArr, i12, gVar);
i5 = length;
z = z2;
c2 = c3;
i6 = i11;
} else {
z = z2;
int i20 = k2.f21312a;
if (i20 == -1) {
i5 = length;
c2 = c3;
i6 = i11;
z3 = z;
} else {
synchronized (k2) {
try {
if (k(lVarArr, i12) == k2) {
if (i20 >= 0) {
int i21 = i20 & length;
r rVar3 = k2;
for (r rVar4 = k2.d; rVar4 != null; rVar4 = rVar4.d) {
char c5 = c3;
int i22 = rVar4.f21312a & length;
if (i22 != i21) {
rVar3 = rVar4;
i21 = i22;
}
c3 = c5;
}
c2 = c3;
if (i21 == 0) {
rVar = null;
rVar2 = rVar3;
} else {
rVar = rVar3;
}
l lVar = k2;
while (lVar != rVar3) {
int i23 = lVar.f21312a;
Object obj = lVar.b;
int i24 = length;
Object obj2 = lVar.f21313c;
if ((i23 & i24) == 0) {
i8 = i11;
rVar2 = new l(i23, obj, obj2, rVar2);
} else {
i8 = i11;
rVar = new l(i23, obj, obj2, rVar);
}
lVar = lVar.d;
length = i24;
i11 = i8;
}
i5 = length;
i6 = i11;
h(lVarArr3, i12, rVar2);
h(lVarArr3, i7, rVar);
h(lVarArr, i12, gVar);
} else {
i5 = length;
c2 = c3;
i6 = i11;
if (k2 instanceof q) {
q qVar3 = (q) k2;
r rVar5 = null;
r rVar6 = null;
l lVar2 = qVar3.f;
int i25 = 0;
int i26 = 0;
r rVar7 = null;
while (lVar2 != null) {
q qVar4 = qVar3;
int i27 = lVar2.f21312a;
r rVar8 = new r(i27, lVar2.b, lVar2.f21313c, null, null);
if ((i27 & i5) == 0) {
rVar8.h = rVar6;
if (rVar6 == null) {
rVar2 = rVar8;
} else {
rVar6.d = rVar8;
}
i25++;
rVar6 = rVar8;
} else {
rVar8.h = rVar5;
if (rVar5 == null) {
rVar7 = rVar8;
} else {
rVar5.d = rVar8;
}
i26++;
rVar5 = rVar8;
}
lVar2 = lVar2.d;
qVar3 = qVar4;
}
q qVar5 = qVar3;
if (i25 <= 6) {
qVar = p(rVar2);
} else {
qVar = i26 != 0 ? new q(rVar2) : qVar5;
}
if (i26 <= 6) {
qVar2 = p(rVar7);
} else {
qVar2 = i25 != 0 ? new q(rVar7) : qVar5;
}
h(lVarArr3, i12, qVar);
h(lVarArr3, i7, qVar2);
h(lVarArr, i12, gVar);
}
}
z3 = z;
} else {
i5 = length;
c2 = c3;
i6 = i11;
}
} finally {
}
}
}
}
}
concurrentHashMap = this;
i13 = i17;
z2 = z;
c3 = c2;
length = i5;
i11 = i6;
}
}
}
public final long j() {
c[] cVarArr = this.f21306c;
long j2 = this.baseCount;
if (cVarArr != null) {
for (c cVar : cVarArr) {
if (cVar != null) {
j2 += cVar.value;
}
}
}
return j2;
}
public final void n(l[] lVarArr, int i2) {
int length = lVarArr.length;
if (length < 64) {
o(length << 1);
return;
}
l k2 = k(lVarArr, i2);
if (k2 == null || k2.f21312a < 0) {
return;
}
synchronized (k2) {
try {
if (k(lVarArr, i2) == k2) {
r rVar = null;
r rVar2 = null;
l lVar = k2;
while (lVar != null) {
r rVar3 = new r(lVar.f21312a, lVar.b, lVar.f21313c, null, null);
rVar3.h = rVar2;
if (rVar2 == null) {
rVar = rVar3;
} else {
rVar2.d = rVar3;
}
lVar = lVar.d;
rVar2 = rVar3;
}
h(lVarArr, i2, new q(rVar));
}
} catch (Throwable th) {
throw th;
}
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r6v2, types: [j$.util.concurrent.l] */
public static l p(r rVar) {
l lVar = null;
l lVar2 = null;
for (r rVar2 = rVar; rVar2 != null; rVar2 = rVar2.d) {
l lVar3 = new l(rVar2.f21312a, rVar2.b, rVar2.f21313c);
if (lVar2 == null) {
lVar = lVar3;
} else {
lVar2.d = lVar3;
}
lVar2 = lVar3;
}
return lVar;
}
}