mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 07:10:53 +03:00
Make private fields final (#1005)
This commit is contained in:
@@ -28,7 +28,7 @@ public class IdentificationStringParser {
|
||||
private final Logger log;
|
||||
private final Buffer.PlainBuffer buffer;
|
||||
|
||||
private byte[] EXPECTED_START_BYTES = new byte[] {'S', 'S', 'H', '-'};
|
||||
private final byte[] EXPECTED_START_BYTES = new byte[] {'S', 'S', 'H', '-'};
|
||||
|
||||
public IdentificationStringParser(Buffer.PlainBuffer buffer) {
|
||||
this(buffer, LoggerFactory.DEFAULT);
|
||||
|
||||
@@ -121,11 +121,11 @@ public class BlockCiphers {
|
||||
public static class Factory
|
||||
implements net.schmizz.sshj.common.Factory.Named<Cipher> {
|
||||
|
||||
private int keysize;
|
||||
private String cipher;
|
||||
private String mode;
|
||||
private String name;
|
||||
private int ivsize;
|
||||
private final int keysize;
|
||||
private final String cipher;
|
||||
private final String mode;
|
||||
private final String name;
|
||||
private final int ivsize;
|
||||
|
||||
/**
|
||||
* @param ivsize
|
||||
|
||||
@@ -33,12 +33,12 @@ public class GcmCiphers {
|
||||
public static class Factory
|
||||
implements net.schmizz.sshj.common.Factory.Named<Cipher> {
|
||||
|
||||
private int keysize;
|
||||
private int authSize;
|
||||
private String cipher;
|
||||
private String mode;
|
||||
private String name;
|
||||
private int ivsize;
|
||||
private final int keysize;
|
||||
private final int authSize;
|
||||
private final String cipher;
|
||||
private final String mode;
|
||||
private final String name;
|
||||
private final int ivsize;
|
||||
|
||||
/**
|
||||
* @param ivsize
|
||||
|
||||
@@ -40,10 +40,10 @@ public class StreamCiphers {
|
||||
public static class Factory
|
||||
implements net.schmizz.sshj.common.Factory.Named<Cipher> {
|
||||
|
||||
private int keysize;
|
||||
private String cipher;
|
||||
private String mode;
|
||||
private String name;
|
||||
private final int keysize;
|
||||
private final String cipher;
|
||||
private final String mode;
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* @param keysize The keysize used in bits.
|
||||
|
||||
@@ -28,8 +28,8 @@ import java.security.GeneralSecurityException;
|
||||
*
|
||||
*/
|
||||
public class DHG extends AbstractDHG {
|
||||
private BigInteger group;
|
||||
private BigInteger generator;
|
||||
private final BigInteger group;
|
||||
private final BigInteger generator;
|
||||
|
||||
public DHG(BigInteger group, BigInteger generator, Digest digest) {
|
||||
super(new DH(), digest);
|
||||
|
||||
@@ -68,10 +68,10 @@ public class DHGroups {
|
||||
public static class Factory
|
||||
implements net.schmizz.sshj.common.Factory.Named<KeyExchange> {
|
||||
|
||||
private String name;
|
||||
private BigInteger group;
|
||||
private BigInteger generator;
|
||||
private Factory.Named<Digest> digestFactory;
|
||||
private final String name;
|
||||
private final BigInteger group;
|
||||
private final BigInteger generator;
|
||||
private final Factory.Named<Digest> digestFactory;
|
||||
|
||||
public Factory(String name, BigInteger group, BigInteger generator, Named<Digest> digestFactory) {
|
||||
this.name = name;
|
||||
|
||||
@@ -71,10 +71,10 @@ public class Macs {
|
||||
|
||||
public static class Factory implements net.schmizz.sshj.common.Factory.Named<MAC> {
|
||||
|
||||
private String name;
|
||||
private String algorithm;
|
||||
private int bSize;
|
||||
private int defBSize;
|
||||
private final String name;
|
||||
private final String algorithm;
|
||||
private final int bSize;
|
||||
private final int defBSize;
|
||||
private final boolean etm;
|
||||
|
||||
public Factory(String name, String algorithm, int bSize, int defBSize, boolean etm) {
|
||||
|
||||
@@ -57,7 +57,7 @@ public class KnownHostMatchers {
|
||||
}
|
||||
|
||||
private static class EquiHostMatcher implements HostMatcher {
|
||||
private String host;
|
||||
private final String host;
|
||||
|
||||
public EquiHostMatcher(String host) {
|
||||
this.host = host;
|
||||
|
||||
@@ -37,7 +37,7 @@ public final class ChannelOutputStream extends OutputStream implements ErrorNoti
|
||||
private final DataBuffer buffer = new DataBuffer();
|
||||
private final byte[] b = new byte[1];
|
||||
|
||||
private AtomicBoolean closed;
|
||||
private final AtomicBoolean closed;
|
||||
private SSHException error;
|
||||
|
||||
private final class DataBuffer {
|
||||
|
||||
@@ -77,7 +77,7 @@ public class SignatureECDSA extends AbstractSignatureDSA {
|
||||
|
||||
}
|
||||
|
||||
private String keyTypeName;
|
||||
private final String keyTypeName;
|
||||
|
||||
public SignatureECDSA(String algorithm, String keyTypeName) {
|
||||
super(algorithm, keyTypeName);
|
||||
|
||||
@@ -87,7 +87,7 @@ public class SignatureRSA
|
||||
|
||||
}
|
||||
|
||||
private KeyType keyType;
|
||||
private final KeyType keyType;
|
||||
|
||||
|
||||
public SignatureRSA(String algorithm, KeyType keyType, String name) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.security.spec.ECGenParameterSpec;
|
||||
|
||||
public class ECDHNistP extends AbstractDHG {
|
||||
|
||||
private String curve;
|
||||
private final String curve;
|
||||
|
||||
/** Named factory for ECDHNistP key exchange */
|
||||
public static class Factory521
|
||||
|
||||
@@ -475,7 +475,7 @@ public class OpenSSHKnownHosts
|
||||
}
|
||||
|
||||
public static class BadHostEntry implements KnownHostEntry {
|
||||
private String line;
|
||||
private final String line;
|
||||
|
||||
public BadHostEntry(String line) {
|
||||
this.line = line;
|
||||
|
||||
@@ -101,7 +101,7 @@ public class PuTTYKeyFile extends BaseFileKeyProvider {
|
||||
throw new IOException(String.format("Unsupported encryption: %s", encryption));
|
||||
}
|
||||
|
||||
private Map<String, String> payload = new HashMap<String, String>();
|
||||
private final Map<String, String> payload = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* For each line that looks like "Xyz: vvv", it will be stored in this map.
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ScpCommandLine {
|
||||
}
|
||||
}
|
||||
|
||||
private LinkedHashMap<Arg, String> arguments = new LinkedHashMap<Arg, String>();
|
||||
private final LinkedHashMap<Arg, String> arguments = new LinkedHashMap<Arg, String>();
|
||||
private String path;
|
||||
|
||||
ScpCommandLine() {
|
||||
|
||||
Reference in New Issue
Block a user