Add missing @Override annotations

This commit is contained in:
Sam Brannen
2019-08-22 14:48:08 +02:00
parent 0b63db26b7
commit ad6231ad29
108 changed files with 321 additions and 0 deletions

View File

@@ -220,35 +220,43 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
// Delegating Map implementation
@Override
public boolean containsKey(Object key) {
return this.headers.containsKey(key);
}
@Override
public boolean containsValue(Object value) {
return this.headers.containsValue(value);
}
@Override
public Set<Map.Entry<String, Object>> entrySet() {
return Collections.unmodifiableMap(this.headers).entrySet();
}
@Override
@Nullable
public Object get(Object key) {
return this.headers.get(key);
}
@Override
public boolean isEmpty() {
return this.headers.isEmpty();
}
@Override
public Set<String> keySet() {
return Collections.unmodifiableSet(this.headers.keySet());
}
@Override
public int size() {
return this.headers.size();
}
@Override
public Collection<Object> values() {
return Collections.unmodifiableCollection(this.headers.values());
}
@@ -260,6 +268,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
* Since MessageHeaders are immutable, the call to this method
* will result in {@link UnsupportedOperationException}.
*/
@Override
public Object put(String key, Object value) {
throw new UnsupportedOperationException("MessageHeaders is immutable");
}
@@ -268,6 +277,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
* Since MessageHeaders are immutable, the call to this method
* will result in {@link UnsupportedOperationException}.
*/
@Override
public void putAll(Map<? extends String, ? extends Object> map) {
throw new UnsupportedOperationException("MessageHeaders is immutable");
}
@@ -276,6 +286,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
* Since MessageHeaders are immutable, the call to this method
* will result in {@link UnsupportedOperationException}.
*/
@Override
public Object remove(Object key) {
throw new UnsupportedOperationException("MessageHeaders is immutable");
}
@@ -284,6 +295,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
* Since MessageHeaders are immutable, the call to this method
* will result in {@link UnsupportedOperationException}.
*/
@Override
public void clear() {
throw new UnsupportedOperationException("MessageHeaders is immutable");
}

View File

@@ -303,6 +303,7 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
}
@Override
protected List<HandlerMethodArgumentResolver> initArgumentResolvers() {
ApplicationContext context = getApplicationContext();
ConfigurableBeanFactory beanFactory = (context instanceof ConfigurableApplicationContext ?

View File

@@ -59,6 +59,7 @@ class OrderedMessageSender implements MessageChannel {
}
@Override
public boolean send(Message<?> message) {
return send(message, -1);
}

View File

@@ -231,6 +231,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration {
}
@Override
protected StompBrokerRelayMessageHandler getMessageHandler(SubscribableChannel brokerChannel) {
StompBrokerRelayMessageHandler handler = new StompBrokerRelayMessageHandler(

View File

@@ -689,8 +689,10 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
if (conn != null) {
conn.send(HEARTBEAT).addCallback(
new ListenableFutureCallback<Void>() {
@Override
public void onSuccess(@Nullable Void result) {
}
@Override
public void onFailure(Throwable ex) {
handleFailure(ex);
}

View File

@@ -1086,6 +1086,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
return this.disconnect.get();
}
@Override
public String toString() {
return (connectionHandlers.size() + " sessions, " + getTcpClientInfo() +
(isBrokerAvailable() ? " (available)" : " (not available)") +

View File

@@ -53,6 +53,7 @@ public class StompReactorNettyCodec extends AbstractNioBufferReactorNettyCodec<b
return this.decoder.decode(nioBuffer);
}
@Override
protected ByteBuffer encodeInternal(Message<byte[]> message) {
return ByteBuffer.wrap(this.encoder.encode(message));
}

View File

@@ -47,6 +47,7 @@ public abstract class ChannelInterceptorAdapter implements ChannelInterceptor {
public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, @Nullable Exception ex) {
}
@Override
public boolean preReceive(MessageChannel channel) {
return true;
}

View File

@@ -77,15 +77,18 @@ public class GenericMessage<T> implements Message<T>, Serializable {
}
@Override
public T getPayload() {
return this.payload;
}
@Override
public MessageHeaders getHeaders() {
return this.headers;
}
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
@@ -98,11 +101,13 @@ public class GenericMessage<T> implements Message<T>, Serializable {
return (ObjectUtils.nullSafeEquals(this.payload, otherMsg.payload) && this.headers.equals(otherMsg.headers));
}
@Override
public int hashCode() {
// Using nullSafeHashCode for proper array hashCode handling
return (ObjectUtils.nullSafeHashCode(this.payload) * 23 + this.headers.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder(getClass().getSimpleName());
sb.append(" [payload=");

View File

@@ -190,6 +190,7 @@ public class MethodMessageHandlerTests {
super.detectHandlerMethods(handler);
}
@Override
public void registerHandlerMethod(Object handler, Method method, String mapping) {
super.registerHandlerMethod(handler, method, mapping);
}