On Wed, 11 Nov 2026 15:20:28 GMT, Volkan Yazici <[email protected]> wrote:

>> Jaikiran Pai has updated the pull request with a new target base due to a 
>> merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains five additional 
>> commits since the last revision:
>> 
>>  - do not reattempt search for subschemasubentry when root DSE has already 
>> been searched for
>>  - update the test to test against base DN when constructing the DirContext
>>  - merge latest from master branch
>>  - add test
>>  - 8396120: Wrong comparison in LdapCtx causes NoSuchElementException
>
> test/jdk/com/sun/jndi/ldap/LdapCtxGetSchemaTest.java line 1:
> 
>> 1: /*
> 
> *Nit:* There is an `LdapCtx` folder in the same directory. This test can be 
> better suited there.

Hello Volkan, majority of the tests in `test/jdk/com/sun/jndi/ldap` are all for 
the `LdapCtx` (that context is an internal class which gets constructed through 
the use of `com.sun.jndi.ldap.LdapCtxFactory` factory). So the sole `Reconnect` 
test under `test/jdk/com/sun/jndi/ldap/LdapCtx` is an exception.  A brief look 
suggests that that test could be moved out of that directory. I'll come back to 
that at a later date (on a lower priority).

> test/jdk/com/sun/jndi/ldap/LdapCtxGetSchemaTest.java line 102:
> 
>> 100:                 .scheme("ldap")
>> 101:                 .host(server.getInetAddress().getHostAddress())
>> 102:                 .port(server.getPort())
> 
> The test uses an empty base DN. If you introduce a non-empty base DN:
> 
> Suggestion:
> 
>                 .port(server.getPort())
>                 .path("/dc=openjdk,dc=org")
> 
> 
>  and run the test again, you bump to a stack overflow due to recursion at 
> `LdapCtx.java:1748`.

Daniel too spotted this issue. I have updated the PR to fix this issue in 
`LdapCtx.getSchemaEntry(...)` and updated the test to reproduce the issue and 
verify the fix.

> test/jdk/com/sun/jndi/ldap/LdapCtxGetSchemaTest.java line 118:
> 
>> 116:      */
>> 117:     @Test
>> 118:     void testGetSchema() throws Exception {
> 
> `throws Exception` is redundant:
> 
> Suggestion:
> 
>     void testGetSchema() {

Given the latest changes to the test, the test method does require a throws 
clause, so I've retained it.

> test/jdk/com/sun/jndi/ldap/LdapCtxGetSchemaTest.java line 130:
> 
>> 128:      */
>> 129:     @Test
>> 130:     void testGetSchemaString() throws Exception {
> 
> `throws Exception` is redundant:
> 
> Suggestion:
> 
>     void testGetSchemaString() {

Same comment as the one above, the updated test requires a throws clause.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33838#discussion_r4599432428
PR Review Comment: https://git.openjdk.org/jdk/pull/33838#discussion_r4599455961
PR Review Comment: https://git.openjdk.org/jdk/pull/33838#discussion_r4599468032
PR Review Comment: https://git.openjdk.org/jdk/pull/33838#discussion_r4599471834

Reply via email to