Fixed event listener caching through equals/hashCode on SyntheticParameterizedType

Issue: SPR-13540
This commit is contained in:
Juergen Hoeller
2015-10-06 00:05:51 +02:00
parent 668f5db582
commit 427767f21e
4 changed files with 74 additions and 18 deletions

View File

@@ -60,7 +60,7 @@ public abstract class AbstractApplicationEventMulticaster
private final ListenerRetriever defaultRetriever = new ListenerRetriever(false);
private final Map<ListenerCacheKey, ListenerRetriever> retrieverCache =
final Map<ListenerCacheKey, ListenerRetriever> retrieverCache =
new ConcurrentHashMap<ListenerCacheKey, ListenerRetriever>(64);
private ClassLoader beanClassLoader;
@@ -303,13 +303,13 @@ public abstract class AbstractApplicationEventMulticaster
return true;
}
ListenerCacheKey otherKey = (ListenerCacheKey) other;
return ObjectUtils.nullSafeEquals(this.eventType, otherKey.eventType) &&
ObjectUtils.nullSafeEquals(this.sourceType, otherKey.sourceType);
return (ObjectUtils.nullSafeEquals(this.eventType, otherKey.eventType) &&
ObjectUtils.nullSafeEquals(this.sourceType, otherKey.sourceType));
}
@Override
public int hashCode() {
return ObjectUtils.nullSafeHashCode(this.eventType) * 29 + ObjectUtils.nullSafeHashCode(this.sourceType);
return (ObjectUtils.nullSafeHashCode(this.eventType) * 29 + ObjectUtils.nullSafeHashCode(this.sourceType));
}
}