Fix compile error introduced by 2c3d263e23

This commit is contained in:
Norman Maurer 2019-11-27 09:08:20 +01:00
parent f48d9fa8d0
commit b7ba807b30
2 changed files with 4 additions and 6 deletions

View File

@ -456,7 +456,7 @@ public final class SslContextBuilder {
*/
public SslContextBuilder keyManager(KeyManager keyManager) {
if (forServer) {
checkNotNull(keyManager, "keyManager required for servers");
requireNonNull(keyManager, "keyManager required for servers");
}
if (keyManager != null) {
this.keyManagerFactory = new KeyManagerFactoryWrapper(keyManager);
@ -584,7 +584,7 @@ public final class SslContextBuilder {
if (iterable == null) {
return null;
}
final List<T> list = new ArrayList<T>();
final List<T> list = new ArrayList<>();
for (T element : iterable) {
list.add(element);
}

View File

@ -16,24 +16,22 @@
package io.netty.handler.ssl.util;
import static io.netty.util.internal.ObjectUtil.checkNotNull;
import io.netty.util.internal.SuppressJava6Requirement;
import java.net.Socket;
import java.security.Principal;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.Objects;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.X509ExtendedKeyManager;
import javax.net.ssl.X509KeyManager;
@SuppressJava6Requirement(reason = "Usage guarded by java version check")
final class X509KeyManagerWrapper extends X509ExtendedKeyManager {
private final X509KeyManager delegate;
X509KeyManagerWrapper(X509KeyManager delegate) {
this.delegate = checkNotNull(delegate, "delegate");
this.delegate = Objects.requireNonNull(delegate, "delegate");
}
@Override