Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8276447 Deprecate finalization-related methods for removal #6465

Closed
wants to merge 34 commits into from

Conversation

bchristi-git
Copy link
Member

@bchristi-git bchristi-git commented Nov 18, 2021

Here are the code changes for the "Deprecate finalizers in the standard Java API" portion of JEP 421 ("Deprecate Finalization for Removal") for code review.

This change makes the indicated deprecations, and updates the API spec for JEP 421. It also updates the relevant @SuppressWarning annotations.

The CSR has been approved.
An automated test build+test run passes cleanly (FWIW :D ).


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed
  • Change requires a CSR request to be approved

Issues

  • JDK-8276447: Deprecate finalization-related methods for removal
  • JDK-8276748: Deprecate finalization-related methods for removal (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6465/head:pull/6465
$ git checkout pull/6465

Update a local copy of the PR:
$ git checkout pull/6465
$ git pull https://git.openjdk.java.net/jdk pull/6465/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6465

View PR using the GUI difftool:
$ git pr show -t 6465

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6465.diff

bchristi-git added 28 commits Nov 2, 2021
…fer to JVM with finalization disabled in MemoryMXBean
…fer to JVM with finalization disabled in MemoryMXBean
@bridgekeeper
Copy link

bridgekeeper bot commented Nov 18, 2021

👋 Welcome back bchristi! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 18, 2021

@bchristi-git The following labels will be automatically applied to this pull request:

  • client
  • core-libs
  • hotspot-jfr
  • i18n
  • net
  • nio
  • security
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot-jfr hotspot-jfr-dev@openjdk.org i18n i18n-dev@openjdk.org labels Nov 18, 2021
@openjdk
Copy link

openjdk bot commented Nov 18, 2021

⚠️ @bchristi-git This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 18, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 18, 2021

Webrevs

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

LGTM

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Looks good.

@openjdk
Copy link

openjdk bot commented Nov 19, 2021

@bchristi-git This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8276447: Deprecate finalization-related methods for removal

Reviewed-by: rriggs, alanb, lancea, darcy, mchung, serb, smarks, prr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 19, 2021
@@ -478,6 +478,12 @@ public final void wait(long timeoutMillis, int nanos) throws InterruptedExceptio
* A subclass overrides the {@code finalize} method to dispose of
* system resources or to perform other cleanup.
* <p>
* <b>When running in a Java virtual machine in which finalization has been
Copy link
Member

@mlchung mlchung Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling finalization is not part of the Java SE spec. This paragraph describes the implementation of HotSpot VM and I think it does not belong to this javadoc.

Copy link
Member Author

@bchristi-git bchristi-git Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The coupling between this change and 8276422 ("Add command-line option to disable finalization") is probably tighter than would be ideal. That CSR allows for finalization to be disabled in the SE Platform Spec and the JLS.

Copy link
Member

@mlchung mlchung Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing out that the CSR for JDK-8276422 ("Add command-line option to disable finalization") includes the change of the SE Platform Spec and JLS to allow an implementation for finalization to be disabled. This makes senses now.

mrserb
mrserb approved these changes Nov 19, 2021
@@ -113,6 +113,7 @@ protected void done() {

StringBuilder buf;

@SuppressWarnings("deprecation")
Copy link
Member

@stuart-marks stuart-marks Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item for future cleanup: refactor the call to getObjectPendingFinalizationCount() at line 219 (!) into a local variable declaration, and then move the warnings suppression to that declaration. This reduces the scope of warnings suppression.

prrace
prrace approved these changes Dec 6, 2021
@bchristi-git
Copy link
Member Author

bchristi-git commented Dec 8, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Dec 8, 2021

Going to push as commit ec7cb6d.
Since your change was applied there have been 27 commits pushed to the master branch:

  • 3c2951f: 8275771: JDK source code contains redundant boolean operations in jdk.compiler and langtools
  • 3d61372: 8278363: Create extented container test groups
  • 716c2e1: 8278368: ProblemList tools/jpackage/share/MultiNameTwoPhaseTest.java on macosx-x64
  • a8a1fbc: 8278068: Fix next-line modifier (snippet markup)
  • 061017a: 8273175: Add @SInCE tags to the DocTree.Kind enum constants
  • d7c283a: 8275233: Incorrect line number reported in exception stack trace thrown from a lambda expression
  • 3955b03: 8277328: jdk/jshell/CommandCompletionTest.java failures on Windows
  • 5a036ac: 8277990: NMT: Remove NMT shutdown capability
  • 7217cb7: 8274883: (se) Selector.open throws IAE when the default file system provider is changed to a custom provider
  • 7ea4b19: 8278166: java/nio/channels/Channels/TransferTo.java timed out
  • ... and 17 more: https://git.openjdk.java.net/jdk/compare/ea8d3c92c69c393cdbc6c62398f1e9c6adc708d3...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 8, 2021
@openjdk
Copy link

openjdk bot commented Dec 8, 2021

@bchristi-git Pushed as commit ec7cb6d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org core-libs core-libs-dev@openjdk.org hotspot-jfr hotspot-jfr-dev@openjdk.org i18n i18n-dev@openjdk.org integrated Pull request has been integrated net net-dev@openjdk.org nio nio-dev@openjdk.org security security-dev@openjdk.org serviceability serviceability-dev@openjdk.org
9 participants