RFR: 8049630: Custom socket factory is not checked for the existence of a getDefault() method
Jaikiran Pai
jpai at openjdk.org
Fri Feb 13 02:28:05 UTC 2026
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.
-------------
Commit messages:
- 8049630: Custom socket factory is not checked for the existence of a getDefault() method
Changes: https://git.openjdk.org/jdk/pull/29706/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29706&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8049630
Stats: 180 lines in 3 files changed: 167 ins; 0 del; 13 mod
Patch: https://git.openjdk.org/jdk/pull/29706.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29706/head:pull/29706
PR: https://git.openjdk.org/jdk/pull/29706
More information about the core-libs-dev
mailing list