Add EmptyLineSeparator Checkstyle rule

* Support "blank lines around" via `spring-framework.xml` IDEA config
* Fix all the Checkstyle violations
This commit is contained in:
Artem Bilan
2024-03-27 16:54:25 -04:00
parent f71a2234d8
commit c155d5d418
932 changed files with 1341 additions and 2485 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -52,7 +52,6 @@ public class ChannelPublishingJmsMessageListenerTests {
private final Session session = new StubSession("test");
@Test
public void noReplyToAndNoDefault() throws JMSException {
final QueueChannel requestChannel = new QueueChannel();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -525,7 +525,6 @@ public class DefaultJmsHeaderMapperTests {
assertThat(headers.get("foo")).isEqualTo("bar");
}
@Test
public void testJsonHeaderMapping() throws JMSException {
@@ -550,7 +549,6 @@ public class DefaultJmsHeaderMapperTests {
assertThat(result).isInstanceOf(String.class);
}
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "javatype")
private static class Foo {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-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.
@@ -34,7 +34,6 @@ public class StubConnection implements Connection {
private String messageText;
public StubConnection(String messageText) {
this.messageText = messageText;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-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.
@@ -30,13 +30,11 @@ public class StubConsumer implements MessageConsumer {
private String messageSelector;
public StubConsumer(String messageText, String messageSelector) {
this.messageText = messageText;
this.messageSelector = messageSelector;
}
public void close() throws JMSException {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-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.
@@ -34,12 +34,10 @@ public class StubProducer implements MessageProducer {
private long deliveryDelay;
public StubProducer(Destination destination) {
this.staticDestination = destination;
}
public Message getLastMessageSent() {
return this.lastMessageSent;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-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.
@@ -45,7 +45,6 @@ public class StubSession implements Session {
private final String messageText;
public StubSession(String messageText) {
this.messageText = messageText;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-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.
@@ -57,7 +57,6 @@ public class StubTextMessage implements TextMessage {
private long deliveryTime;
public StubTextMessage() {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -46,7 +46,6 @@ public class DefaultConfigurationTests {
@Autowired
private ApplicationContext context;
@Test
public void verifyErrorChannel() {
Object errorChannel = context.getBean("errorChannel");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -80,7 +80,6 @@ public class ExceptionHandlingSiConsumerTests extends ActiveMQMultiContextTests
assertThat(reply).isEqualTo("echoWithException");
}
public static class SampleService {
public String echoWithException(String value) {
@@ -93,7 +92,6 @@ public class ExceptionHandlingSiConsumerTests extends ActiveMQMultiContextTests
}
@SuppressWarnings("serial")
public static class SampleException extends RuntimeException {
@@ -103,14 +101,12 @@ public class ExceptionHandlingSiConsumerTests extends ActiveMQMultiContextTests
}
public interface SampleGateway {
String echo(String value);
}
public static class SampleErrorTransformer {
public org.springframework.messaging.Message<?> transform(Throwable t) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -51,7 +51,6 @@ public class GlobalChannelInterceptorTests extends ActiveMQMultiContextTests {
assertThat(interceptors.get(0) instanceof SampleInterceptor).isTrue();
}
public static class SampleInterceptor implements ChannelInterceptor {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -86,7 +86,6 @@ public class InboundOneWayErrorTests extends ActiveMQMultiContextTests {
assertThat(this.errorHandler.lastError).isNull();
}
public static class TestService {
public void process(Object o) {
@@ -95,7 +94,6 @@ public class InboundOneWayErrorTests extends ActiveMQMultiContextTests {
}
@SuppressWarnings("serial")
private static class TestException extends RuntimeException {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -179,7 +179,6 @@ public class JmsChannelParserTests extends ActiveMQMultiContextTests {
.isSameAs(this.messageBuilderFactory);
}
@Test
public void topicNameChannel() {
assertThat(topicNameChannel.getClass()).isEqualTo(SubscribableJmsChannel.class);
@@ -320,7 +319,6 @@ public class JmsChannelParserTests extends ActiveMQMultiContextTests {
assertThat(container.getDestinationName()).isEqualTo("custom.container.queue");
}
static class TestDestinationResolver implements DestinationResolver {
@Autowired
@@ -340,7 +338,6 @@ public class JmsChannelParserTests extends ActiveMQMultiContextTests {
}
static class TestInterceptor implements ChannelInterceptor {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -84,7 +84,6 @@ public class JmsDynamicDestinationTests extends ActiveMQMultiContextTests {
assertThat(result2.getPayload()).isEqualTo("test-2!!");
}
public static class Responder {
public String one(String message) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2022 the original author or authors.
* Copyright 2018-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.
@@ -59,7 +59,6 @@ public class JmsMessageDrivenEndpointTests extends ActiveMQMultiContextTests {
"a MessageListener configured since the endpoint configures its own listener implementation.");
}
@Test
public void testStopStart(@Autowired JmsTemplate template,
@Autowired JmsMessageDrivenEndpoint endpoint, @Autowired QueueChannel out) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -72,7 +72,6 @@ public class JmsMessageHistoryTests extends ActiveMQMultiContextTests {
assertThat(event2.getProperty(MessageHistory.NAME_PROPERTY)).isEqualTo("jmsInputChannel");
}
public interface SampleGateway {
void send(String value);
@@ -81,7 +80,6 @@ public class JmsMessageHistoryTests extends ActiveMQMultiContextTests {
}
public static class SampleService {
public Message<?> echoMessage(String value) {
@@ -90,7 +88,6 @@ public class JmsMessageHistoryTests extends ActiveMQMultiContextTests {
}
public static class SampleHeaderMapper extends DefaultJmsHeaderMapper {
public void fromHeaders(MessageHeaders headers, jakarta.jms.Message jmsMessage) {
@@ -127,7 +124,6 @@ public class JmsMessageHistoryTests extends ActiveMQMultiContextTests {
}
public static class SampleComponent implements NamedComponent {
private String name;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -209,4 +209,5 @@ public class JmsOutboundChannelAdapterParserTests {
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -197,7 +197,6 @@ public class JmsOutboundGatewayParserTests extends ActiveMQMultiContextTests {
}
}
public interface SampleGateway {
String echo(String value);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -96,7 +96,6 @@ public class JmsPriorityTests extends ActiveMQMultiContextTests {
assertThat(result.getPayload()).isEqualTo("priority=8");
}
public static class PriorityReader implements SessionAwareMessageListener<jakarta.jms.Message> {
public void onMessage(jakarta.jms.Message request, Session session) throws JMSException {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -68,7 +68,6 @@ public class JmsWithMarshallingMessageConverterTests extends ActiveMQMultiContex
assertThat(replyMessage.getPayload()).isEqualTo("HELLO");
}
public static class SampleService {
public String echo(String value) {
@@ -77,7 +76,6 @@ public class JmsWithMarshallingMessageConverterTests extends ActiveMQMultiContex
}
public static class SampleMarshaller implements Marshaller {
public void marshal(Object graph, Result result) throws IOException, XmlMappingException {
@@ -97,7 +95,6 @@ public class JmsWithMarshallingMessageConverterTests extends ActiveMQMultiContex
}
public static class SampleUnmarshaller implements Unmarshaller {
public boolean supports(Class<?> clazz) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -63,7 +63,6 @@ public class MiscellaneousTests extends ActiveMQMultiContextTests {
}
}
private void exchange(CountDownLatch latch, RequestReplyExchanger gateway, AtomicInteger replies) {
new Thread(() -> {
try {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -210,7 +210,6 @@ public class RequestReplyScenariosWithCachedConsumersTests extends ActiveMQMulti
latch.await();
TestUtils.getPropertyValue(context.getBean("fastGateway"), "handler", JmsOutboundGateway.class)
.setReceiveTimeout(10000);
Thread.sleep(1000);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-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.
@@ -80,7 +80,6 @@ public class RequestReplyScenariosWithCorrelationKeyProvidedTests extends Active
new ClassPathXmlApplicationContext("explicit-correlation-key.xml", this.getClass());
RequestReplyExchanger gateway = context.getBean("explicitCorrelationKeyGatewayC", RequestReplyExchanger.class);
for (int i = 0; i < 3; i++) {
try {
gateway.exchange(MessageBuilder.withPayload("hello").build());
@@ -97,7 +96,6 @@ public class RequestReplyScenariosWithCorrelationKeyProvidedTests extends Active
context.close();
}
public static class DelayedService {
public String echo(String s) throws Exception {