Browse Source

Hoist constant result of SerializableTypeWrapper.unwrap() out of loop

pull/24172/head
stsypanov 5 years ago committed by Juergen Hoeller
parent
commit
ebbb562cb9
  1. 2
      spring-core/src/main/java/org/springframework/core/ResolvableType.java

2
spring-core/src/main/java/org/springframework/core/ResolvableType.java

@ -1496,9 +1496,9 @@ public class ResolvableType implements Serializable { @@ -1496,9 +1496,9 @@ public class ResolvableType implements Serializable {
@Override
@Nullable
public ResolvableType resolveVariable(TypeVariable<?> variable) {
TypeVariable<?> v2 = SerializableTypeWrapper.unwrap(variable);
for (int i = 0; i < this.variables.length; i++) {
TypeVariable<?> v1 = SerializableTypeWrapper.unwrap(this.variables[i]);
TypeVariable<?> v2 = SerializableTypeWrapper.unwrap(variable);
if (ObjectUtils.nullSafeEquals(v1, v2)) {
return this.generics[i];
}

Loading…
Cancel
Save