Annotate Object#equals parameter with @Nullable
Closes gh-23093
This commit is contained in:
@@ -519,10 +519,10 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable 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
|
||||
@@ -573,7 +573,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ package org.springframework.jms.support;
|
||||
|
||||
import javax.jms.Message;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Gather the Quality-of-Service settings that can be used when sending a message.
|
||||
*
|
||||
@@ -108,7 +110,7 @@ public class QosSettings {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user