RFR: 8377486: com.sun.jndi.ldap.sasl.SaslOutputStream.write() throws NullPointerException if it is already closed

Jaikiran Pai jpai at openjdk.org
Tue Feb 10 10:14:43 UTC 2026


Can I please get a review of this change which proposes to prevent the `NullPointerException` thrown from `com.sun.jndi.ldap.sasl.SaslOutputStream.write()` methods when the stream is already closed? This addresses https://bugs.openjdk.org/browse/JDK-8377486.

As noted in that issue, `OutputStream.write(...)` is specified to throw an `IOException` in such cases. The change in this PR updates the `SaslOutputStream.write()` methods to throw an `IOException` when closed.

A new test has been introduced to verify this change.

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

Commit messages:
 - add a test
 - 8377486: com.sun.jndi.ldap.sasl.SaslOutputStream.write() throws NullPointerException if it is already closed

Changes: https://git.openjdk.org/jdk/pull/29647/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29647&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8377486
  Stats: 151 lines in 2 files changed: 145 ins; 1 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/29647.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29647/head:pull/29647

PR: https://git.openjdk.org/jdk/pull/29647


More information about the core-libs-dev mailing list