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 2014-2023 the original author or authors.
* Copyright 2014-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.
@@ -195,7 +195,6 @@ public final class Ftp {
return new FtpOutboundGatewaySpec(new FtpOutboundGateway(remoteFileTemplate, command, expression));
}
/**
* Produce a {@link FtpOutboundGatewaySpec} based on the
* {@link MessageSessionCallback}.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-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.
@@ -16,7 +16,6 @@
package org.springframework.integration.ftp.filters;
import org.apache.commons.net.ftp.FTPFile;
import org.springframework.integration.file.filters.AbstractPersistentAcceptOnceFileListFilter;

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.
@@ -39,7 +39,6 @@ public class FtpRegexPatternFileListFilter extends AbstractRegexPatternFileListF
super(pattern);
}
@Override
protected String getFilename(FTPFile file) {
return (file != null) ? file.getName() : null;

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.
@@ -33,7 +33,6 @@ public class FtpSimplePatternFileListFilter extends AbstractSimplePatternFileLis
super(pattern);
}
@Override
protected String getFilename(FTPFile file) {
return (file != null) ? file.getName() : null;

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.
@@ -43,7 +43,6 @@ public class FtpInboundFileSynchronizingMessageSource extends AbstractInboundFil
super(synchronizer, comparator);
}
public String getComponentType() {
return "ftp:inbound-channel-adapter";
}

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.
@@ -70,7 +70,6 @@ public abstract class AbstractFtpSessionFactory<T extends FTPClient> implements
private Integer dataTimeout;
/**
* File types defined by {@link org.apache.commons.net.ftp.FTP} constants:
* <ul>

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.
@@ -62,7 +62,6 @@ public class DefaultFtpsSessionFactory extends AbstractFtpSessionFactory<FTPSCli
private String protocol;
public void setProtocol(String protocol) {
this.protocol = protocol;
}

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.
@@ -105,4 +105,5 @@ public class FtpFileInfo extends AbstractFileInfo<FTPFile> {
public FTPFile getFileInfo() {
return this.ftpFile;
}
}

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.
@@ -57,7 +57,6 @@ public class FtpSession implements Session<FTPFile> {
this.client = client;
}
@Override
public boolean remove(String path) throws IOException {
Assert.hasText(path, "path must not be null");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2022 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.
@@ -81,7 +81,6 @@ public class FtpTestSupport extends RemoteFileTestSupport {
port = listener.getPort();
}
@AfterAll
public static void stopServer() {
server.stop();
@@ -123,7 +122,6 @@ public class FtpTestSupport extends RemoteFileTestSupport {
this.testUser.setName("TEST_USER");
}
@Override
public User getUserByName(String s) {
return this.testUser;

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.
@@ -34,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
public class FtpInboundOutboundSanitySample {
@Test
@Disabled
public void testFtpInboundChannelAdapter() throws Exception {

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.
@@ -186,4 +186,5 @@ public class FtpOutboundGatewayParserTests {
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2022 the original author or authors.
* Copyright 2016-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.
@@ -102,6 +102,7 @@ public class FtpStreamingInboundChannelAdapterParserTests {
public boolean isSingleton() {
return true;
}
}
}

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.
@@ -168,7 +168,6 @@ public class FtpInboundRemoteFileSystemSynchronizerTests {
assertThat(metadata).isEmpty();
}
@Test
public void testSyncRemoteFileOnlyOnceByDefault() {
File localDirectory = new File("test");
@@ -185,7 +184,6 @@ public class FtpInboundRemoteFileSystemSynchronizerTests {
synchronizer.synchronizeToLocalDirectory(localDirectory);
File[] files = localDirectory.listFiles();
assertThat(files.length).isEqualTo(3);
@@ -215,7 +213,6 @@ public class FtpInboundRemoteFileSystemSynchronizerTests {
}
}
public static class TestFtpSessionFactory extends AbstractFtpSessionFactory<FTPClient> {
private final Collection<FTPFile> ftpFiles = new ArrayList<>();

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.
@@ -215,7 +215,6 @@ public class FtpOutboundTests {
context.close();
}
public static class TestFtpSessionFactory extends AbstractFtpSessionFactory<FTPClient> {
@Override

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.
@@ -55,7 +55,6 @@ import static org.mockito.Mockito.verify;
*/
class SessionFactoryTests {
@Test
void testFtpClientInteraction() throws Exception {
final FTPClient client = mock(FTPClient.class);
@@ -119,7 +118,6 @@ class SessionFactoryTests {
.isThrownBy(() -> sessionFactory.setControlEncoding(null));
}
@Test
void testClientModes() throws Exception {
DefaultFtpSessionFactory sessionFactory = new DefaultFtpSessionFactory();
@@ -141,7 +139,6 @@ class SessionFactoryTests {
}
}
@Test
@SuppressWarnings("unchecked")
void testStaleConnection() {