Annotate Object#equals parameter with @Nullable

Closes gh-23093
This commit is contained in:
Sebastien Deleuze
2019-06-06 14:18:12 +02:00
parent 33becd8258
commit 098ac0bbb8
158 changed files with 222 additions and 176 deletions

View File

@@ -320,7 +320,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
// equals, hashCode, toString
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other ||
(other instanceof MessageHeaders && this.headers.equals(((MessageHeaders) other).headers)));
}

View File

@@ -21,6 +21,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
@@ -126,7 +127,7 @@ public class CompositeMessageCondition implements MessageCondition<CompositeMess
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -303,7 +303,7 @@ public class HandlerMethod {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -77,7 +77,7 @@ public class SimpMessageMappingInfo implements MessageCondition<SimpMessageMappi
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -512,7 +512,7 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof Subscription && this.id.equals(((Subscription) other).id)));
}

View File

@@ -552,7 +552,7 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof StompHeaders &&
this.headers.equals(((StompHeaders) other).headers)));
}

View File

@@ -357,7 +357,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof SimpUser && this.name.equals(((SimpUser) other).getName())));
}
@@ -441,7 +441,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof SimpSession && getId().equals(((SimpSession) other).getId())));
}
@@ -515,7 +515,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -19,6 +19,7 @@ package org.springframework.messaging.support;
import java.io.Serializable;
import java.util.Map;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.util.Assert;
@@ -85,7 +86,7 @@ public class GenericMessage<T> implements Message<T>, Serializable {
}
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}