-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8283660: Convert com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java finalizer to Cleaner #25242
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
…umeration for consistencty ; new instance vars can be final
…ome unneeded comments
👋 Welcome back bchristi! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@bchristi-git The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
Please review this change to replace the finalizer in
AbstractLdapNamingEnumeration
with Cleaner.(The first PR for this fix started some substantial discussions, leading to, among other things, the 8314480
java.lang.ref
memory ordering spec update.)In standard fashion, pieces of state required for cleanup (
LdapCtx homeCtx
,LdapResult res
, andLdapClient enumClnt
) are moved into a Context object. From there, the change is fairly mechanical.Details of note:
update()
method is probably the most interesting). Use ofreachabilityFence()
ensures memory visibility on the Cleaner thread (per the aforementioned spec update).homeCtx
; I added ahomeCtx()
method to readhomeCtx
from the superclass's state.The test case is based on a copy of
com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java
. It confirms that the use of Cleaner does not keep anLdapSearchEnumeration
object reachable. The otherAbstractLdapNamingEnumeration
subclasses (LdapNamingEnumeration
andLdapBindingEnumeration
) can be expected to behave the same.Thanks.
Edit: (Re)viewers: due to there being a lot of indentation changes, you might consider enabling the "Hide whitespace" option on the "Files changed" tab. To my eye, it gives a better view of the changes.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25242/head:pull/25242
$ git checkout pull/25242
Update a local copy of the PR:
$ git checkout pull/25242
$ git pull https://git.openjdk.org/jdk.git pull/25242/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25242
View PR using the GUI difftool:
$ git pr show -t 25242
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25242.diff
Using Webrev
Link to Webrev Comment