RFR: 8049630: Custom socket factory is not checked for the existence of a getDefault() method

Daniel Fuchs dfuchs at openjdk.org
Fri Feb 13 09:49:36 UTC 2026


On Fri, 13 Feb 2026 02:19:31 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this change which addresses the issues noted in https://bugs.openjdk.org/browse/JDK-8049630 and https://bugs.openjdk.org/browse/JDK-8049619?
> 
> The `java.naming` module allows for the `java.naming.ldap.factory.socket` environment property to be configured to point to the class name of the implementation of a `javax.net.SocketFactory`. As noted in the specification of that property https://docs.oracle.com/en/java/javase/25/docs/api/java.naming/module-summary.html:
> 
>> The value of this environment property specifies the fully qualified class name of the socket factory used by the LDAP provider. This class must implement the SocketFactory abstract class and provide an implementation of the static "getDefault()" method that returns an instance of the socket factory.
> 
> The implementation in the JDK default LDAP provider currently doesn't verify that the given class name points to a type which is `javax.net.SocketFactory`, nor does it verify that the correct expected `getDefault()` method exists. The changes in this PR addresses that issue and introduces a jtreg test to reproduce the issue and verify the fix.
> 
> Given the nature of this change, I believe a CSR will be needed which I'll file shortly.

Nice cleanup. I agree that CSR and release notes are needed. Thanks for drafting those already.

-------------

Marked as reviewed by dfuchs (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29706#pullrequestreview-3796190614


More information about the core-libs-dev mailing list