On Sun, 24 Oct 2021 16:27:02 GMT, andrewluotechnologies <d...@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

Reply via email to