This is an automated email from the ASF dual-hosted git repository. twolf pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mina-sshd.git
commit f378ef4638ca131f2e5d42c5340329be8f8f8ab8 Author: Thomas Wolf <[email protected]> AuthorDate: Sat Oct 29 18:38:34 2022 +0200 Formatter fix for "throws" declarations The previous format would sometimes align these declaration very far to the right. Change the formatting to avoid this. --- .../apache/sshd/common/util/security/eddsa/Ed25519VectorsTest.java | 2 +- .../apache/sshd/contrib/common/signature/LegacyDSASignerTest.java | 2 +- .../src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java | 2 +- .../auth/pubkey/AuthorizedKeyEntriesPublickeyAuthenticator.java | 3 +-- sshd-eclipse-formatter-config.xml | 4 ++-- .../src/main/java/org/apache/sshd/git/transport/GitSshdSession.java | 3 +-- .../src/main/java/org/apache/sshd/scp/server/InputStreamReader.java | 2 +- .../main/java/org/apache/sshd/sftp/client/fs/SftpFileSystem.java | 2 +- .../java/org/apache/sshd/sftp/client/impl/DefaultSftpClient.java | 2 +- .../java/org/apache/sshd/sftp/client/impl/SftpInputStreamAsync.java | 3 ++- .../org/apache/sshd/sftp/client/impl/SftpOutputStreamAsync.java | 6 ++++-- .../org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java | 3 ++- sshd-sftp/src/main/java/org/apache/sshd/sftp/server/FileHandle.java | 2 +- .../org/apache/sshd/sftp/client/SftpInputStreamWithChannel.java | 3 ++- .../org/apache/sshd/sftp/client/SftpOutputStreamWithChannel.java | 3 ++- 15 files changed, 23 insertions(+), 19 deletions(-) diff --git a/sshd-common/src/test/java/org/apache/sshd/common/util/security/eddsa/Ed25519VectorsTest.java b/sshd-common/src/test/java/org/apache/sshd/common/util/security/eddsa/Ed25519VectorsTest.java index e2d4fa98f..1009e8f07 100644 --- a/sshd-common/src/test/java/org/apache/sshd/common/util/security/eddsa/Ed25519VectorsTest.java +++ b/sshd-common/src/test/java/org/apache/sshd/common/util/security/eddsa/Ed25519VectorsTest.java @@ -64,7 +64,7 @@ public class Ed25519VectorsTest extends JUnitTestSupport { private final byte[] expSignature; public Ed25519VectorsTest(String name, String prvKey, String pubKey, String msg, String signature) - throws GeneralSecurityException { + throws GeneralSecurityException { prvBytes = BufferUtils.decodeHex(BufferUtils.EMPTY_HEX_SEPARATOR, prvKey); privateKey = EdDSASecurityProviderUtils.generateEDDSAPrivateKey(prvBytes.clone()); pubBytes = BufferUtils.decodeHex(BufferUtils.EMPTY_HEX_SEPARATOR, pubKey); diff --git a/sshd-contrib/src/test/java/org/apache/sshd/contrib/common/signature/LegacyDSASignerTest.java b/sshd-contrib/src/test/java/org/apache/sshd/contrib/common/signature/LegacyDSASignerTest.java index 1ab162a87..0a6350d35 100644 --- a/sshd-contrib/src/test/java/org/apache/sshd/contrib/common/signature/LegacyDSASignerTest.java +++ b/sshd-contrib/src/test/java/org/apache/sshd/contrib/common/signature/LegacyDSASignerTest.java @@ -61,7 +61,7 @@ public class LegacyDSASignerTest extends JUnitTestSupport { private final KeyPair kp; public LegacyDSASignerTest(int keySize) - throws IOException, GeneralSecurityException { + throws IOException, GeneralSecurityException { this.keySize = keySize; String resourceName = KeyPairProvider.SSH_DSS + "-" + keySize; diff --git a/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java b/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java index 6249e85b3..3f6f57736 100644 --- a/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java +++ b/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java @@ -81,7 +81,7 @@ public class Nio2Session extends AbstractCloseable implements IoSession { public Nio2Session(Nio2Service service, PropertyResolver propertyResolver, IoHandler handler, AsynchronousSocketChannel socket, SocketAddress acceptanceAddress) - throws IOException { + throws IOException { this.service = Objects.requireNonNull(service, "No service instance"); this.propertyResolver = Objects.requireNonNull(propertyResolver, "No property resolver"); this.ioHandler = Objects.requireNonNull(handler, "No IoHandler"); diff --git a/sshd-core/src/main/java/org/apache/sshd/server/auth/pubkey/AuthorizedKeyEntriesPublickeyAuthenticator.java b/sshd-core/src/main/java/org/apache/sshd/server/auth/pubkey/AuthorizedKeyEntriesPublickeyAuthenticator.java index 40a347ba4..cb8dc478a 100644 --- a/sshd-core/src/main/java/org/apache/sshd/server/auth/pubkey/AuthorizedKeyEntriesPublickeyAuthenticator.java +++ b/sshd-core/src/main/java/org/apache/sshd/server/auth/pubkey/AuthorizedKeyEntriesPublickeyAuthenticator.java @@ -51,8 +51,7 @@ public class AuthorizedKeyEntriesPublickeyAuthenticator extends AbstractLoggingB public AuthorizedKeyEntriesPublickeyAuthenticator(Object id, ServerSession session, Collection<? extends AuthorizedKeyEntry> entries, PublicKeyEntryResolver fallbackResolver) - throws IOException, - GeneralSecurityException { + throws IOException, GeneralSecurityException { this.id = id; int numEntries = GenericUtils.size(entries); if (numEntries <= 0) { diff --git a/sshd-eclipse-formatter-config.xml b/sshd-eclipse-formatter-config.xml index 3f34f0d45..ba98b80ae 100644 --- a/sshd-eclipse-formatter-config.xml +++ b/sshd-eclipse-formatter-config.xml @@ -56,8 +56,8 @@ <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="32"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="18"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="32"/> - <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="18"/> - <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="32"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/> + <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="16"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="32"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="18"/> diff --git a/sshd-git/src/main/java/org/apache/sshd/git/transport/GitSshdSession.java b/sshd-git/src/main/java/org/apache/sshd/git/transport/GitSshdSession.java index 9f3f947ca..091c434ae 100644 --- a/sshd-git/src/main/java/org/apache/sshd/git/transport/GitSshdSession.java +++ b/sshd-git/src/main/java/org/apache/sshd/git/transport/GitSshdSession.java @@ -41,8 +41,7 @@ public class GitSshdSession extends AbstractLoggingBean implements RemoteSession private final ClientSession session; public GitSshdSession(URIish uri, CredentialsProvider credentialsProvider, FS fs, int tms) - throws IOException, - InterruptedException { + throws IOException, InterruptedException { String user = uri.getUser(); final String pass1 = uri.getPass(); String host = uri.getHost(); diff --git a/sshd-scp/src/main/java/org/apache/sshd/scp/server/InputStreamReader.java b/sshd-scp/src/main/java/org/apache/sshd/scp/server/InputStreamReader.java index a27964772..c15801806 100644 --- a/sshd-scp/src/main/java/org/apache/sshd/scp/server/InputStreamReader.java +++ b/sshd-scp/src/main/java/org/apache/sshd/scp/server/InputStreamReader.java @@ -97,7 +97,7 @@ public class InputStreamReader extends Reader { * @throws UnsupportedEncodingException if the encoding specified by {@code enc} cannot be found. */ public InputStreamReader(InputStream in, final String enc) - throws UnsupportedEncodingException { + throws UnsupportedEncodingException { super(in); if (enc == null) { throw new NullPointerException(); diff --git a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/fs/SftpFileSystem.java b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/fs/SftpFileSystem.java index f31d65657..a20c1bb54 100644 --- a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/fs/SftpFileSystem.java +++ b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/fs/SftpFileSystem.java @@ -81,7 +81,7 @@ public class SftpFileSystem public SftpFileSystem(SftpFileSystemProvider provider, String id, ClientSession session, SftpClientFactory factory, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) - throws IOException { + throws IOException { super(provider); this.id = id; this.clientSession = Objects.requireNonNull(session, "No client session"); diff --git a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/DefaultSftpClient.java b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/DefaultSftpClient.java index 3cee175ce..15a42c9a8 100644 --- a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/DefaultSftpClient.java +++ b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/DefaultSftpClient.java @@ -90,7 +90,7 @@ public class DefaultSftpClient extends AbstractSftpClient { */ public DefaultSftpClient(ClientSession clientSession, SftpVersionSelector initialVersionSelector, SftpErrorDataHandler errorDataHandler) - throws IOException { + throws IOException { super(errorDataHandler); this.nameDecodingCharset = SftpModuleProperties.NAME_DECODING_CHARSET.getRequired(clientSession); diff --git a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpInputStreamAsync.java b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpInputStreamAsync.java index 355ac1d58..d52b005dd 100644 --- a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpInputStreamAsync.java +++ b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpInputStreamAsync.java @@ -62,7 +62,8 @@ public class SftpInputStreamAsync extends InputStreamWithChannel implements Sftp private final String path; public SftpInputStreamAsync(AbstractSftpClient client, int bufferSize, - String path, Collection<OpenMode> mode) throws IOException { + String path, Collection<OpenMode> mode) + throws IOException { this.log = LoggerFactory.getLogger(getClass()); this.clientInstance = Objects.requireNonNull(client, "No SFTP client instance"); this.path = path; diff --git a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpOutputStreamAsync.java b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpOutputStreamAsync.java index 3de58d9e6..a9da91724 100644 --- a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpOutputStreamAsync.java +++ b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpOutputStreamAsync.java @@ -55,7 +55,8 @@ public class SftpOutputStreamAsync extends OutputStreamWithChannel implements Sf private final String path; public SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, - String path, Collection<OpenMode> mode) throws IOException { + String path, Collection<OpenMode> mode) + throws IOException { this.log = LoggerFactory.getLogger(getClass()); this.clientInstance = Objects.requireNonNull(client, "No SFTP client instance"); this.path = path; @@ -64,7 +65,8 @@ public class SftpOutputStreamAsync extends OutputStreamWithChannel implements Sf } public SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, - String path, CloseableHandle handle) throws IOException { + String path, CloseableHandle handle) + throws IOException { this.log = LoggerFactory.getLogger(getClass()); this.clientInstance = Objects.requireNonNull(client, "No SFTP client instance"); this.path = path; diff --git a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java index 45e88bbcf..6f3921bed 100644 --- a/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java +++ b/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java @@ -74,7 +74,8 @@ public class SftpRemotePathChannel extends FileChannel { private final String path; public SftpRemotePathChannel(String path, SftpClient sftp, boolean closeOnExit, - Collection<OpenMode> modes) throws IOException { + Collection<OpenMode> modes) + throws IOException { this.log = LoggerFactory.getLogger(getClass()); this.path = ValidateUtils.checkNotNullAndNotEmpty(path, "No remote file path specified"); this.modes = Objects.requireNonNull(modes, "No channel modes specified"); diff --git a/sshd-sftp/src/main/java/org/apache/sshd/sftp/server/FileHandle.java b/sshd-sftp/src/main/java/org/apache/sshd/sftp/server/FileHandle.java index 1b1657bf8..8cb4a7dfd 100644 --- a/sshd-sftp/src/main/java/org/apache/sshd/sftp/server/FileHandle.java +++ b/sshd-sftp/src/main/java/org/apache/sshd/sftp/server/FileHandle.java @@ -53,7 +53,7 @@ public class FileHandle extends Handle { private final Collection<FileAttribute<?>> fileAttributes; public FileHandle(SftpSubsystem subsystem, Path file, String handle, int flags, int access, Map<String, Object> attrs) - throws IOException { + throws IOException { super(subsystem, file, handle); Set<StandardOpenOption> options = getOpenOptions(flags, access); diff --git a/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpInputStreamWithChannel.java b/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpInputStreamWithChannel.java index 27aa81122..b8b7fe752 100644 --- a/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpInputStreamWithChannel.java +++ b/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpInputStreamWithChannel.java @@ -42,7 +42,8 @@ public class SftpInputStreamWithChannel extends InputStreamWithChannel implement private long offset; public SftpInputStreamWithChannel(SftpClient client, int bufferSize, String path, - Collection<OpenMode> mode) throws IOException { + Collection<OpenMode> mode) + throws IOException { this.client = Objects.requireNonNull(client, "No SFTP client instance"); this.path = path; bb = new byte[1]; diff --git a/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpOutputStreamWithChannel.java b/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpOutputStreamWithChannel.java index e58d25b62..5ebddeb24 100644 --- a/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpOutputStreamWithChannel.java +++ b/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpOutputStreamWithChannel.java @@ -41,7 +41,8 @@ public class SftpOutputStreamWithChannel extends OutputStreamWithChannel impleme private long offset; public SftpOutputStreamWithChannel(SftpClient client, int bufferSize, String path, - Collection<OpenMode> mode) throws IOException { + Collection<OpenMode> mode) + throws IOException { this.client = Objects.requireNonNull(client, "No SFTP client instance"); this.path = path; buffer = new byte[bufferSize];
