Intellij compilation fixed

pull/5477/merge
Nikita Koksharov 1 year ago
parent a6b7c9e920
commit 5b5d7366ab

@ -39,7 +39,6 @@ import io.netty.util.NetUtil;
import io.netty.util.Timer;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener;
import jdk.net.ExtendedSocketOptions;
import org.redisson.api.RFuture;
import org.redisson.client.handler.RedisChannelInitializer;
import org.redisson.client.handler.RedisChannelInitializer.Type;
@ -149,9 +148,12 @@ public final class RedisClient {
SocketOption<Integer> idleOption = null;
SocketOption<Integer> intervalOption = null;
try {
countOption = (SocketOption<Integer>) ExtendedSocketOptions.class.getDeclaredField("TCP_KEEPCOUNT").get(null);
idleOption = (SocketOption<Integer>) ExtendedSocketOptions.class.getDeclaredField("TCP_KEEPIDLE").get(null);
intervalOption = (SocketOption<Integer>) ExtendedSocketOptions.class.getDeclaredField("TCP_KEEPINTERVAL").get(null);
// fixes Intellij compilation issue with JDK 1.8
Class<?> options = Class.forName("jdk.net.ExtendedSocketOptions");
countOption = (SocketOption<Integer>) options.getDeclaredField("TCP_KEEPCOUNT").get(null);
idleOption = (SocketOption<Integer>) options.getDeclaredField("TCP_KEEPIDLE").get(null);
intervalOption = (SocketOption<Integer>) options.getDeclaredField("TCP_KEEPINTERVAL").get(null);
} catch (ReflectiveOperationException e) {
// skip
}

Loading…
Cancel
Save