Replace instance equality checks in $Gson$Types#resolve
This commit is contained in:
parent
e2296f42d5
commit
69f7c4e243
@ -370,7 +370,7 @@ public final class $Gson$Types {
|
|||||||
Class<?> original = (Class<?>) toResolve;
|
Class<?> original = (Class<?>) toResolve;
|
||||||
Type componentType = original.getComponentType();
|
Type componentType = original.getComponentType();
|
||||||
Type newComponentType = resolve(context, contextRawType, componentType, visitedTypeVariables);
|
Type newComponentType = resolve(context, contextRawType, componentType, visitedTypeVariables);
|
||||||
toResolve = componentType == newComponentType
|
toResolve = equal(componentType, newComponentType)
|
||||||
? original
|
? original
|
||||||
: arrayOf(newComponentType);
|
: arrayOf(newComponentType);
|
||||||
break;
|
break;
|
||||||
@ -379,7 +379,7 @@ public final class $Gson$Types {
|
|||||||
GenericArrayType original = (GenericArrayType) toResolve;
|
GenericArrayType original = (GenericArrayType) toResolve;
|
||||||
Type componentType = original.getGenericComponentType();
|
Type componentType = original.getGenericComponentType();
|
||||||
Type newComponentType = resolve(context, contextRawType, componentType, visitedTypeVariables);
|
Type newComponentType = resolve(context, contextRawType, componentType, visitedTypeVariables);
|
||||||
toResolve = componentType == newComponentType
|
toResolve = equal(componentType, newComponentType)
|
||||||
? original
|
? original
|
||||||
: arrayOf(newComponentType);
|
: arrayOf(newComponentType);
|
||||||
break;
|
break;
|
||||||
@ -388,12 +388,12 @@ public final class $Gson$Types {
|
|||||||
ParameterizedType original = (ParameterizedType) toResolve;
|
ParameterizedType original = (ParameterizedType) toResolve;
|
||||||
Type ownerType = original.getOwnerType();
|
Type ownerType = original.getOwnerType();
|
||||||
Type newOwnerType = resolve(context, contextRawType, ownerType, visitedTypeVariables);
|
Type newOwnerType = resolve(context, contextRawType, ownerType, visitedTypeVariables);
|
||||||
boolean changed = newOwnerType != ownerType;
|
boolean changed = !equal(newOwnerType, ownerType);
|
||||||
|
|
||||||
Type[] args = original.getActualTypeArguments();
|
Type[] args = original.getActualTypeArguments();
|
||||||
for (int t = 0, length = args.length; t < length; t++) {
|
for (int t = 0, length = args.length; t < length; t++) {
|
||||||
Type resolvedTypeArgument = resolve(context, contextRawType, args[t], visitedTypeVariables);
|
Type resolvedTypeArgument = resolve(context, contextRawType, args[t], visitedTypeVariables);
|
||||||
if (resolvedTypeArgument != args[t]) {
|
if (!equal(resolvedTypeArgument, args[t])) {
|
||||||
if (!changed) {
|
if (!changed) {
|
||||||
args = args.clone();
|
args = args.clone();
|
||||||
changed = true;
|
changed = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user