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

8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized} #15707

Closed
wants to merge 1 commit into from

Conversation

AlanBateman
Copy link
Contributor

@AlanBateman AlanBateman commented Sep 13, 2023

Unsafe.{shouldBeInitialized,ensureClassInitialized} are deprecated for removal since JDK 15. It's time to remove them. Lookup.ensureInitialized(Class) was added in Java 15 as a standard API to ensure that an accessible class is initialized.

A search of 175973022 classes in 484751 artifacts found:

  • 23 usages of Unsafe.shouldBeInitialized, of which 8 are unique
  • 121 usages of Unsafe.ensureClassInitialized, of which 31 are unique

Not a lot of usage, many of the usages seem to be code compiled to older releases.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Change requires CSR request JDK-8316284 to be approved
  • Commit message must refer to an issue

Issues

  • JDK-8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized} (Enhancement - P4)
  • JDK-8316284: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized} (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15707/head:pull/15707
$ git checkout pull/15707

Update a local copy of the PR:
$ git checkout pull/15707
$ git pull https://git.openjdk.org/jdk.git pull/15707/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15707

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15707.diff

Webrev

Link to Webrev Comment

@AlanBateman
Copy link
Contributor Author

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 13, 2023

👋 Welcome back alanb! 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 openjdk bot added the csr Pull request needs approved CSR before integration label Sep 13, 2023
@openjdk
Copy link

openjdk bot commented Sep 13, 2023

@AlanBateman has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@AlanBateman please create a CSR request for issue JDK-8316160 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@openjdk
Copy link

openjdk bot commented Sep 13, 2023

@AlanBateman The following label will be automatically applied to this pull request:

  • core-libs

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.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Sep 13, 2023
@AlanBateman AlanBateman marked this pull request as ready for review September 14, 2023 10:19
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 14, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 14, 2023

Webrevs

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

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

Times up.

@openjdk
Copy link

openjdk bot commented Sep 14, 2023

@AlanBateman 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:

8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized}

Reviewed-by: rriggs, mchung, jpai

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 44 new commits pushed to the master branch:

  • 8dc2d92: 8316190: Improve MemorySegment::toString
  • 783e44d: 8316326: ProblemList java/awt/Mouse/EnterExitEvents/DragWindowTest.java on macosx-all again
  • 96781ba: 8312332: C2: Refactor SWPointer out from SuperWord
  • b55e418: 8301991: Convert l10n properties resource bundles to UTF-8 native
  • d475f61: 8315731: Open source several Swing Text related tests
  • 4415261: 8315683: Parallelize java/util/concurrent/tck/JSR166TestCase.java
  • b2e9106: 8313452: Improve Classfile API attributes handling safety
  • 2a6fb9c: 8316147: Remove serviceability/sa/TestJhsdbJstackMixed.java from -Xcomp problem list
  • ca747f0: 8315678: Classfile API ConstantPool::entryCount and ConstantPool::entryByIndex methods are confusing
  • 6d47fc6: 8313258: RuntimeInvisibleTypeAnnotationsAttribute.annotations() API Index out of Bound error
  • ... and 34 more: https://git.openjdk.org/jdk/compare/ece9bdfc838a5c419c789319ff794f1ae29b0256...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this 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 ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Sep 14, 2023
@AlanBateman
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 15, 2023

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

  • 86dde5e: 8316001: GC: Make TestArrayAllocatorMallocLimit use createTestJvm
  • 4f864fa: 8314136: Test java/net/httpclient/CancelRequestTest.java failed: WARNING: tracker for HttpClientImpl(42) has outstanding operations
  • 4070829: 8315931: RISC-V: xxxMaxVectorTestsSmokeTest fails when using RVV
  • d575968: 8316178: Better diagnostic header for CodeBlobs
  • bfbc41c: 8315741: Open source few swing JFormattedTextField and JPopupMenu tests
  • 0775bf2: 8316106: Open source few swing JInternalFrame and JMenuBar tests
  • 4a63eb0: 8315834: Open source several Swing JSpinner related tests
  • 8dc2d92: 8316190: Improve MemorySegment::toString
  • 783e44d: 8316326: ProblemList java/awt/Mouse/EnterExitEvents/DragWindowTest.java on macosx-all again
  • 96781ba: 8312332: C2: Refactor SWPointer out from SuperWord
  • ... and 41 more: https://git.openjdk.org/jdk/compare/ece9bdfc838a5c419c789319ff794f1ae29b0256...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 15, 2023
@openjdk openjdk bot closed this Sep 15, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 15, 2023
@openjdk
Copy link

openjdk bot commented Sep 15, 2023

@AlanBateman Pushed as commit 25f32f3.

💡 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
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
4 participants