RFR: 8273402: Use derived NamingExceptions in com.sun.jndi.ldap.Connection#readReply

Aleksei Efimov aefimov at openjdk.java.net
Thu Sep 9 22:14:12 UTC 2021


Hi,
The following fix changes type of exception thrown when an LDAP operation fails for reasons like read timeout or connection closure/cancellation: instead of throwing a general `NamingException`, the internal LDAP connection class will throw a [`CommunicationException`](https://github.com/openjdk/jdk/blob/master/src/java.naming/share/classes/javax/naming/CommunicationException.java#L29) that better matches the reasons described.

Testing shows no problem with the proposed fix.

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

Commit messages:
 - 8273402: Remove redundant catch statement, change comment to match fix
 - 8273402: Use derived NamingExceptions in com.sun.jndi.ldap.Connection#readReply

Changes: https://git.openjdk.java.net/jdk/pull/5456/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5456&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8273402
  Stats: 41 lines in 3 files changed: 13 ins; 3 del; 25 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5456.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5456/head:pull/5456

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


More information about the core-libs-dev mailing list