This is an automated email from the ASF dual-hosted git repository. lgoldstein pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mina-sshd.git
commit 74a46b6f79a10e3c800918581a442669e82939b9 Author: Lyor Goldstein <lgoldst...@apache.org> AuthorDate: Thu May 16 13:02:19 2019 +0300 Upgraded Checkstyle version to 8.20 --- pom.xml | 2 +- .../sshd/common/compression/CompressionDelayedZlib.java | 1 - .../org/apache/sshd/common/signature/SignatureDSA.java | 1 - .../main/java/org/apache/sshd/agent/unix/AgentServer.java | 15 +++++---------- .../main/java/org/apache/sshd/agent/unix/AprLibrary.java | 2 -- .../org/apache/sshd/client/future/DefaultAuthFuture.java | 1 - .../main/java/org/apache/sshd/client/kex/DHGEXClient.java | 12 ++++++------ .../client/keyverifier/AcceptAllServerKeyVerifier.java | 1 - .../subsystem/sftp/AbstractSftpSubsystemHelper.java | 1 - 9 files changed, 12 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index 6f09744..28b554a 100644 --- a/pom.xml +++ b/pom.xml @@ -818,7 +818,7 @@ <dependency> <groupId>com.puppycrawl.tools</groupId> <artifactId>checkstyle</artifactId> - <version>8.19</version> + <version>8.20</version> <exclusions> <!-- MCHECKSTYLE-156 --> <exclusion> diff --git a/sshd-common/src/main/java/org/apache/sshd/common/compression/CompressionDelayedZlib.java b/sshd-common/src/main/java/org/apache/sshd/common/compression/CompressionDelayedZlib.java index c062e38..99dec8b 100644 --- a/sshd-common/src/main/java/org/apache/sshd/common/compression/CompressionDelayedZlib.java +++ b/sshd-common/src/main/java/org/apache/sshd/common/compression/CompressionDelayedZlib.java @@ -18,7 +18,6 @@ */ package org.apache.sshd.common.compression; - /** * ZLib delayed compression. * diff --git a/sshd-common/src/main/java/org/apache/sshd/common/signature/SignatureDSA.java b/sshd-common/src/main/java/org/apache/sshd/common/signature/SignatureDSA.java index 1f552bd..c7c9c9e 100644 --- a/sshd-common/src/main/java/org/apache/sshd/common/signature/SignatureDSA.java +++ b/sshd-common/src/main/java/org/apache/sshd/common/signature/SignatureDSA.java @@ -30,7 +30,6 @@ import org.apache.sshd.common.util.buffer.BufferUtils; import org.apache.sshd.common.util.io.der.DERParser; import org.apache.sshd.common.util.io.der.DERWriter; - /** * DSA <code>Signature</code> * diff --git a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentServer.java b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentServer.java index afba032..7e41996 100644 --- a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentServer.java +++ b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentServer.java @@ -38,12 +38,10 @@ import org.apache.tomcat.jni.Pool; import org.apache.tomcat.jni.Socket; import org.apache.tomcat.jni.Status; - /** * A server for an SSH Agent */ public class AgentServer extends AbstractLoggingBean implements Closeable, ExecutorServiceCarrier { - private final SshAgent agent; private final CloseableExecutorService service; private Future<?> agentThread; @@ -62,7 +60,8 @@ public class AgentServer extends AbstractLoggingBean implements Closeable, Execu public AgentServer(SshAgent agent, CloseableExecutorService executor) { this.agent = agent; this.service = (executor == null) - ? ThreadUtils.newSingleThreadExecutor("AgentServer[" + agent + "]") : executor; + ? ThreadUtils.newSingleThreadExecutor("AgentServer[" + agent + "]") + : executor; } public SshAgent getAgent() { @@ -93,7 +92,7 @@ public class AgentServer extends AbstractLoggingBean implements Closeable, Execu try { while (true) { long clientSock = Local.accept(handle); - Socket.timeoutSet(clientSock, 10000000); // TODO make this configurable + Socket.timeoutSet(clientSock, 10000000L); // TODO make this configurable new SshAgentSession(clientSock, agent).run(); } } catch (Exception e) { @@ -136,7 +135,6 @@ public class AgentServer extends AbstractLoggingBean implements Closeable, Execu } protected static class SshAgentSession extends AbstractAgentClient implements Runnable { - private final long socket; public SshAgentSession(long socket, SshAgent agent) { @@ -144,8 +142,8 @@ public class AgentServer extends AbstractLoggingBean implements Closeable, Execu this.socket = socket; } - @SuppressWarnings("synthetic-access") @Override + @SuppressWarnings("synthetic-access") public void run() { try { byte[] buf = new byte[1024]; @@ -183,9 +181,6 @@ public class AgentServer extends AbstractLoggingBean implements Closeable, Execu * @throws java.io.IOException the produced exception for the given APR error number */ private static void throwException(int code) throws IOException { - throw new IOException( - org.apache.tomcat.jni.Error.strerror(-code) - + " (code: " + code + ")"); + throw new IOException(org.apache.tomcat.jni.Error.strerror(-code) + " (code: " + code + ")"); } - } diff --git a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AprLibrary.java b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AprLibrary.java index 7d408ae..6e9996f 100644 --- a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AprLibrary.java +++ b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AprLibrary.java @@ -25,7 +25,6 @@ import org.apache.sshd.common.util.OsUtils; import org.apache.tomcat.jni.Library; import org.apache.tomcat.jni.Pool; - /** * <p> * Internal singleton used for initializing correctly the APR native library @@ -42,7 +41,6 @@ import org.apache.tomcat.jni.Pool; * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public final class AprLibrary { - // is APR library was initialized (load of native libraries) private static AprLibrary library; diff --git a/sshd-core/src/main/java/org/apache/sshd/client/future/DefaultAuthFuture.java b/sshd-core/src/main/java/org/apache/sshd/client/future/DefaultAuthFuture.java index 324c97f..36b8ada 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/future/DefaultAuthFuture.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/future/DefaultAuthFuture.java @@ -24,7 +24,6 @@ import java.util.Objects; import org.apache.sshd.common.SshException; import org.apache.sshd.common.future.DefaultVerifiableSshFuture; - /** * A default implementation of {@link AuthFuture}. * diff --git a/sshd-core/src/main/java/org/apache/sshd/client/kex/DHGEXClient.java b/sshd-core/src/main/java/org/apache/sshd/client/kex/DHGEXClient.java index 697849c..597079b 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/kex/DHGEXClient.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/kex/DHGEXClient.java @@ -38,12 +38,10 @@ import org.apache.sshd.common.util.buffer.Buffer; import org.apache.sshd.common.util.buffer.ByteArrayBuffer; import org.apache.sshd.common.util.security.SecurityUtils; - /** * @author <a href="mailto:d...@mina.apache.org">Apache MINA SSHD Project</a> */ public class DHGEXClient extends AbstractDHClientKeyExchange { - protected final DHFactory factory; protected byte expected; protected int min = SecurityUtils.MIN_DHGEX_KEY_SIZE; @@ -106,13 +104,14 @@ public class DHGEXClient extends AbstractDHClientKeyExchange { Session session = getSession(); boolean debugEnabled = log.isDebugEnabled(); if (debugEnabled) { - log.debug("next({})[{}] process command={}", this, session, KeyExchange.getGroupKexOpcodeName(cmd)); + log.debug("next({})[{}] process command={}", + this, session, KeyExchange.getGroupKexOpcodeName(cmd)); } if (cmd != expected) { throw new SshException(SshConstants.SSH2_DISCONNECT_KEY_EXCHANGE_FAILED, - "Protocol error: expected packet " + KeyExchange.getGroupKexOpcodeName(expected) - + ", got " + KeyExchange.getGroupKexOpcodeName(cmd)); + "Protocol error: expected packet " + KeyExchange.getGroupKexOpcodeName(expected) + + ", got " + KeyExchange.getGroupKexOpcodeName(cmd)); } if (cmd == SshConstants.SSH_MSG_KEX_DH_GEX_GROUP) { @@ -127,7 +126,8 @@ public class DHGEXClient extends AbstractDHClientKeyExchange { if (debugEnabled) { log.debug("next({})[{}] Send SSH_MSG_KEX_DH_GEX_INIT", this, session); } - buffer = session.createBuffer(SshConstants.SSH_MSG_KEX_DH_GEX_INIT, e.length + Byte.SIZE); + buffer = session.createBuffer( + SshConstants.SSH_MSG_KEX_DH_GEX_INIT, e.length + Byte.SIZE); buffer.putMPInt(e); session.writePacket(buffer); expected = SshConstants.SSH_MSG_KEX_DH_GEX_REPLY; diff --git a/sshd-core/src/main/java/org/apache/sshd/client/keyverifier/AcceptAllServerKeyVerifier.java b/sshd-core/src/main/java/org/apache/sshd/client/keyverifier/AcceptAllServerKeyVerifier.java index 665966b..4268601 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/keyverifier/AcceptAllServerKeyVerifier.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/keyverifier/AcceptAllServerKeyVerifier.java @@ -18,7 +18,6 @@ */ package org.apache.sshd.client.keyverifier; - /** * A ServerKeyVerifier that accepts all server keys. * diff --git a/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java index 79ecad0..5bab0dc 100644 --- a/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java +++ b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java @@ -2809,7 +2809,6 @@ public abstract class AbstractSftpSubsystemHelper return abs.normalize(); } - /** * @param remotePath The remote path - separated by '/' * @return The local {@link Path}