Skip to content

Commit

Permalink
TrustOptions and KeyCertOptions should define a copy() method instead…
Browse files Browse the repository at this point in the history
… of clone()
  • Loading branch information
vietj committed Feb 16, 2019
1 parent 621eefb commit a5c9c34
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/vertx/core/net/JksOptions.java
Expand Up @@ -45,7 +45,7 @@
* @author <a href="http://tfox.org">Tim Fox</a>
*/
@DataObject(generateConverter = true)
public class JksOptions implements KeyCertOptions, TrustOptions, Cloneable {
public class JksOptions implements KeyCertOptions, TrustOptions {

private String password;
private String path;
Expand Down Expand Up @@ -184,7 +184,7 @@ public int hashCode() {
}

@Override
public JksOptions clone() {
public JksOptions copy() {
return new JksOptions(this);
}
}
2 changes: 1 addition & 1 deletion src/main/java/io/vertx/core/net/KeyCertOptions.java
Expand Up @@ -29,7 +29,7 @@ public interface KeyCertOptions {
/**
* @return a copy of these options
*/
KeyCertOptions clone();
KeyCertOptions copy();

/**
* Create and return the key manager factory for these options.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/vertx/core/net/PemKeyCertOptions.java
Expand Up @@ -88,7 +88,7 @@
* @author <a href="http://tfox.org">Tim Fox</a>
*/
@DataObject(generateConverter = true, publicConverter = false)
public class PemKeyCertOptions implements KeyCertOptions, Cloneable {
public class PemKeyCertOptions implements KeyCertOptions {

private List<String> keyPaths;
private List<Buffer> keyValues;
Expand Down Expand Up @@ -415,7 +415,7 @@ public int hashCode() {
}

@Override
public PemKeyCertOptions clone() {
public PemKeyCertOptions copy() {
return new PemKeyCertOptions(this);
}
}
2 changes: 1 addition & 1 deletion src/main/java/io/vertx/core/net/PemTrustOptions.java
Expand Up @@ -146,7 +146,7 @@ public PemTrustOptions addCertValue(Buffer certValue) throws NullPointerExceptio
}

@Override
public PemTrustOptions clone() {
public PemTrustOptions copy() {
return new PemTrustOptions(this);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/vertx/core/net/PfxOptions.java
Expand Up @@ -40,7 +40,7 @@
* @author <a href="http://tfox.org">Tim Fox</a>
*/
@DataObject(generateConverter = true, publicConverter = false)
public class PfxOptions implements KeyCertOptions, TrustOptions, Cloneable {
public class PfxOptions implements KeyCertOptions, TrustOptions {

private String password;
private String path;
Expand Down Expand Up @@ -179,7 +179,7 @@ public int hashCode() {
}

@Override
public PfxOptions clone() {
public PfxOptions copy() {
return new PfxOptions(this);
}
}
4 changes: 2 additions & 2 deletions src/main/java/io/vertx/core/net/TCPSSLOptions.java
Expand Up @@ -137,8 +137,8 @@ public TCPSSLOptions(TCPSSLOptions other) {
this.idleTimeout = other.getIdleTimeout();
this.idleTimeoutUnit = other.getIdleTimeoutUnit() != null ? other.getIdleTimeoutUnit() : DEFAULT_IDLE_TIMEOUT_TIME_UNIT;
this.ssl = other.isSsl();
this.keyCertOptions = other.getKeyCertOptions() != null ? other.getKeyCertOptions().clone() : null;
this.trustOptions = other.getTrustOptions() != null ? other.getTrustOptions().clone() : null;
this.keyCertOptions = other.getKeyCertOptions() != null ? other.getKeyCertOptions().copy() : null;
this.trustOptions = other.getTrustOptions() != null ? other.getTrustOptions().copy() : null;
this.enabledCipherSuites = other.getEnabledCipherSuites() == null ? new LinkedHashSet<>() : new LinkedHashSet<>(other.getEnabledCipherSuites());
this.crlPaths = new ArrayList<>(other.getCrlPaths());
this.crlValues = new ArrayList<>(other.getCrlValues());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/vertx/core/net/TrustOptions.java
Expand Up @@ -29,7 +29,7 @@ public interface TrustOptions {
/**
* @return a copy of these options
*/
TrustOptions clone();
TrustOptions copy();

/**
* Create and return the trust manager factory for these options.
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/io/vertx/core/http/HttpTLSTest.java
Expand Up @@ -784,7 +784,7 @@ protected TrustManager[] engineGetTrustManagers() {
}

@Override
public TrustOptions clone() {
public TrustOptions copy() {
return this;
}
}).serverSni()
Expand Down Expand Up @@ -826,7 +826,7 @@ protected TrustManager[] engineGetTrustManagers() {
}

@Override
public TrustOptions clone() {
public TrustOptions copy() {
return this;
}
}).serverSni()
Expand Down Expand Up @@ -861,7 +861,7 @@ protected TrustManager[] engineGetTrustManagers() {
};
}
@Override
public TrustOptions clone() {
public TrustOptions copy() {
return this;
}
}, Cert.SERVER_JKS, Trust.NONE).pass();
Expand Down

0 comments on commit a5c9c34

Please sign in to comment.