diff --git a/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java b/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java index 666324f57a..294861f977 100644 --- a/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java +++ b/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java @@ -24,8 +24,6 @@ import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; import java.lang.reflect.Constructor; -import java.security.AccessController; -import java.security.PrivilegedAction; /** * This static factory should be used to load {@link ResourceLeakDetector}s as needed @@ -104,8 +102,7 @@ public abstract class ResourceLeakDetectorFactory { DefaultResourceLeakDetectorFactory() { String customLeakDetector; try { - customLeakDetector = AccessController.doPrivileged((PrivilegedAction) () -> - SystemPropertyUtil.get("io.netty.customResourceLeakDetector")); + customLeakDetector = SystemPropertyUtil.get("io.netty.customResourceLeakDetector"); } catch (Throwable cause) { logger.error("Could not access System property: io.netty.customResourceLeakDetector", cause); customLeakDetector = null; diff --git a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java index 6e204b5255..3599f5e4ed 100644 --- a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java +++ b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java @@ -32,9 +32,7 @@ import io.netty.util.internal.UnstableApi; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; -import java.security.AccessController; import java.security.PrivateKey; -import java.security.PrivilegedAction; import java.security.SignatureException; import java.security.cert.CertPathValidatorException; import java.security.cert.Certificate; @@ -81,10 +79,9 @@ public abstract class ReferenceCountedOpenSslContext extends SslContext implemen private static final InternalLogger logger = InternalLoggerFactory.getInstance(ReferenceCountedOpenSslContext.class); - private static final int DEFAULT_BIO_NON_APPLICATION_BUFFER_SIZE = - AccessController.doPrivileged((PrivilegedAction) () -> Math.max(1, - SystemPropertyUtil.getInt("io.netty.handler.ssl.openssl.bioNonApplicationBufferSize", - 2048))); + private static final int DEFAULT_BIO_NON_APPLICATION_BUFFER_SIZE = Math.max(1, + SystemPropertyUtil.getInt("io.netty.handler.ssl.openssl.bioNonApplicationBufferSize", + 2048)); static final boolean USE_TASKS = SystemPropertyUtil.getBoolean("io.netty.handler.ssl.openssl.useTasks", false); private static final Integer DH_KEY_LENGTH; @@ -165,8 +162,7 @@ public abstract class ReferenceCountedOpenSslContext extends SslContext implemen Integer dhLen = null; try { - String dhKeySize = AccessController.doPrivileged((PrivilegedAction) () -> - SystemPropertyUtil.get("jdk.tls.ephemeralDHKeySize")); + String dhKeySize = SystemPropertyUtil.get("jdk.tls.ephemeralDHKeySize"); if (dhKeySize != null) { try { dhLen = Integer.valueOf(dhKeySize);