231 lines
8.3 KiB
Java
231 lines
8.3 KiB
Java
package b.g.a.c.g0.u;
|
|
|
|
import b.g.a.a.i;
|
|
import b.g.a.c.b;
|
|
import b.g.a.c.d;
|
|
import b.g.a.c.e0.g;
|
|
import b.g.a.c.g0.h;
|
|
import b.g.a.c.g0.i;
|
|
import b.g.a.c.g0.t.l;
|
|
import b.g.a.c.j;
|
|
import b.g.a.c.n;
|
|
import b.g.a.c.w;
|
|
import b.g.a.c.x;
|
|
import b.g.a.c.y.a;
|
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
|
import java.io.IOException;
|
|
import java.util.Objects;
|
|
/* compiled from: ObjectArraySerializer.java */
|
|
@a
|
|
/* loaded from: classes3.dex */
|
|
public class d0 extends a<Object[]> implements i {
|
|
public l _dynamicSerializers = l.b.f703b;
|
|
public n<Object> _elementSerializer;
|
|
public final j _elementType;
|
|
public final boolean _staticTyping;
|
|
public final g _valueTypeSerializer;
|
|
|
|
public d0(d0 d0Var, d dVar, g gVar, n<?> nVar, Boolean bool) {
|
|
super(d0Var, dVar, bool);
|
|
this._elementType = d0Var._elementType;
|
|
this._valueTypeSerializer = gVar;
|
|
this._staticTyping = d0Var._staticTyping;
|
|
this._elementSerializer = nVar;
|
|
}
|
|
|
|
public d0(j jVar, boolean z2, g gVar, n<Object> nVar) {
|
|
super(Object[].class);
|
|
this._elementType = jVar;
|
|
this._staticTyping = z2;
|
|
this._valueTypeSerializer = gVar;
|
|
this._elementSerializer = nVar;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:15:0x002a */
|
|
/* JADX WARN: Removed duplicated region for block: B:18:0x0033 */
|
|
@Override // b.g.a.c.g0.u.a, b.g.a.c.g0.i
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public n<?> a(x xVar, d dVar) throws JsonMappingException {
|
|
n<?> nVar;
|
|
i.d l;
|
|
j jVar;
|
|
Object c;
|
|
g gVar = this._valueTypeSerializer;
|
|
if (gVar != null) {
|
|
gVar = gVar.a(dVar);
|
|
}
|
|
Boolean bool = null;
|
|
if (dVar != null) {
|
|
b.g.a.c.c0.i member = dVar.getMember();
|
|
b v = xVar.v();
|
|
if (!(member == null || (c = v.c(member)) == null)) {
|
|
nVar = xVar.H(member, c);
|
|
l = l(xVar, dVar, this._handledType);
|
|
if (l != null) {
|
|
bool = l.b(i.a.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED);
|
|
}
|
|
if (nVar == null) {
|
|
nVar = this._elementSerializer;
|
|
}
|
|
n<?> k = k(xVar, dVar, nVar);
|
|
n<?> m = (k == null || (jVar = this._elementType) == null || !this._staticTyping || jVar.y()) ? k : xVar.m(this._elementType, dVar);
|
|
return (this._property == dVar || m != this._elementSerializer || this._valueTypeSerializer != gVar || !Objects.equals(this._unwrapSingle, bool)) ? new d0(this, dVar, gVar, m, bool) : this;
|
|
}
|
|
}
|
|
nVar = null;
|
|
l = l(xVar, dVar, this._handledType);
|
|
if (l != null) {
|
|
}
|
|
if (nVar == null) {
|
|
}
|
|
n<?> k2 = k(xVar, dVar, nVar);
|
|
if (k2 == null) {
|
|
}
|
|
if (this._property == dVar) {
|
|
}
|
|
}
|
|
|
|
@Override // b.g.a.c.n
|
|
public boolean d(x xVar, Object obj) {
|
|
return ((Object[]) obj).length == 0;
|
|
}
|
|
|
|
@Override // b.g.a.c.g0.u.a, b.g.a.c.n
|
|
public void f(Object obj, b.g.a.b.d dVar, x xVar) throws IOException {
|
|
Object[] objArr = (Object[]) obj;
|
|
int length = objArr.length;
|
|
if (length != 1 || ((this._unwrapSingle != null || !xVar.D(w.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED)) && this._unwrapSingle != Boolean.TRUE)) {
|
|
dVar.b0(objArr, length);
|
|
t(objArr, dVar, xVar);
|
|
dVar.t();
|
|
return;
|
|
}
|
|
t(objArr, dVar, xVar);
|
|
}
|
|
|
|
@Override // b.g.a.c.g0.h
|
|
public h<?> p(g gVar) {
|
|
return new d0(this._elementType, this._staticTyping, gVar, this._elementSerializer);
|
|
}
|
|
|
|
@Override // b.g.a.c.g0.h
|
|
public boolean q(Object obj) {
|
|
return ((Object[]) obj).length == 1;
|
|
}
|
|
|
|
@Override // b.g.a.c.g0.u.a
|
|
public n<?> s(d dVar, Boolean bool) {
|
|
return new d0(this, dVar, this._valueTypeSerializer, this._elementSerializer, bool);
|
|
}
|
|
|
|
/* renamed from: u */
|
|
public void t(Object[] objArr, b.g.a.b.d dVar, x xVar) throws IOException {
|
|
Exception e;
|
|
Object obj;
|
|
Exception e2;
|
|
Object obj2;
|
|
l b2;
|
|
int length = objArr.length;
|
|
if (length != 0) {
|
|
n<Object> nVar = this._elementSerializer;
|
|
int i = 0;
|
|
if (nVar != null) {
|
|
int length2 = objArr.length;
|
|
g gVar = this._valueTypeSerializer;
|
|
Object obj3 = null;
|
|
while (i < length2) {
|
|
try {
|
|
obj3 = objArr[i];
|
|
if (obj3 == null) {
|
|
xVar.l(dVar);
|
|
} else if (gVar == null) {
|
|
nVar.f(obj3, dVar, xVar);
|
|
} else {
|
|
nVar.g(obj3, dVar, xVar, gVar);
|
|
}
|
|
i++;
|
|
} catch (Exception e3) {
|
|
n(xVar, e3, obj3, i);
|
|
throw null;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
g gVar2 = this._valueTypeSerializer;
|
|
if (gVar2 != null) {
|
|
int length3 = objArr.length;
|
|
try {
|
|
l lVar = this._dynamicSerializers;
|
|
obj2 = null;
|
|
while (i < length3) {
|
|
try {
|
|
obj2 = objArr[i];
|
|
if (obj2 == null) {
|
|
xVar.l(dVar);
|
|
} else {
|
|
Class<?> cls = obj2.getClass();
|
|
n<Object> c = lVar.c(cls);
|
|
if (c == null && lVar != (b2 = lVar.b(cls, (c = xVar.n(cls, this._property))))) {
|
|
this._dynamicSerializers = b2;
|
|
}
|
|
c.g(obj2, dVar, xVar, gVar2);
|
|
}
|
|
i++;
|
|
} catch (Exception e4) {
|
|
e2 = e4;
|
|
n(xVar, e2, obj2, i);
|
|
throw null;
|
|
}
|
|
}
|
|
} catch (Exception e5) {
|
|
e2 = e5;
|
|
obj2 = null;
|
|
}
|
|
} else {
|
|
try {
|
|
l lVar2 = this._dynamicSerializers;
|
|
obj = null;
|
|
while (i < length) {
|
|
try {
|
|
obj = objArr[i];
|
|
if (obj == null) {
|
|
xVar.l(dVar);
|
|
} else {
|
|
Class<?> cls2 = obj.getClass();
|
|
n<Object> c2 = lVar2.c(cls2);
|
|
if (c2 == null) {
|
|
if (this._elementType.r()) {
|
|
l.d a = lVar2.a(xVar.k(this._elementType, cls2), xVar, this._property);
|
|
l lVar3 = a.f705b;
|
|
if (lVar2 != lVar3) {
|
|
this._dynamicSerializers = lVar3;
|
|
}
|
|
c2 = a.a;
|
|
} else {
|
|
c2 = xVar.n(cls2, this._property);
|
|
l b3 = lVar2.b(cls2, c2);
|
|
if (lVar2 != b3) {
|
|
this._dynamicSerializers = b3;
|
|
}
|
|
}
|
|
}
|
|
c2.f(obj, dVar, xVar);
|
|
}
|
|
i++;
|
|
} catch (Exception e6) {
|
|
e = e6;
|
|
n(xVar, e, obj, i);
|
|
throw null;
|
|
}
|
|
}
|
|
} catch (Exception e7) {
|
|
e = e7;
|
|
obj = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|