Withdrawn: JDK-8276939: Fix AbstractLdapNamingEnumeration next to throw NoSuchElementException instead of NullPointerException

duke duke at openjdk.java.net
Thu Jan 13 21:06:31 UTC 2022


On Sun, 24 Oct 2021 16:27:02 GMT, andrewluotechnologies <duke at openjdk.java.net> wrote:

> `AbstractLdapNamingEnumeration` `next` throws `NullPointerException` instead of `NoSuchElementException`, however the javadoc for `NamingEnumeration` says that next should throw `NoSuchElementException` when no elements are available (https://docs.oracle.com/en/java/javase/17/docs/api/java.naming/javax/naming/NamingEnumeration.html#next())
> 
> The bug is basically that `next()` calls `hasMore()` -> `hasMoreImpl()` which calls `cleanup()` when there are no more elements.  `cleanup()` sets `homeCtx = null;` which causes NullPointerException to be thrown on this line in `getNextBatch()`: `res = homeCtx.getSearchReply(enumClnt, res);`

This pull request has been closed without being integrated.

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

PR: https://git.openjdk.java.net/jdk/pull/6095


More information about the core-libs-dev mailing list