From: reda-alaoui (@reda-alaoui) <noreply+reda-alaoui@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #3964: feat: add tcpKeepAliveCount, tcpKeepAliveIdle and tcpKeepAliveInterval connection properties
Date: Sat, 17 Oct 2026 09:11:50 +0000
Message-ID: <gh-pgjdbc-pgjdbc-3964-rc4302161171@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-3964-rc3972654749@github.com>
References: <gh-pgjdbc-pgjdbc-3964@github.com>
<gh-pgjdbc-pgjdbc-3964-rc3972654749@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/ExtendedSocketOptionAccessor.java)
Kept the interface and made it the declared type: `ExtendedSocketOptionAccessorImpl.INSTANCE` is now an `ExtendedSocketOptionAccessor` in both the java8 and java11 variants (76bd4f82), so no caller can reach the implementation type any more. The interface also has a job of its own: it is what makes the compiler keep the two multi-release variants in sync.
Every method is now documented. `isTcpKeep*Supported(Socket)` states its contract: the option is in the socket's `supportedOptions()`, which depends on the JDK, the operating system and the socket implementation, so it can be `false` on JDK 11+ too. The setters document `UnsupportedOperationException` and `IOException`, the getters their `null`.
With callers seeing only the interface's `throws IOException`, the java8 variant declaring narrower `throws` clauses no longer shows anywhere, so I left it.