From ab2949f2b7149db155cdee661a4ce1baf3362ef0 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 2 Dec 2013 14:47:44 -0800 Subject: [PATCH] Fix ResolvableType hashCode generation Fix ResolvableType.hashCode() to use the source of the variable resolver, rather than the resolver itself. --- .../src/main/java/org/springframework/core/ResolvableType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/core/ResolvableType.java b/spring-core/src/main/java/org/springframework/core/ResolvableType.java index 280d20e459..56a5599563 100644 --- a/spring-core/src/main/java/org/springframework/core/ResolvableType.java +++ b/spring-core/src/main/java/org/springframework/core/ResolvableType.java @@ -690,7 +690,8 @@ public final class ResolvableType implements Serializable { @Override public int hashCode() { int hashCode = ObjectUtils.nullSafeHashCode(this.type); - hashCode = hashCode * 31 + ObjectUtils.nullSafeHashCode(this.variableResolver); + hashCode = hashCode * 31 + ObjectUtils.nullSafeHashCode( + this.variableResolver == null ? null : this.variableResolver.getSource()); hashCode = hashCode * 31 + ObjectUtils.nullSafeHashCode(this.componentType); return hashCode; }