diff --git a/src/main/java/net/schmizz/sshj/SSHClient.java b/src/main/java/net/schmizz/sshj/SSHClient.java index ba212368..fed72813 100644 --- a/src/main/java/net/schmizz/sshj/SSHClient.java +++ b/src/main/java/net/schmizz/sshj/SSHClient.java @@ -607,7 +607,7 @@ public class SSHClient * @throws TransportException if an error occurs during renegotiation */ public void useCompression() - throws ClassNotFoundException, TransportException { + throws TransportException { trans.getConfig().setCompressionFactories(Arrays.asList( new DelayedZlibCompression.Factory(), new ZlibCompression.Factory(), diff --git a/src/main/java/net/schmizz/sshj/connection/channel/Window.java b/src/main/java/net/schmizz/sshj/connection/channel/Window.java index 94ffdf35..fbe8ed01 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/Window.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/Window.java @@ -17,7 +17,6 @@ package net.schmizz.sshj.connection.channel; import net.schmizz.sshj.common.SSHRuntimeException; import net.schmizz.sshj.connection.ConnectionException; -import net.schmizz.sshj.transport.TransportException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -105,8 +104,7 @@ public abstract class Window { threshold = Math.min(maxPacketSize * 20, initialSize / 4); } - public int neededAdjustment() - throws TransportException { + public int neededAdjustment() { synchronized (lock) { return (size - threshold <= 0) ? (initialSize - size) : 0; } diff --git a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/RemotePortForwarder.java b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/RemotePortForwarder.java index 9e9bac5f..63367c5f 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/RemotePortForwarder.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/RemotePortForwarder.java @@ -128,13 +128,12 @@ public class RemotePortForwarder private final Forward fwd; public ForwardedTCPIPChannel(Connection conn, int recipient, int remoteWinSize, int remoteMaxPacketSize, - Forward fwd, String origIP, int origPort) - throws TransportException { + Forward fwd, String origIP, int origPort) { super(conn, TYPE, recipient, remoteWinSize, remoteMaxPacketSize, origIP, origPort); this.fwd = fwd; } - /** Returns the forwarding from which this channel originates. */ + /** @return the forwarding from which this channel originates. */ public Forward getParentForward() { return fwd; } diff --git a/src/main/java/net/schmizz/sshj/transport/verification/ConsoleKnownHostsVerifier.java b/src/main/java/net/schmizz/sshj/transport/verification/ConsoleKnownHostsVerifier.java index 237ae3db..af918748 100644 --- a/src/main/java/net/schmizz/sshj/transport/verification/ConsoleKnownHostsVerifier.java +++ b/src/main/java/net/schmizz/sshj/transport/verification/ConsoleKnownHostsVerifier.java @@ -60,8 +60,7 @@ public class ConsoleKnownHostsVerifier } @Override - protected boolean hostKeyChangedAction(Entry entry, String hostname, PublicKey key) - throws IOException { + protected boolean hostKeyChangedAction(Entry entry, String hostname, PublicKey key) { final KeyType type = KeyType.fromKey(key); final String fp = SecurityUtils.getFingerprint(key); final String path = getFile().getAbsolutePath(); diff --git a/src/main/java/net/schmizz/sshj/transport/verification/OpenSSHKnownHosts.java b/src/main/java/net/schmizz/sshj/transport/verification/OpenSSHKnownHosts.java index c75262b3..184a77e4 100644 --- a/src/main/java/net/schmizz/sshj/transport/verification/OpenSSHKnownHosts.java +++ b/src/main/java/net/schmizz/sshj/transport/verification/OpenSSHKnownHosts.java @@ -204,8 +204,7 @@ public class OpenSSHKnownHosts return saltyBytes; } - private String getSalt() - throws IOException { + private String getSalt() { if (salt == null) { salt = Base64.encodeBytes(saltyBytes); } @@ -269,8 +268,7 @@ public class OpenSSHKnownHosts return false; } - protected boolean hostKeyChangedAction(Entry entry, String hostname, PublicKey key) - throws IOException { + protected boolean hostKeyChangedAction(Entry entry, String hostname, PublicKey key) { log.warn("Host key for `{}` has changed!", hostname); return false; }