Polishing

This commit is contained in:
Juergen Hoeller
2019-06-11 23:50:29 +02:00
parent 22aba8bf60
commit 33b5bc2aae
8 changed files with 60 additions and 54 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -522,7 +522,8 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
public boolean equals(Object other) {
// Effectively checking object equality as well as toString equality.
// On WebSphere MQ, Destination objects do not implement equals...
return (this == other || destinationEquals((DestinationCacheKey) other));
return (this == other || (other instanceof DestinationCacheKey &&
destinationEquals((DestinationCacheKey) other)));
}
@Override
@@ -577,6 +578,9 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
if (this == other) {
return true;
}
if (!(other instanceof ConsumerCacheKey)) {
return false;
}
ConsumerCacheKey otherKey = (ConsumerCacheKey) other;
return (destinationEquals(otherKey) &&
ObjectUtils.nullSafeEquals(this.selector, otherKey.selector) &&