RFR: 8377486: com.sun.jndi.ldap.sasl.SaslOutputStream.write() throws NullPointerException if it is already closed
Jaikiran Pai
jpai at openjdk.org
Tue Feb 17 16:47:59 UTC 2026
On Tue, 17 Feb 2026 14:48:46 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
> However, is it possible that close() is called asynchronously?
The `SaslOutputStream` instance gets used by the `com.sun.jndi.ldap.Connection`. That `outStream` instance is `close()`d when that `Connection` is being closed (`cleanup()` calls `flushAndCloseOutputStream()`). Similarly, the `Connection` instance issues `outStream.write(...)` calls in a few places. Both the `outStream.close()` and `outStream.write(...)` calls are issued when holding the (same) `lock`. So there doesn't appear to be any concurrent calls to `close()` and `write(...)` on the `SaslOutputStream` instance.
Other than the `Connection` class, from what I can see in the code, the `SaslOutputStream` stream instance doesn't get closed or written to.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29647#issuecomment-3915829386
More information about the core-libs-dev
mailing list