Skip to content

Commit c155d5d

Browse files
committed
Add EmptyLineSeparator Checkstyle rule
* Support "blank lines around" via `spring-framework.xml` IDEA config * Fix all the Checkstyle violations
1 parent f71a223 commit c155d5d

File tree

932 files changed

+1341
-2485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

932 files changed

+1341
-2485
lines changed

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -181,12 +181,12 @@ public void onInit() {
181181
this.container.setQueueNames(queue);
182182
MessageConverter converter =
183183
(getAmqpTemplate() instanceof RabbitTemplate rabbitTemplate)
184-
? rabbitTemplate.getMessageConverter()
185-
: new SimpleMessageConverter();
184+
? rabbitTemplate.getMessageConverter()
185+
: new SimpleMessageConverter();
186186

187187
MessageListener listener =
188188
new DispatchingMessageListener(converter, this.dispatcher, this, this.isPubSub,
189-
getMessageBuilderFactory(), getInboundHeaderMapper());
189+
getMessageBuilderFactory(), getInboundHeaderMapper());
190190
this.container.setMessageListener(listener);
191191
if (!this.container.isActive()) {
192192
this.container.afterPropertiesSet();
@@ -261,7 +261,6 @@ public void destroy() {
261261

262262
protected abstract String obtainQueueName(String channelName);
263263

264-
265264
private static final class DispatchingMessageListener implements MessageListener {
266265

267266
private final Log logger = LogFactory.getLog(DispatchingMessageListener.class);
@@ -292,7 +291,6 @@ private DispatchingMessageListener(MessageConverter converter,
292291
this.inboundHeaderMapper = inboundHeaderMapper;
293292
}
294293

295-
296294
@Override
297295
public void onMessage(org.springframework.amqp.core.Message message) {
298296
Message<?> messageToSend = null;

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,7 +55,6 @@ public PointToPointSubscribableAmqpChannel(String channelName, AbstractMessageLi
5555
super(channelName, container, amqpTemplate);
5656
}
5757

58-
5958
/**
6059
* Construct an instance with the supplied name, container and template; default header
6160
* mappers will be used if the message is mapped.
@@ -73,7 +72,6 @@ public PointToPointSubscribableAmqpChannel(String channelName, AbstractMessageLi
7372
super(channelName, container, amqpTemplate, outboundMapper, inboundMapper);
7473
}
7574

76-
7775
/**
7876
* Provide a Queue name to be used. If this is not provided,
7977
* the Queue's name will be the same as the channel name.

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -93,7 +93,6 @@ public PollableAmqpChannel(String channelName, AmqpTemplate amqpTemplate, AmqpHe
9393
this.channelName = channelName;
9494
}
9595

96-
9796
/**
9897
* Provide an explicitly configured queue name. If this is not provided, then a Queue will be created
9998
* implicitly with the channelName as its name. The implicit creation will require that either an AmqpAdmin
@@ -286,7 +285,6 @@ private CounterFacade buildReceiveCounter(MetricsCaptor metricsCaptor, @Nullable
286285
return counterFacade;
287286
}
288287

289-
290288
@Override
291289
public void setInterceptors(List<ChannelInterceptor> interceptors) {
292290
super.setInterceptors(interceptors);

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,7 +77,6 @@ public PublishSubscribeAmqpChannel(String channelName, AbstractMessageListenerCo
7777
super(channelName, container, amqpTemplate, true, outboundMapper, inboundMapper);
7878
}
7979

80-
8180
/**
8281
* Configure the FanoutExchange instance. If this is not provided, then a
8382
* FanoutExchange will be declared implicitly, and its name will be the same

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,16 +72,13 @@ abstract class AbstractAmqpInboundAdapterParser extends AbstractSingleBeanDefini
7272
"transaction-manager"
7373
};
7474

75-
7675
private final String adapterClassName;
7776

78-
7977
AbstractAmqpInboundAdapterParser(String adapterClassName) {
8078
Assert.hasText(adapterClassName, "adapterClassName is required");
8179
this.adapterClassName = adapterClassName;
8280
}
8381

84-
8582
@Override
8683
protected final String getBeanClassName(Element element) {
8784
return this.adapterClassName;

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -148,7 +148,6 @@ public AmqpChannelFactoryBean(boolean messageDriven) {
148148
this.messageDriven = messageDriven;
149149
}
150150

151-
152151
@Override
153152
public void setBeanName(@Nullable String name) {
154153
this.beanName = name;

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpInboundGatewayParser.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,6 @@ public class AmqpInboundGatewayParser extends AbstractAmqpInboundAdapterParser {
3939
super(AmqpInboundGateway.class.getName());
4040
}
4141

42-
4342
@Override
4443
protected void configureChannels(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
4544
String amqpTemplateRef = element.getAttribute("amqp-template");

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/Amqp.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -64,7 +64,6 @@ public static AmqpInboundGatewaySMLCSpec inboundGateway(ConnectionFactory connec
6464
return inboundGateway(listenerContainer, amqpTemplate);
6565
}
6666

67-
6867
/**
6968
* Create an initial {@link AmqpInboundGatewaySpec}.
7069
* @param connectionFactory the connectionFactory.

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpBaseOutboundEndpointSpec.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2022 the original author or authors.
2+
* Copyright 2016-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -271,7 +271,6 @@ public S delayFunction(Function<Message<?>, Integer> delayFunction) {
271271
return delayExpression(new FunctionExpression<>(delayFunction));
272272
}
273273

274-
275274
/**
276275
* Set the SpEL expression to calculate the {@code x-delay} header when using the
277276
* RabbitMQ delayed message exchange plugin.

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpInboundChannelAdapterSMLCSpec.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2023 the original author or authors.
2+
* Copyright 2017-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,4 +55,5 @@ public AmqpInboundChannelAdapterSMLCSpec batchMode(BatchMode batchMode) {
5555
this.target.setBatchMode(batchMode);
5656
return this;
5757
}
58+
5859
}

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -141,7 +141,6 @@ public AmqpInboundChannelAdapter(MessageListenerContainer listenerContainer) {
141141
: null;
142142
}
143143

144-
145144
public void setMessageConverter(MessageConverter messageConverter) {
146145
Assert.notNull(messageConverter, "messageConverter must not be null");
147146
this.messageConverter = messageConverter;

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -132,7 +132,6 @@ private AmqpInboundGateway(MessageListenerContainer listenerContainer, AmqpTempl
132132
: null;
133133
}
134134

135-
136135
/**
137136
* Specify the {@link MessageConverter} to convert request and reply to/from {@link Message}.
138137
* If the {@link #amqpTemplate} is explicitly set, this {@link MessageConverter}

Diff for: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/AmqpHeaderMapper.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,4 +28,5 @@
2828
* @since 2.1
2929
*/
3030
public interface AmqpHeaderMapper extends RequestReplyHeaderMapper<MessageProperties> {
31+
3132
}

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/channel/DispatcherHasNoSubscribersTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,7 +45,6 @@
4545
import static org.mockito.Mockito.mock;
4646
import static org.mockito.Mockito.when;
4747

48-
4948
/**
5049
* @author Gary Russell
5150
* @author Artem Bilan

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -116,6 +116,7 @@ private void checkExtract(AbstractAmqpChannel channel) {
116116
}
117117

118118
private static class TestInterceptor implements ChannelInterceptor {
119+
119120
}
120121

121122
}

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundGatewayParserTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -152,6 +152,7 @@ public void testInt2971HeaderMapperAndMappedHeadersExclusivity() {
152152
}
153153

154154
private static class TestConverter extends SimpleMessageConverter {
155+
155156
}
156157

157158
}

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundChannelAdapterParserTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -339,7 +339,6 @@ public void testInt3430FailForNotLazyConnect() {
339339
handler.stop();
340340
}
341341

342-
343342
public static class FooAdvice extends AbstractRequestHandlerAdvice {
344343

345344
@Override

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundGatewayParserTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -291,7 +291,6 @@ public void amqpOutboundGatewayWithinChain() {
291291
Mockito.any(org.springframework.amqp.core.Message.class), isNull());
292292
ReflectionUtils.setField(amqpTemplateField, endpoint, amqpTemplate);
293293

294-
295294
MessageChannel requestChannel = this.context.getBean("toRabbit4", MessageChannel.class);
296295
Message<?> message = MessageBuilder.withPayload("hello").setHeader("foo", "foo").build();
297296
requestChannel.send(message);

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/OutboundGatewayIntegrationTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -61,7 +61,6 @@ public void testOutboundInboundGateways() throws Exception {
6161
assertThat(receive.getPayload()).isEqualTo(payload.toUpperCase());
6262
}
6363

64-
6564
public static class EchoBean {
6665

6766
String echo(String o) {

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/dsl/AmqpTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2023 the original author or authors.
2+
* Copyright 2014-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -206,7 +206,6 @@ public void testAmqpAsyncOutboundGatewayFlow() {
206206
@Autowired
207207
private AtomicReference<?> raw;
208208

209-
210209
@Test
211210
public void testInboundMessagingExceptionFlow() {
212211
this.amqpTemplate.convertAndSend("si.dsl.exception.test", "foo");

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/inbound/InboundEndpointTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2023 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -220,7 +220,6 @@ public void testMessageConverterJsonHeadersHavePrecedenceOverMessageHeaders() th
220220
gateway.setReplyHeadersMappedLast(true);
221221
gateway.afterPropertiesSet();
222222

223-
224223
Object payload = new Foo("bar1");
225224

226225
MessageProperties amqpMessageProperties = new MessageProperties();
@@ -785,6 +784,7 @@ public void testRetryWithMessageRecovererOnMessageAdapterConsumerBatch() throws
785784
}
786785

787786
public record Foo(String bar) {
787+
788788
}
789789

790790
}

Diff for: spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapperTests.java

-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ public void fromHeadersWithContentTypeAsMimeType() {
165165
assertThat(amqpProperties.getContentType()).isEqualTo("text/html");
166166
}
167167

168-
169168
@Test
170169
public void toHeaders() {
171170
DefaultAmqpHeaderMapper headerMapper = DefaultAmqpHeaderMapper.inboundMapper();
@@ -230,7 +229,6 @@ public void toHeadersNonContentType() {
230229
assertThat(headerMap.get(AmqpHeaders.CORRELATION_ID)).isEqualTo(testCorrelationId);
231230
}
232231

233-
234232
@Test
235233
public void testToHeadersConsumerMetadata() {
236234
DefaultAmqpHeaderMapper headerMapper = DefaultAmqpHeaderMapper.inboundMapper();

Diff for: spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 the original author or authors.
2+
* Copyright 2022-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -86,7 +86,6 @@ private static CamelMessageHandlerSpec camelHandler(@Nullable ProducerTemplate p
8686
.exchangePattern(exchangePattern);
8787
}
8888

89-
9089
private Camel() {
9190
}
9291

0 commit comments

Comments
 (0)