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

Loading…
Cancel
Save