Fix some compiler smells for Java 21

This commit is contained in:
Artem Bilan
2024-09-24 14:33:16 -04:00
parent fc377126de
commit 8082f3c3f9
25 changed files with 160 additions and 298 deletions

View File

@@ -114,6 +114,7 @@ public class AmqpInboundGateway extends MessagingGatewaySupport {
private AmqpInboundGateway(MessageListenerContainer listenerContainer, AmqpTemplate amqpTemplate,
boolean amqpTemplateExplicitlySet) {
Assert.notNull(listenerContainer, "listenerContainer must not be null");
Assert.notNull(amqpTemplate, "'amqpTemplate' must not be null");
Assert.isNull(listenerContainer.getMessageListener(),
@@ -194,7 +195,7 @@ public class AmqpInboundGateway extends MessagingGatewaySupport {
* @since 4.3.10
* @see #setRetryTemplate(RetryTemplate)
*/
public void setRecoveryCallback(RecoveryCallback<? extends Object> recoveryCallback) {
public void setRecoveryCallback(RecoveryCallback<?> recoveryCallback) {
this.recoveryCallback = recoveryCallback;
}
@@ -341,6 +342,9 @@ public class AmqpInboundGateway extends MessagingGatewaySupport {
protected class Listener implements ChannelAwareMessageListener {
protected Listener() {
}
@SuppressWarnings("unchecked")
@Override
public void onMessage(final Message message, final Channel channel) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 the original author or authors.
* Copyright 2019-2024 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.
@@ -38,7 +38,7 @@ public class ManualAckListenerExecutionFailedException extends ListenerExecution
@Serial
private static final long serialVersionUID = 1L;
private final Channel channel;
private final transient Channel channel;
private final long deliveryTag;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 the original author or authors.
* Copyright 2017-2024 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.
@@ -25,6 +25,8 @@ import org.springframework.messaging.MessagingException;
* publisher confirm.
*
* @author Gary Russell
* @author Artem Bilan
*
* @since 4.3.12
*
*/
@@ -32,10 +34,11 @@ public class NackedAmqpMessageException extends MessagingException {
private static final long serialVersionUID = 1L;
private final Object correlationData;
private final String nackReason;
@SuppressWarnings("serial")
private final Object correlationData;
public NackedAmqpMessageException(Message<?> message, @Nullable Object correlationData, String nackReason) {
super(message);
this.correlationData = correlationData;