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

8344252: SM cleanup in java.util classes #22122

Closed
wants to merge 3 commits into from

Conversation

RogerRiggs
Copy link
Contributor

@RogerRiggs RogerRiggs commented Nov 14, 2024

Remove use of doPrivileged and SecurityManager in java.util.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8344252: SM cleanup in java.util classes (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22122

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

Using diff file

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

Using Webrev

Link to Webrev Comment

Remove use of doPrivileged and SecurityManager
@bridgekeeper
Copy link

bridgekeeper bot commented Nov 14, 2024

👋 Welcome back rriggs! 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 14, 2024

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

8344252: SM cleanup in java.util classes

Reviewed-by: naoto, smarks

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

  • ff12ff5: 8340453: C2: Improve encoding of LoadNKlass for compact headers
  • 1866c0c: 8344259: Annotate Float16 with jdk.internal.ValueBased
  • 0b9b82a: 8343039: Remove jdk.internal.misc.InternalLock and usages from java.io
  • 3c38ed4: 8344314: Revert removal of jdk.internal.java.PreviewFeature.CLASSFILE_API
  • 40a055e: 8344228: Revisit SecurityManager usage in java.net.http after JEP 486 integration
  • 84ffb64: 8334714: Implement JEP 484: Class-File API
  • 6cdebf0: 8343599: Kmem limit and max values swapped when printing container information
  • a672138: 8344161: Argument type mismatch for jfr_type_id
  • 3245f56: 8344164: [s390x] ProblemList hotspot/jtreg/runtime/NMT/VirtualAllocCommitMerge.java
  • 5e27608: 8344188: Cleanup sun.net.www.protocol.jar.JarFileFactory after JEP 486 integration
  • ... and 22 more: https://git.openjdk.org/jdk/compare/752e1629555f0ec8630373ec87b049afdd709ea6...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 the rfr Pull request is ready for review label Nov 14, 2024
@openjdk
Copy link

openjdk bot commented Nov 14, 2024

@RogerRiggs The following labels will be automatically applied to this pull request:

  • core-libs
  • i18n

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 core-libs core-libs-dev@openjdk.org i18n i18n-dev@openjdk.org labels Nov 14, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 14, 2024

Webrevs

@stuart-marks
Copy link
Member

I mainly wanted to look at Arrays, and I looked briefly at the other stuff too. All looks good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 15, 2024
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Nov 15, 2024
Comment on lines 81 to 82
* @see <a href="ResourceBundle##resource-bundle-modules">
* Resource Bundles and Named Modules</a>
Copy link
Member

Choose a reason for hiding this comment

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

I think HTML tag is not needed:

Suggested change
* @see <a href="ResourceBundle##resource-bundle-modules">
* Resource Bundles and Named Modules</a>
* @see ResourceBundle##resource-bundle-modules
* Resource Bundles and Named Modules

Copy link
Member

@naotoj naotoj left a comment

Choose a reason for hiding this comment

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

LGTM

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 15, 2024
@RogerRiggs
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 15, 2024

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

  • 59ffac8: 8342811: java/net/httpclient/PlainProxyConnectionTest.java failed: Unexpected connection count: 5
  • f316808: 8344189: Cleanup code in sun.net.www.protocol.mailto.MailToURLConnection and sun.net.smtp after JEP 486 integration
  • 73fd891: 8344216: Remove calls to SecurityManager and and doPrivileged in java.net.Authenticator, java.net.CookieHandler, and java.net.ResponseCache after JEP 486 integration
  • f62e05e: 8344231: SecurityManager cleanup in java.lang.module and jdk.internal.module
  • 1bb0d3b: 8344062: Remove doPrivileged calls from awt and beans classes in the java.desktop module
  • fc8fb34: 8344214: Remove Security Manager dependencies from jdk.crypto.mscapi module
  • ff12ff5: 8340453: C2: Improve encoding of LoadNKlass for compact headers
  • 1866c0c: 8344259: Annotate Float16 with jdk.internal.ValueBased
  • 0b9b82a: 8343039: Remove jdk.internal.misc.InternalLock and usages from java.io
  • 3c38ed4: 8344314: Revert removal of jdk.internal.java.PreviewFeature.CLASSFILE_API
  • ... and 28 more: https://git.openjdk.org/jdk/compare/752e1629555f0ec8630373ec87b049afdd709ea6...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 15, 2024

@RogerRiggs Pushed as commit c5b6ed8.

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

@@ -3722,8 +3654,8 @@ private static String toPackageName(String bundleName) {

}

private static final boolean TRACE_ON = Boolean.parseBoolean(
GetPropertyAction.privilegedGetProperty("resource.bundle.debug", "false"));
private static final boolean TRACE_ON = Boolean.getBoolean(
Copy link
Contributor

@eirbjo eirbjo Dec 7, 2024

Choose a reason for hiding this comment

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

This update seems to have broken the tracing feature of ResourceBundle.

The previous code called GetPropertyAction::privilegedGetProperty to get the system property "resource.bundle.debug" with a default of "false". It then used Boolean::parseBoolean to compare it to "true", ignoring case.

The new code uses System::getProperty to get the same property, then calls Boolean::getBoolean which calls System::getProperty to get the value of the property which name is either "false" or the result of looking up "resource.bundle.debug"

From what I can tell, it is now not possible to enable tracing.

Seems like we could simply use Boolean.getBoolean("resource.bundle.debug") instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we could simply use Boolean.getBoolean("resource.bundle.debug") instead?

Naoto may know the history on this property. It may have been introduced for debugging when working on the RB implementation or maybe it was introduced to allow developers to debug, not sure. If the latter then it's important to preserve long standing behavior. If the former, and it was never documented, there is a lot more flexibility to change.

Copy link
Contributor

@eirbjo eirbjo Dec 9, 2024

Choose a reason for hiding this comment

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

If the former, and it was never documented, there is a lot more flexibility to change.

Fair enough. However, this SM change seems to accidentally have introduced a bug where the system property is read twice, first calling System.getProperty to look up the name of the system property which is then looked up by Boolean.getBoolean. That behavior just seems broken.

@RogerRiggs may have intended to use Boolean::parseBoolean instead:

Boolean.parseBoolean(System.getProperty("resource.bundle.debug", "false"))

which is equivalent to:

Boolean.getBoolean("resource.bundle.debug")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RogerRiggs RogerRiggs deleted the 8344252-sm-util branch February 24, 2025 14:15
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 i18n i18n-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

None yet

5 participants