Add EmptyLineSeparator Checkstyle rule
* Support "blank lines around" via `spring-framework.xml` IDEA config * Fix all the Checkstyle violations
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2023 the original author or authors.
|
||||
* Copyright 2015-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.
|
||||
@@ -369,7 +369,6 @@ public abstract class AbstractStompSessionManager implements StompSessionManager
|
||||
|
||||
protected abstract CompletableFuture<StompSession> doConnect(StompSessionHandler handler);
|
||||
|
||||
|
||||
private class CompositeStompSessionHandler extends StompSessionHandlerAdapter {
|
||||
|
||||
private final List<StompSessionHandler> delegates = Collections.synchronizedList(new ArrayList<>());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2023 the original author or authors.
|
||||
* Copyright 2015-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.
|
||||
@@ -204,38 +204,8 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement
|
||||
|
||||
private void subscribeDestination(final String destination) {
|
||||
if (this.stompSession != null) {
|
||||
class FrameHandler implements StompFrameHandler {
|
||||
|
||||
@Override
|
||||
public Type getPayloadType(StompHeaders headers) {
|
||||
return StompInboundChannelAdapter.this.payloadType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFrame(StompHeaders headers, @Nullable Object body) {
|
||||
Message<?> message;
|
||||
|
||||
if (body == null) {
|
||||
logger.info("No body in STOMP frame: nothing to produce.");
|
||||
return;
|
||||
}
|
||||
else if (body instanceof Message) {
|
||||
message = (Message<?>) body;
|
||||
}
|
||||
else {
|
||||
message =
|
||||
getMessageBuilderFactory()
|
||||
.withPayload(body)
|
||||
.copyHeaders(
|
||||
StompInboundChannelAdapter.this.headerMapper.toHeaders(headers))
|
||||
.build();
|
||||
}
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
}
|
||||
final StompSession.Subscription subscription =
|
||||
this.stompSession.subscribe(destination, new FrameHandler());
|
||||
StompSession.Subscription subscription =
|
||||
this.stompSession.subscribe(destination, new IntegrationFrameHandler());
|
||||
|
||||
if (this.stompSessionManager.isAutoReceiptEnabled()) {
|
||||
final ApplicationEventPublisher eventPublisher = this.applicationEventPublisher;
|
||||
@@ -268,6 +238,9 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement
|
||||
|
||||
private final class IntegrationInboundStompSessionHandler extends StompSessionHandlerAdapter {
|
||||
|
||||
IntegrationInboundStompSessionHandler() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterConnected(StompSession session, StompHeaders connectedHeaders) {
|
||||
StompInboundChannelAdapter.this.stompSession = session;
|
||||
@@ -307,4 +280,38 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement
|
||||
|
||||
}
|
||||
|
||||
private final class IntegrationFrameHandler implements StompFrameHandler {
|
||||
|
||||
IntegrationFrameHandler() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getPayloadType(StompHeaders headers) {
|
||||
return StompInboundChannelAdapter.this.payloadType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFrame(StompHeaders headers, @Nullable Object body) {
|
||||
Message<?> message;
|
||||
|
||||
if (body == null) {
|
||||
logger.info("No body in STOMP frame: nothing to produce.");
|
||||
return;
|
||||
}
|
||||
else if (body instanceof Message) {
|
||||
message = (Message<?>) body;
|
||||
}
|
||||
else {
|
||||
message =
|
||||
getMessageBuilderFactory()
|
||||
.withPayload(body)
|
||||
.copyHeaders(
|
||||
StompInboundChannelAdapter.this.headerMapper.toHeaders(headers))
|
||||
.build();
|
||||
}
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2021 the original author or authors.
|
||||
* Copyright 2015-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.
|
||||
@@ -234,7 +234,6 @@ public class StompHeaderMapper implements HeaderMapper<StompHeaders> {
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
private static boolean shouldMapHeader(String headerName, String[] patterns) {
|
||||
if (patterns != null && patterns.length > 0) {
|
||||
for (String pattern : patterns) {
|
||||
|
||||
Reference in New Issue
Block a user