Ensure when equals() is implemented so is hashCode()
Update classes that override `equals()` to ensure that they also implement `hashCode()`. Issue: SPR-16968
This commit is contained in:
committed by
Juergen Hoeller
parent
9de3689f63
commit
634f5c2792
@@ -580,6 +580,16 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
|
||||
this.durable == otherKey.durable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int prime = 31;
|
||||
int result = ObjectUtils.nullSafeHashCode(this.selector);
|
||||
result = prime * result + ObjectUtils.nullSafeHashCode(this.noLocal);
|
||||
result = prime * result + ObjectUtils.nullSafeHashCode(this.subscription);
|
||||
result = prime * result + Boolean.hashCode(this.durable);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " [selector=" + this.selector + ", noLocal=" + this.noLocal +
|
||||
|
||||
Reference in New Issue
Block a user