On Fri, 28 Aug 2026 22:00:45 GMT, Brent Christian <[email protected]> wrote:
> > The finalizers are put in place for the cases when dispose() is not > > explicitly called. > > Speaking of that, I've noticed the example code in the `SaslClient` and > `SaslServer` JavaDoc does not call `dispose()`. Maybe a `dispose()` call > could be added, if it's in-scope of those examples. Either as part of this > change, or as a follow-up. Yes, I think important that all of these examples should use try-finally to demonstrate closely the resource explicitly. Is there examples in the API docs that could be improved too? In general we need to strongly encourage developers and agents to not rely on automatic cleanup when using these APIs. In time then I hope we can drop the use of cleaners from this code. ------------- PR Comment: https://git.openjdk.org/jdk/pull/32551#issuecomment-5460843836
