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-2023 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.
@@ -42,7 +42,6 @@ public class ByteStreamReadingMessageSource extends AbstractMessageSource<byte[]
private boolean shouldTruncate = true;
public ByteStreamReadingMessageSource(InputStream stream) {
this(stream, -1);
}
@@ -59,7 +58,6 @@ public class ByteStreamReadingMessageSource extends AbstractMessageSource<byte[]
}
}
public void setBytesPerMessage(int bytesPerMessage) {
this.bytesPerMessage = bytesPerMessage;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 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.
@@ -35,7 +35,6 @@ public class ByteStreamWritingMessageHandler extends AbstractMessageHandler {
private final BufferedOutputStream stream;
public ByteStreamWritingMessageHandler(OutputStream stream) {
this(stream, -1);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 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.
@@ -137,7 +137,6 @@ public class CharacterStreamReadingMessageSource extends AbstractMessageSource<S
}
}
/**
* Create a source that reads from {@link System#in}. EOF will not be detected.
* @return the stream.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 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 CharacterStreamWritingMessageHandler extends AbstractMessageHandler
private volatile boolean shouldAppendNewLine = false;
public CharacterStreamWritingMessageHandler(Writer writer) {
this(writer, -1);
}
@@ -64,7 +63,6 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler
}
}
/**
* Factory method that creates a target for stdout (System.out) with the
* default charset encoding.
@@ -119,7 +117,6 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler
}
}
public void setShouldAppendNewLine(boolean shouldAppendNewLine) {
this.shouldAppendNewLine = shouldAppendNewLine;
}

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 ByteStreamWritingMessageHandlerTests {
private ThreadPoolTaskScheduler scheduler;
@Before
public void initialize() {
stream = new ByteArrayOutputStream();
@@ -71,7 +70,6 @@ public class ByteStreamWritingMessageHandlerTests {
scheduler.destroy();
}
@Test
public void singleByteArray() {
handler.handleMessage(new GenericMessage<byte[]>(new byte[] {1, 2, 3}));

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.
@@ -55,7 +55,6 @@ public class CharacterStreamWritingMessageHandlerTests {
private ThreadPoolTaskScheduler scheduler;
@BeforeEach
public void initialize() {
writer = new StringWriter();
@@ -76,7 +75,6 @@ public class CharacterStreamWritingMessageHandlerTests {
scheduler.destroy();
}
@Test
public void singleString() {
handler.handleMessage(new GenericMessage<>("foo"));
@@ -190,7 +188,6 @@ public class CharacterStreamWritingMessageHandlerTests {
assertThat(writer.toString()).isEqualTo("foo" + newLine + "bar" + newLine);
}
private record TestObject(String text) {
@Override
@@ -200,7 +197,6 @@ public class CharacterStreamWritingMessageHandlerTests {
}
private static class TestTrigger implements Trigger {
private final AtomicBoolean hasRun = new AtomicBoolean();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 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.
@@ -69,7 +69,6 @@ public class ConsoleInboundChannelAdapterParserTests {
stream.reset();
}
@Test
public void adapterWithDefaultCharset() {
SourcePollingChannelAdapter adapter = context.getBean("adapterWithDefaultCharset.adapter",

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.
@@ -153,7 +153,6 @@ public class ConsoleOutboundChannelAdapterParserTests {
DirectFieldAccessor dfa = new DirectFieldAccessor(this.stderrAdapterHandler);
dfa.setPropertyValue("writer", bufferedWriter);
this.stderrAdapterHandler.handleMessage(new GenericMessage<String>("bar"));
verify(bufferedWriter, times(1)).write(eq("bar"));
@@ -212,4 +211,5 @@ public class ConsoleOutboundChannelAdapterParserTests {
this.stdoutInsideNestedChain.send(new GenericMessage<String>("foo"));
verify(bufferedWriter, times(1)).write(eq("foobar"));
}
}

View File

@@ -47,7 +47,6 @@ public class DefaultConfigurationTests {
@Autowired
private ApplicationContext context;
@Test
public void verifyErrorChannel() {
Object errorChannel = context.getBean("errorChannel");