package com.alibaba.fastjson.util; import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.PropertyNamingStrategy; import com.alibaba.fastjson.annotation.JSONCreator; import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONPOJOBuilder; import com.alibaba.fastjson.annotation.JSONType; import com.alibaba.fastjson.parser.Feature; import com.alibaba.fastjson.serializer.SerializerFeature; import com.umeng.analytics.pro.am; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; public class JavaBeanInfo { public final Method buildMethod; public final Class<?> builderClass; public final Class<?> clazz; public final Constructor<?> creatorConstructor; public Type[] creatorConstructorParameterTypes; public String[] creatorConstructorParameters; public final Constructor<?> defaultConstructor; public final int defaultConstructorParameterSize; public final Method factoryMethod; public final FieldInfo[] fields; public final JSONType jsonType; /* renamed from: kotlin reason: collision with root package name */ public boolean f93kotlin; public Constructor<?> kotlinDefaultConstructor; public String[] orders; public final int parserFeatures; public final FieldInfo[] sortedFields; public final String typeKey; public final String typeName; public JavaBeanInfo(Class<?> cls, Class<?> cls2, Constructor<?> constructor, Constructor<?> constructor2, Method method, Method method2, JSONType jSONType, List<FieldInfo> list) { JSONField jSONField; this.clazz = cls; this.builderClass = cls2; this.defaultConstructor = constructor; this.creatorConstructor = constructor2; this.factoryMethod = method; this.parserFeatures = TypeUtils.getParserFeatures(cls); this.buildMethod = method2; this.jsonType = jSONType; if (jSONType != null) { String typeName2 = jSONType.typeName(); String typeKey2 = jSONType.typeKey(); this.typeKey = typeKey2.length() <= 0 ? null : typeKey2; if (typeName2.length() != 0) { this.typeName = typeName2; } else { this.typeName = cls.getName(); } String[] orders2 = jSONType.orders(); this.orders = orders2.length == 0 ? null : orders2; } else { this.typeName = cls.getName(); this.typeKey = null; this.orders = null; } FieldInfo[] fieldInfoArr = new FieldInfo[list.size()]; this.fields = fieldInfoArr; list.toArray(fieldInfoArr); FieldInfo[] fieldInfoArr2 = new FieldInfo[fieldInfoArr.length]; boolean z = false; if (this.orders != null) { LinkedHashMap linkedHashMap = new LinkedHashMap(list.size()); for (FieldInfo fieldInfo : fieldInfoArr) { linkedHashMap.put(fieldInfo.name, fieldInfo); } String[] strArr = this.orders; int i = 0; for (String str : strArr) { FieldInfo fieldInfo2 = (FieldInfo) linkedHashMap.get(str); if (fieldInfo2 != null) { fieldInfoArr2[i] = fieldInfo2; linkedHashMap.remove(str); i++; } } for (FieldInfo fieldInfo3 : linkedHashMap.values()) { fieldInfoArr2[i] = fieldInfo3; i++; } } else { System.arraycopy(fieldInfoArr, 0, fieldInfoArr2, 0, fieldInfoArr.length); Arrays.sort(fieldInfoArr2); } this.sortedFields = Arrays.equals(this.fields, fieldInfoArr2) ? this.fields : fieldInfoArr2; if (constructor != null) { this.defaultConstructorParameterSize = constructor.getParameterTypes().length; } else if (method != null) { this.defaultConstructorParameterSize = method.getParameterTypes().length; } else { this.defaultConstructorParameterSize = 0; } if (constructor2 != null) { this.creatorConstructorParameterTypes = constructor2.getParameterTypes(); boolean isKotlin = TypeUtils.isKotlin(cls); this.f93kotlin = isKotlin; if (isKotlin) { this.creatorConstructorParameters = TypeUtils.getKoltinConstructorParameters(cls); try { this.kotlinDefaultConstructor = cls.getConstructor(new Class[0]); } catch (Throwable unused) { } Annotation[][] parameterAnnotations = TypeUtils.getParameterAnnotations(constructor2); int i2 = 0; while (i2 < this.creatorConstructorParameters.length && i2 < parameterAnnotations.length) { Annotation[] annotationArr = parameterAnnotations[i2]; int length = annotationArr.length; int i3 = 0; while (true) { if (i3 >= length) { jSONField = null; break; } Annotation annotation = annotationArr[i3]; if (annotation instanceof JSONField) { jSONField = (JSONField) annotation; break; } i3++; } if (jSONField != null) { String name = jSONField.name(); if (name.length() > 0) { this.creatorConstructorParameters[i2] = name; } } i2++; } return; } if (this.creatorConstructorParameterTypes.length == this.fields.length) { int i4 = 0; while (true) { Type[] typeArr = this.creatorConstructorParameterTypes; if (i4 >= typeArr.length) { z = true; break; } else if (typeArr[i4] != this.fields[i4].fieldClass) { break; } else { i4++; } } } if (!z) { this.creatorConstructorParameters = ASMUtils.lookupParameterNames(constructor2); } } } private static FieldInfo getField(List<FieldInfo> list, String str) { for (FieldInfo fieldInfo : list) { if (fieldInfo.name.equals(str)) { return fieldInfo; } Field field = fieldInfo.field; if (!(field == null || fieldInfo.getAnnotation() == null || !field.getName().equals(str))) { return fieldInfo; } } return null; } static boolean add(List<FieldInfo> list, FieldInfo fieldInfo) { for (int size = list.size() - 1; size >= 0; size--) { FieldInfo fieldInfo2 = list.get(size); if (fieldInfo2.name.equals(fieldInfo.name) && (!fieldInfo2.getOnly || fieldInfo.getOnly)) { if (fieldInfo2.fieldClass.isAssignableFrom(fieldInfo.fieldClass)) { list.set(size, fieldInfo); return true; } else if (fieldInfo2.compareTo(fieldInfo) >= 0) { return false; } else { list.set(size, fieldInfo); return true; } } } list.add(fieldInfo); return true; } public static JavaBeanInfo build(Class<?> cls, Type type, PropertyNamingStrategy propertyNamingStrategy) { return build(cls, type, propertyNamingStrategy, false, TypeUtils.compatibleWithJavaBean, false); } private static Map<TypeVariable, Type> buildGenericInfo(Class<?> cls) { Class<? super Object> superclass = cls.getSuperclass(); HashMap hashMap = null; if (superclass == null) { return null; } while (true) { cls = superclass; if (cls == null || cls == Object.class) { return hashMap; } if (cls.getGenericSuperclass() instanceof ParameterizedType) { Type[] actualTypeArguments = ((ParameterizedType) cls.getGenericSuperclass()).getActualTypeArguments(); TypeVariable<Class<?>>[] typeParameters = cls.getTypeParameters(); for (int i = 0; i < actualTypeArguments.length; i++) { if (hashMap == null) { hashMap = new HashMap(); } if (hashMap.containsKey(actualTypeArguments[i])) { hashMap.put(typeParameters[i], hashMap.get(actualTypeArguments[i])); } else { hashMap.put(typeParameters[i], actualTypeArguments[i]); } } } superclass = cls.getSuperclass(); } return hashMap; } public static JavaBeanInfo build(Class<?> cls, Type type, PropertyNamingStrategy propertyNamingStrategy, boolean z, boolean z2) { return build(cls, type, propertyNamingStrategy, z, z2, false); } /* JADX WARNING: Code restructure failed: missing block: B:366:0x0818, code lost: if (r4 == null) goto L_0x081a; */ /* JADX WARNING: Removed duplicated region for block: B:162:0x030a */ /* JADX WARNING: Removed duplicated region for block: B:163:0x0310 */ /* JADX WARNING: Removed duplicated region for block: B:203:0x0407 */ /* JADX WARNING: Removed duplicated region for block: B:206:0x040e */ /* JADX WARNING: Removed duplicated region for block: B:276:0x05ef */ /* JADX WARNING: Removed duplicated region for block: B:281:0x0601 */ /* JADX WARNING: Removed duplicated region for block: B:379:0x085d */ /* JADX WARNING: Removed duplicated region for block: B:382:0x0864 */ /* JADX WARNING: Removed duplicated region for block: B:387:0x0891 */ /* JADX WARNING: Removed duplicated region for block: B:397:0x0913 */ /* JADX WARNING: Removed duplicated region for block: B:400:0x0928 */ /* JADX WARNING: Removed duplicated region for block: B:405:0x0972 */ /* JADX WARNING: Removed duplicated region for block: B:457:0x0ab4 */ /* JADX WARNING: Removed duplicated region for block: B:504:0x0954 A[EDGE_INSN: B:504:0x0954->B:403:0x0954 ?: BREAK , SYNTHETIC] */ public static JavaBeanInfo build(Class<?> cls, Type type, PropertyNamingStrategy propertyNamingStrategy, boolean z, boolean z2, boolean z3) { Constructor<?> constructor; JSONType jSONType; PropertyNamingStrategy propertyNamingStrategy2; Constructor<?> constructor2; Method[] methodArr; Method method; ArrayList arrayList; String str; PropertyNamingStrategy propertyNamingStrategy3; Field[] fieldArr; Method method2; ArrayList arrayList2; Class<?> cls2; char c; int length; int i; String str2; int i2; int length2; int i3; PropertyNamingStrategy propertyNamingStrategy4; Field[] fieldArr2; int i4; int i5; String str3; Method[] methodArr2; JSONField jSONField; Field[] fieldArr3; Field field; String str4; PropertyNamingStrategy propertyNamingStrategy5; String str5; Method[] methodArr3; int i6; int i7; Class<?> cls3; int i8; ArrayList arrayList3; Field[] fieldArr4; int i9; Field field2; String str6; Field field3; Field[] fieldArr5; JSONField jSONField2; int i10; int i11; String str7; PropertyNamingStrategy propertyNamingStrategy6; Class<?> cls4; Field[] fieldArr6; Method[] methodArr4; int i12; int i13; Method method3; String str8; ArrayList arrayList4; String str9; String str10; int i14; int i15; int i16; String str11; StringBuilder sb; char charAt; String[] strArr; JSONField jSONField3; int i17; int i18; int i19; String[] lookupParameterNames; String[] strArr2; JSONField jSONField4; int i20; int i21; int i22; String str12; Annotation[][] annotationArr; JSONField jSONField5; int i23; int i24; int i25; String str13; Field field4; Field field5; String[] strArr3; Field field6; Constructor<?> constructor3; PropertyNamingStrategy naming; Class<?> cls5 = cls; boolean z4 = z3; JSONType jSONType2 = (JSONType) TypeUtils.getAnnotation(cls5, JSONType.class); PropertyNamingStrategy propertyNamingStrategy7 = (jSONType2 == null || (naming = jSONType2.naming()) == null || naming == PropertyNamingStrategy.CamelCase) ? propertyNamingStrategy : naming; Class<?> builderClass2 = getBuilderClass(cls5, jSONType2); Field[] declaredFields = cls.getDeclaredFields(); Method[] methods = cls.getMethods(); Map<TypeVariable, Type> buildGenericInfo = buildGenericInfo(cls); boolean isKotlin = TypeUtils.isKotlin(cls); Constructor<?>[] declaredConstructors = cls.getDeclaredConstructors(); if (!isKotlin || declaredConstructors.length == 1) { if (builderClass2 == null) { constructor3 = getDefaultConstructor(cls5, declaredConstructors); } else { constructor3 = getDefaultConstructor(builderClass2, builderClass2.getDeclaredConstructors()); } constructor = constructor3; } else { constructor = null; } Method method4 = null; ArrayList arrayList5 = new ArrayList(); if (z) { for (Class<?> cls6 = cls5; cls6 != null; cls6 = cls6.getSuperclass()) { computeFields(cls5, type, propertyNamingStrategy7, arrayList5, cls6.getDeclaredFields()); } if (constructor != null) { TypeUtils.setAccessible(constructor); } return new JavaBeanInfo(cls, builderClass2, constructor, null, null, null, jSONType2, arrayList5); } boolean z5 = cls.isInterface() || Modifier.isAbstract(cls.getModifiers()); if (!(constructor == null && builderClass2 == null) && !z5) { propertyNamingStrategy2 = propertyNamingStrategy7; jSONType = jSONType2; arrayList = arrayList5; methodArr = methods; constructor2 = null; } else { constructor2 = getCreatorConstructor(declaredConstructors); if (constructor2 == null || z5) { propertyNamingStrategy2 = propertyNamingStrategy7; jSONType = jSONType2; arrayList = arrayList5; methodArr = methods; method = getFactoryMethod(cls5, methodArr, z4); if (method != null) { TypeUtils.setAccessible(method); Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length > 0) { Annotation[][] parameterAnnotations = TypeUtils.getParameterAnnotations(method); String[] strArr4 = null; int i26 = 0; while (i26 < parameterTypes.length) { Annotation[] annotationArr2 = parameterAnnotations[i26]; int length3 = annotationArr2.length; int i27 = 0; while (true) { if (i27 >= length3) { jSONField4 = null; break; } Annotation annotation = annotationArr2[i27]; if (annotation instanceof JSONField) { jSONField4 = (JSONField) annotation; break; } i27++; } if (jSONField4 != null || (z4 && TypeUtils.isJacksonCreator(method))) { if (jSONField4 != null) { str12 = jSONField4.name(); int ordinal = jSONField4.ordinal(); int of = SerializerFeature.of(jSONField4.serialzeFeatures()); i22 = ordinal; i20 = Feature.of(jSONField4.parseFeatures()); i21 = of; } else { str12 = null; i22 = 0; i21 = 0; i20 = 0; } if (str12 == null || str12.length() == 0) { if (strArr4 == null) { strArr4 = ASMUtils.lookupParameterNames(method); } str12 = strArr4[i26]; } add(arrayList, new FieldInfo(str12, cls, parameterTypes[i26], method.getGenericParameterTypes()[i26], TypeUtils.getField(cls5, str12, declaredFields), i22, i21, i20)); i26++; z4 = z3; parameterTypes = parameterTypes; strArr4 = strArr4; } else { throw new JSONException("illegal json creator"); } } return new JavaBeanInfo(cls, builderClass2, null, null, method, null, jSONType, arrayList); } } else if (!z5) { String name = cls.getName(); if (!isKotlin || declaredConstructors.length <= 0) { String[] strArr5 = null; for (Constructor<?> constructor4 : declaredConstructors) { Class<?>[] parameterTypes2 = constructor4.getParameterTypes(); if (name.equals("org.springframework.security.web.authentication.WebAuthenticationDetails")) { if (parameterTypes2.length == 2) { if (parameterTypes2[0] == String.class && parameterTypes2[1] == String.class) { constructor4.setAccessible(true); strArr2 = ASMUtils.lookupParameterNames(constructor4); } } } else if (name.equals("org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken")) { if (parameterTypes2.length == 3 && parameterTypes2[0] == Object.class) { if (parameterTypes2[1] == Object.class && parameterTypes2[2] == Collection.class) { constructor4.setAccessible(true); strArr = new String[]{"principal", "credentials", "authorities"}; constructor2 = constructor4; } } } else { if (!name.equals("org.springframework.security.core.authority.SimpleGrantedAuthority")) { if (((constructor4.getModifiers() & 1) != 0) && (lookupParameterNames = ASMUtils.lookupParameterNames(constructor4)) != null && lookupParameterNames.length != 0 && (constructor2 == null || strArr5 == null || lookupParameterNames.length > strArr5.length)) { constructor2 = constructor4; strArr5 = lookupParameterNames; } } else if (parameterTypes2.length == 1) { if (parameterTypes2[0] == String.class) { strArr2 = new String[]{"authority"}; } } } strArr = strArr2; constructor2 = constructor4; break; } strArr = strArr5; Class<?>[] parameterTypes3 = strArr == null ? constructor2.getParameterTypes() : null; if (strArr == null && parameterTypes3.length == strArr.length) { Annotation[][] parameterAnnotations2 = TypeUtils.getParameterAnnotations(constructor2); int i28 = 0; while (i28 < parameterTypes3.length) { Annotation[] annotationArr3 = parameterAnnotations2[i28]; String str14 = strArr[i28]; int length4 = annotationArr3.length; int i29 = 0; while (true) { if (i29 >= length4) { jSONField3 = null; break; } Annotation annotation2 = annotationArr3[i29]; if (annotation2 instanceof JSONField) { jSONField3 = (JSONField) annotation2; break; } i29++; } Class<?> cls7 = parameterTypes3[i28]; Type type2 = constructor2.getGenericParameterTypes()[i28]; Field field7 = TypeUtils.getField(cls5, str14, declaredFields); if (field7 != null && jSONField3 == null) { jSONField3 = (JSONField) TypeUtils.getAnnotation(field7, JSONField.class); } if (jSONField3 != null) { String name2 = jSONField3.name(); if (name2.length() != 0) { str14 = name2; } int ordinal2 = jSONField3.ordinal(); int of2 = SerializerFeature.of(jSONField3.serialzeFeatures()); i17 = Feature.of(jSONField3.parseFeatures()); i18 = of2; i19 = ordinal2; } else if (!"org.springframework.security.core.userdetails.User".equals(name) || !"password".equals(str14)) { i19 = 0; i18 = 0; i17 = 0; } else { i17 = Feature.InitStringFieldAsEmpty.mask; i19 = 0; i18 = 0; } add(arrayList, new FieldInfo(str14, cls, cls7, type2, field7, i19, i18, i17)); i28++; name = name; strArr = strArr; parameterTypes3 = parameterTypes3; } if (!isKotlin && !cls.getName().equals("javax.servlet.http.Cookie")) { return new JavaBeanInfo(cls, builderClass2, null, constructor2, null, null, jSONType, arrayList); } } else { throw new JSONException("default constructor not found. " + cls5); } } else { String[] koltinConstructorParameters = TypeUtils.getKoltinConstructorParameters(cls); Constructor<?> kotlinConstructor = TypeUtils.getKotlinConstructor(declaredConstructors, koltinConstructorParameters); TypeUtils.setAccessible(kotlinConstructor); constructor2 = kotlinConstructor; strArr = koltinConstructorParameters; } if (strArr == null) { } if (strArr == null) { } throw new JSONException("default constructor not found. " + cls5); } if (constructor != null) { TypeUtils.setAccessible(constructor); } String str15 = "set"; if (builderClass2 == null) { JSONPOJOBuilder jSONPOJOBuilder = (JSONPOJOBuilder) TypeUtils.getAnnotation(builderClass2, JSONPOJOBuilder.class); String withPrefix = jSONPOJOBuilder != null ? jSONPOJOBuilder.withPrefix() : null; if (withPrefix == null) { withPrefix = "with"; } String str16 = withPrefix; Method[] methods2 = builderClass2.getMethods(); int length5 = methods2.length; int i30 = 0; while (i30 < length5) { Method method5 = methods2[i30]; if (!Modifier.isStatic(method5.getModifiers()) && method5.getReturnType().equals(builderClass2)) { JSONField jSONField6 = (JSONField) TypeUtils.getAnnotation(method5, JSONField.class); if (jSONField6 == null) { jSONField6 = TypeUtils.getSuperMethodAnnotation(cls5, method5); } if (jSONField6 == null) { i13 = i30; i12 = length5; methodArr4 = methods2; str9 = str16; str10 = str15; fieldArr6 = declaredFields; cls4 = builderClass2; method3 = method; propertyNamingStrategy6 = propertyNamingStrategy2; arrayList4 = arrayList; i16 = 0; i15 = 0; i14 = 0; } else if (jSONField6.deserialize()) { int ordinal3 = jSONField6.ordinal(); int of3 = SerializerFeature.of(jSONField6.serialzeFeatures()); int of4 = Feature.of(jSONField6.parseFeatures()); if (jSONField6.name().length() != 0) { i13 = i30; i12 = length5; methodArr4 = methods2; fieldArr6 = declaredFields; cls4 = builderClass2; method3 = method; propertyNamingStrategy6 = propertyNamingStrategy2; arrayList4 = arrayList; add(arrayList4, new FieldInfo(jSONField6.name(), method5, null, cls, type, ordinal3, of3, of4, jSONField6, null, null, buildGenericInfo)); str8 = str16; str7 = str15; i30 = i13 + 1; arrayList = arrayList4; str16 = str8; method = method3; length5 = i12; methods2 = methodArr4; declaredFields = fieldArr6; builderClass2 = cls4; propertyNamingStrategy2 = propertyNamingStrategy6; str15 = str7; } else { i13 = i30; i12 = length5; methodArr4 = methods2; str9 = str16; str10 = str15; fieldArr6 = declaredFields; cls4 = builderClass2; method3 = method; propertyNamingStrategy6 = propertyNamingStrategy2; arrayList4 = arrayList; i16 = ordinal3; i15 = of3; i14 = of4; } } String name3 = method5.getName(); if (name3.startsWith(str10) && name3.length() > 3) { sb = new StringBuilder(name3.substring(3)); } else if (str9.length() == 0) { sb = new StringBuilder(name3); } else { str11 = str9; if (name3.startsWith(str11) && name3.length() > str11.length()) { sb = new StringBuilder(name3.substring(str11.length())); charAt = sb.charAt(0); if (str11.length() == 0 || Character.isUpperCase(charAt)) { sb.setCharAt(0, Character.toLowerCase(charAt)); str8 = str11; str7 = str10; add(arrayList4, new FieldInfo(sb.toString(), method5, null, cls, type, i16, i15, i14, jSONField6, null, null, buildGenericInfo)); i30 = i13 + 1; arrayList = arrayList4; str16 = str8; method = method3; length5 = i12; methods2 = methodArr4; declaredFields = fieldArr6; builderClass2 = cls4; propertyNamingStrategy2 = propertyNamingStrategy6; str15 = str7; } } str8 = str11; str7 = str10; i30 = i13 + 1; arrayList = arrayList4; str16 = str8; method = method3; length5 = i12; methods2 = methodArr4; declaredFields = fieldArr6; builderClass2 = cls4; propertyNamingStrategy2 = propertyNamingStrategy6; str15 = str7; } str11 = str9; charAt = sb.charAt(0); sb.setCharAt(0, Character.toLowerCase(charAt)); str8 = str11; str7 = str10; add(arrayList4, new FieldInfo(sb.toString(), method5, null, cls, type, i16, i15, i14, jSONField6, null, null, buildGenericInfo)); i30 = i13 + 1; arrayList = arrayList4; str16 = str8; method = method3; length5 = i12; methods2 = methodArr4; declaredFields = fieldArr6; builderClass2 = cls4; propertyNamingStrategy2 = propertyNamingStrategy6; str15 = str7; } i13 = i30; i12 = length5; methodArr4 = methods2; str8 = str16; str7 = str15; fieldArr6 = declaredFields; cls4 = builderClass2; method3 = method; propertyNamingStrategy6 = propertyNamingStrategy2; arrayList4 = arrayList; i30 = i13 + 1; arrayList = arrayList4; str16 = str8; method = method3; length5 = i12; methods2 = methodArr4; declaredFields = fieldArr6; builderClass2 = cls4; propertyNamingStrategy2 = propertyNamingStrategy6; str15 = str7; } str = str15; fieldArr = declaredFields; method2 = method; propertyNamingStrategy3 = propertyNamingStrategy2; arrayList2 = arrayList; cls2 = builderClass2; if (cls2 != null) { JSONPOJOBuilder jSONPOJOBuilder2 = (JSONPOJOBuilder) TypeUtils.getAnnotation(cls2, JSONPOJOBuilder.class); String buildMethod2 = jSONPOJOBuilder2 != null ? jSONPOJOBuilder2.buildMethod() : null; if (buildMethod2 == null || buildMethod2.length() == 0) { buildMethod2 = "build"; } c = 0; try { method4 = cls2.getMethod(buildMethod2, new Class[0]); } catch (NoSuchMethodException | SecurityException unused) { } if (method4 == null) { try { method4 = cls2.getMethod("create", new Class[0]); } catch (NoSuchMethodException | SecurityException unused2) { } } if (method4 != null) { TypeUtils.setAccessible(method4); length = methodArr.length; i = 0; while (true) { str2 = "get"; i2 = 4; if (i >= length) { break; } Method method6 = methodArr[i]; int i31 = 0; int i32 = 0; int i33 = 0; String name4 = method6.getName(); if (!Modifier.isStatic(method6.getModifiers())) { Class<?> returnType = method6.getReturnType(); if ((returnType.equals(Void.TYPE) || returnType.equals(method6.getDeclaringClass())) && method6.getDeclaringClass() != Object.class) { Class<?>[] parameterTypes4 = method6.getParameterTypes(); if (parameterTypes4.length != 0 && parameterTypes4.length <= 2) { JSONField jSONField7 = (JSONField) TypeUtils.getAnnotation(method6, JSONField.class); if (jSONField7 != null && parameterTypes4.length == 2 && parameterTypes4[c] == String.class && parameterTypes4[1] == Object.class) { i7 = i; i6 = length; cls3 = cls2; add(arrayList2, new FieldInfo("", method6, null, cls, type, 0, 0, 0, jSONField7, null, null, buildGenericInfo)); } else { i7 = i; i6 = length; cls3 = cls2; if (parameterTypes4.length == 1) { JSONField superMethodAnnotation = jSONField7 == null ? TypeUtils.getSuperMethodAnnotation(cls5, method6) : jSONField7; if (superMethodAnnotation != null || name4.length() >= 4) { if (superMethodAnnotation == null) { i8 = 1; } else if (superMethodAnnotation.deserialize()) { i31 = superMethodAnnotation.ordinal(); int of5 = SerializerFeature.of(superMethodAnnotation.serialzeFeatures()); int of6 = Feature.of(superMethodAnnotation.parseFeatures()); if (superMethodAnnotation.name().length() != 0) { add(arrayList2, new FieldInfo(superMethodAnnotation.name(), method6, null, cls, type, i31, of5, of6, superMethodAnnotation, null, null, buildGenericInfo)); cls5 = cls; methodArr3 = methodArr; propertyNamingStrategy5 = propertyNamingStrategy3; str5 = str; i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } else { i8 = 1; i32 = of5; i33 = of6; } } if ((superMethodAnnotation != null || name4.startsWith(str)) && cls3 == null) { char charAt2 = name4.charAt(3); if (isKotlin) { arrayList3 = new ArrayList(); for (int i34 = 0; i34 < methodArr.length; i34++) { if (methodArr[i34].getName().startsWith(str2)) { arrayList3.add(methodArr[i34].getName()); } } } else { arrayList3 = null; } if (Character.isUpperCase(charAt2) || charAt2 > 512) { i9 = 1; cls5 = cls; fieldArr4 = fieldArr; if (isKotlin) { str6 = TypeUtils.getPropertyNameByMethodName("g" + name4.substring(1)); field2 = null; if (field2 == null) { field2 = TypeUtils.getField(cls5, str6, fieldArr4); } field3 = (field2 == null || parameterTypes4[0] != Boolean.TYPE) ? field2 : TypeUtils.getField(cls5, am.ae + Character.toUpperCase(str6.charAt(0)) + str6.substring(i9), fieldArr4); if (field3 != null) { JSONField jSONField8 = (JSONField) TypeUtils.getAnnotation(field3, JSONField.class); if (jSONField8 == null) { str5 = str; methodArr3 = methodArr; fieldArr5 = fieldArr4; i11 = i32; i10 = i33; } else if (jSONField8.deserialize()) { i31 = jSONField8.ordinal(); int of7 = SerializerFeature.of(jSONField8.serialzeFeatures()); int of8 = Feature.of(jSONField8.parseFeatures()); if (jSONField8.name().length() != 0) { methodArr3 = methodArr; str5 = str; add(arrayList2, new FieldInfo(jSONField8.name(), method6, field3, cls, type, i31, of7, of8, superMethodAnnotation, jSONField8, null, buildGenericInfo)); fieldArr = fieldArr4; } else { str5 = str; methodArr3 = methodArr; fieldArr5 = fieldArr4; i11 = of7; i10 = of8; } } jSONField2 = jSONField8; } else { str5 = str; methodArr3 = methodArr; fieldArr5 = fieldArr4; jSONField2 = null; i11 = i32; i10 = i33; } if (propertyNamingStrategy3 != null) { str6 = propertyNamingStrategy3.translate(str6); } fieldArr = fieldArr5; propertyNamingStrategy5 = propertyNamingStrategy3; add(arrayList2, new FieldInfo(str6, method6, field3, cls, type, i31, i11, i10, superMethodAnnotation, jSONField2, null, buildGenericInfo)); i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } else { if (TypeUtils.compatibleWithJavaBean) { str6 = TypeUtils.decapitalize(name4.substring(3)); } else { str6 = TypeUtils.getPropertyNameByMethodName(name4); } field2 = null; if (field2 == null) { } if (field2 == null) { } if (field3 != null) { } if (propertyNamingStrategy3 != null) { } fieldArr = fieldArr5; propertyNamingStrategy5 = propertyNamingStrategy3; add(arrayList2, new FieldInfo(str6, method6, field3, cls, type, i31, i11, i10, superMethodAnnotation, jSONField2, null, buildGenericInfo)); i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } } else { if (charAt2 != '_') { i9 = 1; cls5 = cls; fieldArr4 = fieldArr; if (charAt2 == 'f') { str6 = name4.substring(3); } else if (name4.length() < 5 || !Character.isUpperCase(name4.charAt(4))) { str6 = name4.substring(3); field2 = TypeUtils.getField(cls5, str6, fieldArr4); } else { str6 = TypeUtils.decapitalize(name4.substring(3)); } field2 = null; } else if (isKotlin) { str6 = arrayList3.contains("g" + name4.substring(i8)) ? name4.substring(3) : am.ae + name4.substring(3); i9 = 1; cls5 = cls; fieldArr4 = fieldArr; field2 = TypeUtils.getField(cls5, str6, fieldArr4); } else { i9 = 1; cls5 = cls; fieldArr4 = fieldArr; String substring = name4.substring(4); Field field8 = TypeUtils.getField(cls5, substring, fieldArr4); if (field8 != null || (field8 = TypeUtils.getField(cls5, (str6 = name4.substring(3)), fieldArr4)) == null) { str6 = substring; } field2 = field8; } if (field2 == null) { } if (field2 == null) { } if (field3 != null) { } if (propertyNamingStrategy3 != null) { } fieldArr = fieldArr5; propertyNamingStrategy5 = propertyNamingStrategy3; add(arrayList2, new FieldInfo(str6, method6, field3, cls, type, i31, i11, i10, superMethodAnnotation, jSONField2, null, buildGenericInfo)); i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } fieldArr = fieldArr4; str5 = str; methodArr3 = methodArr; propertyNamingStrategy5 = propertyNamingStrategy3; i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } else { cls5 = cls; str5 = str; methodArr3 = methodArr; } propertyNamingStrategy5 = propertyNamingStrategy3; i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } } } methodArr3 = methodArr; propertyNamingStrategy5 = propertyNamingStrategy3; str5 = str; i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } } } i7 = i; i6 = length; cls3 = cls2; methodArr3 = methodArr; propertyNamingStrategy5 = propertyNamingStrategy3; str5 = str; i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } boolean z6 = true; PropertyNamingStrategy propertyNamingStrategy8 = propertyNamingStrategy3; int i35 = 3; computeFields(cls5, type, propertyNamingStrategy8, arrayList2, cls.getFields()); Method[] methods3 = cls.getMethods(); length2 = methods3.length; i3 = 0; while (i3 < length2) { Method method7 = methods3[i3]; String name5 = method7.getName(); if (name5.length() >= i2 && !Modifier.isStatic(method7.getModifiers()) && cls2 == null && name5.startsWith(str2) && Character.isUpperCase(name5.charAt(i35)) && method7.getParameterTypes().length == 0 && ((Collection.class.isAssignableFrom(method7.getReturnType()) || Map.class.isAssignableFrom(method7.getReturnType()) || AtomicBoolean.class == method7.getReturnType() || AtomicInteger.class == method7.getReturnType() || AtomicLong.class == method7.getReturnType()) && ((jSONField = (JSONField) TypeUtils.getAnnotation(method7, JSONField.class)) == null || !jSONField.deserialize()))) { if (jSONField == null || jSONField.name().length() <= 0) { str4 = TypeUtils.getPropertyNameByMethodName(name5); fieldArr3 = fieldArr; Field field9 = TypeUtils.getField(cls5, str4, fieldArr3); if (field9 != null) { JSONField jSONField9 = (JSONField) TypeUtils.getAnnotation(field9, JSONField.class); if (jSONField9 == null || jSONField9.deserialize()) { if (Collection.class.isAssignableFrom(method7.getReturnType()) || Map.class.isAssignableFrom(method7.getReturnType())) { field = field9; } } fieldArr2 = fieldArr3; i4 = i3; str3 = str2; i5 = length2; methodArr2 = methods3; propertyNamingStrategy4 = propertyNamingStrategy8; } field = null; } else { str4 = jSONField.name(); field = null; fieldArr3 = fieldArr; } if (propertyNamingStrategy8 != null) { str4 = propertyNamingStrategy8.translate(str4); } if (getField(arrayList2, str4) == null) { fieldArr2 = fieldArr3; i4 = i3; str3 = str2; i5 = length2; methodArr2 = methods3; propertyNamingStrategy4 = propertyNamingStrategy8; add(arrayList2, new FieldInfo(str4, method7, field, cls, type, 0, 0, 0, jSONField, null, null, buildGenericInfo)); i3 = i4 + 1; methods3 = methodArr2; str2 = str3; length2 = i5; fieldArr = fieldArr2; propertyNamingStrategy8 = propertyNamingStrategy4; i2 = 4; i35 = 3; } fieldArr2 = fieldArr3; i4 = i3; str3 = str2; i5 = length2; methodArr2 = methods3; propertyNamingStrategy4 = propertyNamingStrategy8; } else { i4 = i3; str3 = str2; i5 = length2; methodArr2 = methods3; propertyNamingStrategy4 = propertyNamingStrategy8; fieldArr2 = fieldArr; } i3 = i4 + 1; methods3 = methodArr2; str2 = str3; length2 = i5; fieldArr = fieldArr2; propertyNamingStrategy8 = propertyNamingStrategy4; i2 = 4; i35 = 3; } if (arrayList2.size() == 0) { if (!TypeUtils.isXmlField(cls)) { z6 = z; } if (z6) { for (Class<?> cls8 = cls5; cls8 != null; cls8 = cls8.getSuperclass()) { computeFields(cls5, type, propertyNamingStrategy8, arrayList2, fieldArr); } } } return new JavaBeanInfo(cls, cls2, constructor, constructor2, method2, method4, jSONType, arrayList2); } throw new JSONException("buildMethod not found."); } } else { str = str15; fieldArr = declaredFields; method2 = method; propertyNamingStrategy3 = propertyNamingStrategy2; arrayList2 = arrayList; cls2 = builderClass2; } c = 0; length = methodArr.length; i = 0; while (true) { str2 = "get"; i2 = 4; if (i >= length) { } i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } boolean z62 = true; PropertyNamingStrategy propertyNamingStrategy82 = propertyNamingStrategy3; int i352 = 3; computeFields(cls5, type, propertyNamingStrategy82, arrayList2, cls.getFields()); Method[] methods32 = cls.getMethods(); length2 = methods32.length; i3 = 0; while (i3 < length2) { } if (arrayList2.size() == 0) { } return new JavaBeanInfo(cls, cls2, constructor, constructor2, method2, method4, jSONType, arrayList2); } TypeUtils.setAccessible(constructor2); Class<?>[] parameterTypes5 = constructor2.getParameterTypes(); if (parameterTypes5.length > 0) { Annotation[][] parameterAnnotations3 = TypeUtils.getParameterAnnotations(constructor2); String[] strArr6 = null; int i36 = 0; while (i36 < parameterTypes5.length && i36 < parameterAnnotations3.length) { Annotation[] annotationArr4 = parameterAnnotations3[i36]; int length6 = annotationArr4.length; int i37 = 0; while (true) { if (i37 >= length6) { annotationArr = parameterAnnotations3; jSONField5 = null; break; } Annotation annotation3 = annotationArr4[i37]; annotationArr = parameterAnnotations3; if (annotation3 instanceof JSONField) { jSONField5 = (JSONField) annotation3; break; } i37++; parameterAnnotations3 = annotationArr; } Class<?> cls9 = parameterTypes5[i36]; Type type3 = constructor2.getGenericParameterTypes()[i36]; if (jSONField5 != null) { field4 = TypeUtils.getField(cls5, jSONField5.name(), declaredFields); int ordinal4 = jSONField5.ordinal(); i24 = SerializerFeature.of(jSONField5.serialzeFeatures()); i23 = Feature.of(jSONField5.parseFeatures()); String name6 = jSONField5.name(); i25 = ordinal4; str13 = name6; } else { field4 = null; str13 = null; i25 = 0; i24 = 0; i23 = 0; } if (str13 == null || str13.length() == 0) { if (strArr6 == null) { strArr6 = ASMUtils.lookupParameterNames(constructor2); } str13 = strArr6[i36]; } if (field4 == null) { if (strArr6 == null) { if (isKotlin) { strArr6 = TypeUtils.getKoltinConstructorParameters(cls); } else { strArr6 = ASMUtils.lookupParameterNames(constructor2); } } field6 = field4; if (strArr6.length > i36) { strArr3 = strArr6; field5 = TypeUtils.getField(cls5, strArr6[i36], declaredFields); add(arrayList5, new FieldInfo(str13, cls, cls9, type3, field5, i25, i24, i23)); i36++; arrayList5 = arrayList5; methods = methods; propertyNamingStrategy7 = propertyNamingStrategy7; jSONType2 = jSONType2; strArr6 = strArr3; parameterAnnotations3 = annotationArr; } } else { field6 = field4; } field5 = field6; strArr3 = strArr6; add(arrayList5, new FieldInfo(str13, cls, cls9, type3, field5, i25, i24, i23)); i36++; arrayList5 = arrayList5; methods = methods; propertyNamingStrategy7 = propertyNamingStrategy7; jSONType2 = jSONType2; strArr6 = strArr3; parameterAnnotations3 = annotationArr; } } propertyNamingStrategy2 = propertyNamingStrategy7; jSONType = jSONType2; arrayList = arrayList5; methodArr = methods; } method = null; if (constructor != null) { } String str152 = "set"; if (builderClass2 == null) { } c = 0; length = methodArr.length; i = 0; while (true) { str2 = "get"; i2 = 4; if (i >= length) { } i = i7 + 1; cls2 = cls3; length = i6; methodArr = methodArr3; str = str5; propertyNamingStrategy3 = propertyNamingStrategy5; c = 0; } boolean z622 = true; PropertyNamingStrategy propertyNamingStrategy822 = propertyNamingStrategy3; int i3522 = 3; computeFields(cls5, type, propertyNamingStrategy822, arrayList2, cls.getFields()); Method[] methods322 = cls.getMethods(); length2 = methods322.length; i3 = 0; while (i3 < length2) { } if (arrayList2.size() == 0) { } return new JavaBeanInfo(cls, cls2, constructor, constructor2, method2, method4, jSONType, arrayList2); } /* JADX WARNING: Code restructure failed: missing block: B:19:0x0055, code lost: if ((java.util.Map.class.isAssignableFrom(r2) || java.util.Collection.class.isAssignableFrom(r2) || java.util.concurrent.atomic.AtomicLong.class.equals(r2) || java.util.concurrent.atomic.AtomicInteger.class.equals(r2) || java.util.concurrent.atomic.AtomicBoolean.class.equals(r2)) == false) goto L_0x0018; */ private static void computeFields(Class<?> cls, Type type, PropertyNamingStrategy propertyNamingStrategy, List<FieldInfo> list, Field[] fieldArr) { int i; int i2; int i3; int i4; int i5; Map<TypeVariable, Type> buildGenericInfo = buildGenericInfo(cls); int length = fieldArr.length; int i6 = 0; while (i6 < length) { Field field = fieldArr[i6]; int modifiers = field.getModifiers(); if ((modifiers & 8) == 0) { boolean z = true; if ((modifiers & 16) != 0) { Class<?> type2 = field.getType(); } Iterator<FieldInfo> it = list.iterator(); while (true) { if (it.hasNext()) { if (it.next().name.equals(field.getName())) { break; } } else { z = false; break; } } if (!z) { String name = field.getName(); JSONField jSONField = (JSONField) TypeUtils.getAnnotation(field, JSONField.class); if (jSONField == null) { i5 = 0; i4 = 0; i3 = 0; } else if (jSONField.deserialize()) { int ordinal = jSONField.ordinal(); int of = SerializerFeature.of(jSONField.serialzeFeatures()); int of2 = Feature.of(jSONField.parseFeatures()); if (jSONField.name().length() != 0) { name = jSONField.name(); } i5 = ordinal; i4 = of; i3 = of2; } if (propertyNamingStrategy != null) { name = propertyNamingStrategy.translate(name); } i2 = i6; i = length; add(list, new FieldInfo(name, null, field, cls, type, i5, i4, i3, null, jSONField, null, buildGenericInfo)); i6 = i2 + 1; length = i; } } i2 = i6; i = length; i6 = i2 + 1; length = i; } } static Constructor<?> getDefaultConstructor(Class<?> cls, Constructor<?>[] constructorArr) { Constructor<?> constructor = null; if (Modifier.isAbstract(cls.getModifiers())) { return null; } int length = constructorArr.length; int i = 0; while (true) { if (i >= length) { break; } Constructor<?> constructor2 = constructorArr[i]; if (constructor2.getParameterTypes().length == 0) { constructor = constructor2; break; } i++; } if (constructor != null || !cls.isMemberClass() || Modifier.isStatic(cls.getModifiers())) { return constructor; } for (Constructor<?> constructor3 : constructorArr) { Class<?>[] parameterTypes = constructor3.getParameterTypes(); if (parameterTypes.length == 1 && parameterTypes[0].equals(cls.getDeclaringClass())) { return constructor3; } } return constructor; } public static Constructor<?> getCreatorConstructor(Constructor[] constructorArr) { boolean z; Constructor constructor = null; for (Constructor constructor2 : constructorArr) { if (((JSONCreator) constructor2.getAnnotation(JSONCreator.class)) != null) { if (constructor == null) { constructor = constructor2; } else { throw new JSONException("multi-JSONCreator"); } } } if (constructor != null) { return constructor; } for (Constructor constructor3 : constructorArr) { Annotation[][] parameterAnnotations = TypeUtils.getParameterAnnotations(constructor3); if (parameterAnnotations.length != 0) { int length = parameterAnnotations.length; int i = 0; while (true) { z = true; if (i >= length) { break; } Annotation[] annotationArr = parameterAnnotations[i]; int length2 = annotationArr.length; int i2 = 0; while (true) { if (i2 >= length2) { z = false; break; } else if (annotationArr[i2] instanceof JSONField) { break; } else { i2++; } } if (!z) { z = false; break; } i++; } if (!z) { continue; } else if (constructor == null) { constructor = constructor3; } else { throw new JSONException("multi-JSONCreator"); } } } return constructor; } private static Method getFactoryMethod(Class<?> cls, Method[] methodArr, boolean z) { Method method = null; for (Method method2 : methodArr) { if (Modifier.isStatic(method2.getModifiers()) && cls.isAssignableFrom(method2.getReturnType()) && ((JSONCreator) TypeUtils.getAnnotation(method2, JSONCreator.class)) != null) { if (method == null) { method = method2; } else { throw new JSONException("multi-JSONCreator"); } } } if (method != null || !z) { return method; } for (Method method3 : methodArr) { if (TypeUtils.isJacksonCreator(method3)) { return method3; } } return method; } public static Class<?> getBuilderClass(JSONType jSONType) { return getBuilderClass(null, jSONType); } public static Class<?> getBuilderClass(Class<?> cls, JSONType jSONType) { Class<?> builder; if (cls != null && cls.getName().equals("org.springframework.security.web.savedrequest.DefaultSavedRequest")) { return TypeUtils.loadClass("org.springframework.security.web.savedrequest.DefaultSavedRequest$Builder"); } if (jSONType == null || (builder = jSONType.builder()) == Void.class) { return null; } return builder; } }