Sonar fixes

- remaining hidden fields

* Fix copyright
This commit is contained in:
Gary Russell
2019-01-09 13:30:08 -05:00
committed by Artem Bilan
parent e30741f7eb
commit 2766707547
28 changed files with 280 additions and 272 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 the original author or authors.
* Copyright 2015-2019 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.
@@ -181,7 +181,7 @@ public abstract class AbstractStompSessionManager implements StompSessionManager
this.logger.debug("Aborting connect; another thread is connecting.");
return;
}
final int epoch = this.epoch.get();
final int currentEpoch = this.epoch.get();
this.connecting = true;
if (this.logger.isDebugEnabled()) {
this.logger.debug("Connecting " + this);
@@ -190,7 +190,7 @@ public abstract class AbstractStompSessionManager implements StompSessionManager
this.stompSessionListenableFuture = doConnect(this.compositeStompSessionHandler);
}
catch (Exception e) {
if (epoch == this.epoch.get()) {
if (currentEpoch == this.epoch.get()) {
scheduleReconnect(e);
}
else {
@@ -218,7 +218,7 @@ public abstract class AbstractStompSessionManager implements StompSessionManager
e -> {
AbstractStompSessionManager.this.logger.debug("onFailure", e);
connectLatch.countDown();
if (epoch == AbstractStompSessionManager.this.epoch.get()) {
if (currentEpoch == AbstractStompSessionManager.this.epoch.get()) {
scheduleReconnect(e);
}
});
@@ -226,7 +226,7 @@ public abstract class AbstractStompSessionManager implements StompSessionManager
try {
if (!connectLatch.await(30, TimeUnit.SECONDS)) {
this.logger.error("No response to connection attempt");
if (epoch == this.epoch.get()) {
if (currentEpoch == this.epoch.get()) {
scheduleReconnect(null);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 the original author or authors.
* Copyright 2015-2019 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.
@@ -61,6 +61,7 @@ import org.springframework.util.Assert;
* if provided {@link StompSessionManager} supports {@code autoReceiptEnabled}.
*
* @author Artem Bilan
* @author Gary Russell
*
* @since 4.2
*/
@@ -240,19 +241,19 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement
});
if (this.stompSessionManager.isAutoReceiptEnabled()) {
final ApplicationEventPublisher applicationEventPublisher = this.applicationEventPublisher;
if (applicationEventPublisher != null) {
final ApplicationEventPublisher eventPublisher = this.applicationEventPublisher;
if (eventPublisher != null) {
subscription.addReceiptTask(() -> {
StompReceiptEvent event = new StompReceiptEvent(StompInboundChannelAdapter.this,
destination, subscription.getReceiptId(), StompCommand.SUBSCRIBE, false);
applicationEventPublisher.publishEvent(event);
eventPublisher.publishEvent(event);
});
}
subscription.addReceiptLostTask(() -> {
if (applicationEventPublisher != null) {
if (eventPublisher != null) {
StompReceiptEvent event = new StompReceiptEvent(StompInboundChannelAdapter.this,
destination, subscription.getReceiptId(), StompCommand.SUBSCRIBE, true);
applicationEventPublisher.publishEvent(event);
eventPublisher.publishEvent(event);
}
else {
logger.error("The receipt [" + subscription.getReceiptId() + "] is lost for [" +

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 the original author or authors.
* Copyright 2015-2019 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.
@@ -50,6 +50,7 @@ import org.springframework.util.Assert;
* The {@link AbstractMessageHandler} implementation to send messages to STOMP destinations.
*
* @author Artem Bilan
* @author Gary Russell
*
* @since 4.2
*/
@@ -136,7 +137,7 @@ public class StompMessageHandler extends AbstractMessageHandler implements Appli
catch (Exception e) {
throw new MessageDeliveryException(message, "The '" + this + "' could not deliver message.", e);
}
StompSession stompSession = this.stompSession;
StompSession session = this.stompSession;
StompHeaders stompHeaders = new StompHeaders();
this.headerMapper.fromHeaders(message.getHeaders(), stompHeaders);
@@ -148,24 +149,24 @@ public class StompMessageHandler extends AbstractMessageHandler implements Appli
stompHeaders.setDestination(destination);
}
final StompSession.Receiptable receiptable = stompSession.send(stompHeaders, message.getPayload());
final StompSession.Receiptable receiptable = session.send(stompHeaders, message.getPayload());
if (receiptable.getReceiptId() != null) {
final String destination = stompHeaders.getDestination();
final ApplicationEventPublisher applicationEventPublisher = this.applicationEventPublisher;
if (applicationEventPublisher != null) {
final ApplicationEventPublisher eventPublisher = this.applicationEventPublisher;
if (eventPublisher != null) {
receiptable.addReceiptTask(() -> {
StompReceiptEvent event = new StompReceiptEvent(StompMessageHandler.this,
destination, receiptable.getReceiptId(), StompCommand.SEND, false);
event.setMessage(message);
applicationEventPublisher.publishEvent(event);
eventPublisher.publishEvent(event);
});
}
receiptable.addReceiptLostTask(() -> {
if (applicationEventPublisher != null) {
if (eventPublisher != null) {
StompReceiptEvent event = new StompReceiptEvent(StompMessageHandler.this,
destination, receiptable.getReceiptId(), StompCommand.SEND, true);
event.setMessage(message);
applicationEventPublisher.publishEvent(event);
eventPublisher.publishEvent(event);
}
else {
logger.error("The receipt [" + receiptable.getReceiptId() + "] is lost for [" +