redundant exception declarations

This commit is contained in:
Shikhar Bhushan
2010-03-21 01:25:24 +01:00
parent 71b6cee424
commit db4185608d
5 changed files with 7 additions and 13 deletions

View File

@@ -607,7 +607,7 @@ public class SSHClient
* @throws TransportException if an error occurs during renegotiation * @throws TransportException if an error occurs during renegotiation
*/ */
public void useCompression() public void useCompression()
throws ClassNotFoundException, TransportException { throws TransportException {
trans.getConfig().setCompressionFactories(Arrays.asList( trans.getConfig().setCompressionFactories(Arrays.asList(
new DelayedZlibCompression.Factory(), new DelayedZlibCompression.Factory(),
new ZlibCompression.Factory(), new ZlibCompression.Factory(),

View File

@@ -17,7 +17,6 @@ package net.schmizz.sshj.connection.channel;
import net.schmizz.sshj.common.SSHRuntimeException; import net.schmizz.sshj.common.SSHRuntimeException;
import net.schmizz.sshj.connection.ConnectionException; import net.schmizz.sshj.connection.ConnectionException;
import net.schmizz.sshj.transport.TransportException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -105,8 +104,7 @@ public abstract class Window {
threshold = Math.min(maxPacketSize * 20, initialSize / 4); threshold = Math.min(maxPacketSize * 20, initialSize / 4);
} }
public int neededAdjustment() public int neededAdjustment() {
throws TransportException {
synchronized (lock) { synchronized (lock) {
return (size - threshold <= 0) ? (initialSize - size) : 0; return (size - threshold <= 0) ? (initialSize - size) : 0;
} }

View File

@@ -128,13 +128,12 @@ public class RemotePortForwarder
private final Forward fwd; private final Forward fwd;
public ForwardedTCPIPChannel(Connection conn, int recipient, int remoteWinSize, int remoteMaxPacketSize, public ForwardedTCPIPChannel(Connection conn, int recipient, int remoteWinSize, int remoteMaxPacketSize,
Forward fwd, String origIP, int origPort) Forward fwd, String origIP, int origPort) {
throws TransportException {
super(conn, TYPE, recipient, remoteWinSize, remoteMaxPacketSize, origIP, origPort); super(conn, TYPE, recipient, remoteWinSize, remoteMaxPacketSize, origIP, origPort);
this.fwd = fwd; this.fwd = fwd;
} }
/** Returns the forwarding from which this channel originates. */ /** @return the forwarding from which this channel originates. */
public Forward getParentForward() { public Forward getParentForward() {
return fwd; return fwd;
} }

View File

@@ -60,8 +60,7 @@ public class ConsoleKnownHostsVerifier
} }
@Override @Override
protected boolean hostKeyChangedAction(Entry entry, String hostname, PublicKey key) protected boolean hostKeyChangedAction(Entry entry, String hostname, PublicKey key) {
throws IOException {
final KeyType type = KeyType.fromKey(key); final KeyType type = KeyType.fromKey(key);
final String fp = SecurityUtils.getFingerprint(key); final String fp = SecurityUtils.getFingerprint(key);
final String path = getFile().getAbsolutePath(); final String path = getFile().getAbsolutePath();

View File

@@ -204,8 +204,7 @@ public class OpenSSHKnownHosts
return saltyBytes; return saltyBytes;
} }
private String getSalt() private String getSalt() {
throws IOException {
if (salt == null) { if (salt == null) {
salt = Base64.encodeBytes(saltyBytes); salt = Base64.encodeBytes(saltyBytes);
} }
@@ -269,8 +268,7 @@ public class OpenSSHKnownHosts
return false; return false;
} }
protected boolean hostKeyChangedAction(Entry entry, String hostname, PublicKey key) protected boolean hostKeyChangedAction(Entry entry, String hostname, PublicKey key) {
throws IOException {
log.warn("Host key for `{}` has changed!", hostname); log.warn("Host key for `{}` has changed!", hostname);
return false; return false;
} }