- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
176 lines
7.0 KiB
Java
176 lines
7.0 KiB
Java
package com.google.protobuf;
|
|
|
|
import com.google.protobuf.Internal;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public abstract class ListFieldSchema {
|
|
private static final ListFieldSchema FULL_INSTANCE;
|
|
private static final ListFieldSchema LITE_INSTANCE;
|
|
|
|
public static ListFieldSchema full() {
|
|
return FULL_INSTANCE;
|
|
}
|
|
|
|
public static ListFieldSchema lite() {
|
|
return LITE_INSTANCE;
|
|
}
|
|
|
|
public abstract void makeImmutableListAt(Object obj, long j);
|
|
|
|
public abstract <L> void mergeListsAt(Object obj, Object obj2, long j);
|
|
|
|
public abstract <L> List<L> mutableListAt(Object obj, long j);
|
|
|
|
private ListFieldSchema() {
|
|
}
|
|
|
|
static {
|
|
FULL_INSTANCE = new ListFieldSchemaFull();
|
|
LITE_INSTANCE = new ListFieldSchemaLite();
|
|
}
|
|
|
|
public static final class ListFieldSchemaFull extends ListFieldSchema {
|
|
private static final Class<?> UNMODIFIABLE_LIST_CLASS = Collections.unmodifiableList(Collections.emptyList()).getClass();
|
|
|
|
private ListFieldSchemaFull() {
|
|
super();
|
|
}
|
|
|
|
@Override // com.google.protobuf.ListFieldSchema
|
|
public <L> List<L> mutableListAt(Object obj, long j) {
|
|
return mutableListAt(obj, j, 10);
|
|
}
|
|
|
|
@Override // com.google.protobuf.ListFieldSchema
|
|
public void makeImmutableListAt(Object obj, long j) {
|
|
Object unmodifiableList;
|
|
List list = (List) UnsafeUtil.getObject(obj, j);
|
|
if (list instanceof LazyStringList) {
|
|
unmodifiableList = ((LazyStringList) list).getUnmodifiableView();
|
|
} else {
|
|
if (UNMODIFIABLE_LIST_CLASS.isAssignableFrom(list.getClass())) {
|
|
return;
|
|
}
|
|
if ((list instanceof PrimitiveNonBoxingCollection) && (list instanceof Internal.ProtobufList)) {
|
|
Internal.ProtobufList protobufList = (Internal.ProtobufList) list;
|
|
if (protobufList.isModifiable()) {
|
|
protobufList.makeImmutable();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
unmodifiableList = Collections.unmodifiableList(list);
|
|
}
|
|
UnsafeUtil.putObject(obj, j, unmodifiableList);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
private static <L> List<L> mutableListAt(Object obj, long j, int i) {
|
|
LazyStringArrayList lazyStringArrayList;
|
|
List<L> arrayList;
|
|
List<L> list = getList(obj, j);
|
|
if (list.isEmpty()) {
|
|
if (list instanceof LazyStringList) {
|
|
arrayList = new LazyStringArrayList(i);
|
|
} else if ((list instanceof PrimitiveNonBoxingCollection) && (list instanceof Internal.ProtobufList)) {
|
|
arrayList = ((Internal.ProtobufList) list).mutableCopyWithCapacity2(i);
|
|
} else {
|
|
arrayList = new ArrayList<>(i);
|
|
}
|
|
UnsafeUtil.putObject(obj, j, arrayList);
|
|
return arrayList;
|
|
}
|
|
if (UNMODIFIABLE_LIST_CLASS.isAssignableFrom(list.getClass())) {
|
|
ArrayList arrayList2 = new ArrayList(list.size() + i);
|
|
arrayList2.addAll(list);
|
|
UnsafeUtil.putObject(obj, j, arrayList2);
|
|
lazyStringArrayList = arrayList2;
|
|
} else if (list instanceof UnmodifiableLazyStringList) {
|
|
LazyStringArrayList lazyStringArrayList2 = new LazyStringArrayList(list.size() + i);
|
|
lazyStringArrayList2.addAll((UnmodifiableLazyStringList) list);
|
|
UnsafeUtil.putObject(obj, j, lazyStringArrayList2);
|
|
lazyStringArrayList = lazyStringArrayList2;
|
|
} else {
|
|
if (!(list instanceof PrimitiveNonBoxingCollection) || !(list instanceof Internal.ProtobufList)) {
|
|
return list;
|
|
}
|
|
Internal.ProtobufList protobufList = (Internal.ProtobufList) list;
|
|
if (protobufList.isModifiable()) {
|
|
return list;
|
|
}
|
|
Internal.ProtobufList mutableCopyWithCapacity2 = protobufList.mutableCopyWithCapacity2(list.size() + i);
|
|
UnsafeUtil.putObject(obj, j, mutableCopyWithCapacity2);
|
|
return mutableCopyWithCapacity2;
|
|
}
|
|
return lazyStringArrayList;
|
|
}
|
|
|
|
@Override // com.google.protobuf.ListFieldSchema
|
|
public <E> void mergeListsAt(Object obj, Object obj2, long j) {
|
|
List list = getList(obj2, j);
|
|
List mutableListAt = mutableListAt(obj, j, list.size());
|
|
int size = mutableListAt.size();
|
|
int size2 = list.size();
|
|
if (size > 0 && size2 > 0) {
|
|
mutableListAt.addAll(list);
|
|
}
|
|
if (size > 0) {
|
|
list = mutableListAt;
|
|
}
|
|
UnsafeUtil.putObject(obj, j, list);
|
|
}
|
|
|
|
public static <E> List<E> getList(Object obj, long j) {
|
|
return (List) UnsafeUtil.getObject(obj, j);
|
|
}
|
|
}
|
|
|
|
public static final class ListFieldSchemaLite extends ListFieldSchema {
|
|
private ListFieldSchemaLite() {
|
|
super();
|
|
}
|
|
|
|
@Override // com.google.protobuf.ListFieldSchema
|
|
public <L> List<L> mutableListAt(Object obj, long j) {
|
|
Internal.ProtobufList protobufList = getProtobufList(obj, j);
|
|
if (protobufList.isModifiable()) {
|
|
return protobufList;
|
|
}
|
|
int size = protobufList.size();
|
|
Internal.ProtobufList mutableCopyWithCapacity2 = protobufList.mutableCopyWithCapacity2(size == 0 ? 10 : size * 2);
|
|
UnsafeUtil.putObject(obj, j, mutableCopyWithCapacity2);
|
|
return mutableCopyWithCapacity2;
|
|
}
|
|
|
|
@Override // com.google.protobuf.ListFieldSchema
|
|
public void makeImmutableListAt(Object obj, long j) {
|
|
getProtobufList(obj, j).makeImmutable();
|
|
}
|
|
|
|
@Override // com.google.protobuf.ListFieldSchema
|
|
public <E> void mergeListsAt(Object obj, Object obj2, long j) {
|
|
Internal.ProtobufList protobufList = getProtobufList(obj, j);
|
|
Internal.ProtobufList protobufList2 = getProtobufList(obj2, j);
|
|
int size = protobufList.size();
|
|
int size2 = protobufList2.size();
|
|
if (size > 0 && size2 > 0) {
|
|
if (!protobufList.isModifiable()) {
|
|
protobufList = protobufList.mutableCopyWithCapacity2(size2 + size);
|
|
}
|
|
protobufList.addAll(protobufList2);
|
|
}
|
|
if (size > 0) {
|
|
protobufList2 = protobufList;
|
|
}
|
|
UnsafeUtil.putObject(obj, j, protobufList2);
|
|
}
|
|
|
|
public static <E> Internal.ProtobufList<E> getProtobufList(Object obj, long j) {
|
|
return (Internal.ProtobufList) UnsafeUtil.getObject(obj, j);
|
|
}
|
|
}
|
|
}
|