> Please review this change to replace the finalizer in > `AbstractLdapNamingEnumeration` with a Cleaner. > > The pieces of state required for cleanup (`LdapCtx homeCtx`, `LdapResult > res`, and `LdapClient enumClnt`) are moved to a static inner class . From > there, the change is fairly mechanical. > > Details of note: > 1. Some operations need to change the state values (the update() method is > probably the most interesting). > 2. Subclasses need to access `homeCtx`; I added a `homeCtx()` method to read > `homeCtx` from the superclass's `state`. > > The test case is based on a copy of > `com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java`. A more minimal test case > might be possible, but this was done for expediency. > > The test only confirms that the new Cleaner use does not keep the object > reachable. It only tests `LdapSearchEnumeration` (not `LdapNamingEnumeration` > or `LdapBindingEnumeration`, though all are subclasses of > `AbstractLdapNamingEnumeration`). > > Thanks.
Brent Christian has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 26 commits: - remove tab - Merge conflicts - Convert fix to use VarHandle fences - Merge branch 'master' into remove-finalizers - reference emunCtx and homeCtx consistently in constructor - Restore EnumCtx to being an inner class, to keep all the state together in the code - Restore comments in ldap capture file - Update test files - add copyright, etc - added getters to EnumCtx, and moved it to top level ; use getters + local variables to reduce code changes - test comment udpate - ... and 16 more: https://git.openjdk.org/jdk/compare/b1817a30...dc444a54 ------------- Changes: https://git.openjdk.org/jdk/pull/8311/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=8311&range=13 Stats: 847 lines in 7 files changed: 505 ins; 119 del; 223 mod Patch: https://git.openjdk.org/jdk/pull/8311.diff Fetch: git fetch https://git.openjdk.org/jdk pull/8311/head:pull/8311 PR: https://git.openjdk.org/jdk/pull/8311