Skip to content

8344233: Remove calls to SecurityManager and doPrivileged in java.net.ProxySelector and sun.net.spi.DefaultProxySelector after JEP 486 integration #22145

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

Closed
wants to merge 2 commits into from

Conversation

jaikiran
Copy link
Member

@jaikiran jaikiran commented Nov 15, 2024

Can I please get a review of this change which removes calls to SecurityManager and AccessController.doPrivileged() from the ProxySelector and DefaultProxySelector classes?

Apart from the trivial removing of those calls, the commit in this PR also removes the getProxySelector and setProxySelector named NetPermissions. These 2 named permissions, were previously only documented on the ProxySelector.getDefault() and ProxySelector.setDefault() methods. With the removal of SecurityManager, the specification of these named properties ceases to exist. Having said that, would removal of these named NetPermission(s) require a CSR linked to this current issue?

The other major chunk of this change is moving the proxy determination logic in DefaultProxySelector into a private method from the previous doPriveleged() call block.

No new tests have been introduced. Existing tests in tier1 and tier2 continue to pass with this change.


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-8344233: Remove calls to SecurityManager and doPrivileged in java.net.ProxySelector and sun.net.spi.DefaultProxySelector after JEP 486 integration (Sub-task - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22145

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

Using diff file

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

Using Webrev

Link to Webrev Comment

….ProxySelector and sun.net.spi.DefaultProxySelector after JEP 486 integration
@bridgekeeper
Copy link

bridgekeeper bot commented Nov 15, 2024

👋 Welcome back jpai! 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 15, 2024

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

8344233: Remove calls to SecurityManager and doPrivileged in java.net.ProxySelector and sun.net.spi.DefaultProxySelector after JEP 486 integration

Reviewed-by: dfuchs

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 rfr Pull request is ready for review label Nov 15, 2024
@openjdk
Copy link

openjdk bot commented Nov 15, 2024

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

  • net
  • security

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 security security-dev@openjdk.org net net-dev@openjdk.org labels Nov 15, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 15, 2024

Webrevs

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

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

LGTM. No CSR needed for removing those permissions. There's no visible change to the public APIs, and no behavior change that was not already covered by JEP 486 CSR, since permissions checks have now become deadcode. Or am I missing something?

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

No CSR needed for removing those permissions. There's no visible change to the public APIs, and no behavior change that was not already covered by JEP 486 CSR, since permissions checks have now become deadcode. Or am I missing something?

I believe you are right. The Permission classes themselves haven't been deprecated, so I was just curious whether the removal of these named permissions that relate to such classes need to be handled in any specific manner.

@seanjmullan
Copy link
Member

No CSR needed for removing those permissions. There's no visible change to the public APIs, and no behavior change that was not already covered by JEP 486 CSR, since permissions checks have now become deadcode. Or am I missing something?

I believe you are right. The Permission classes themselves haven't been deprecated, so I was just curious whether the removal of these named permissions that relate to such classes need to be handled in any specific manner.

Those permission target names have already been removed from NetPermission and were listed as removed in the JEP 486 CSR - see the text that starts with "The standard permission target names of several subclasses ...". So no CSR should be needed.

@jaikiran
Copy link
Member Author

Thank you Sean, I had missed that part from the JEP 486 CSR.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Nov 16, 2024
@jaikiran
Copy link
Member Author

There were merge conflicts in this PR in the SecurityConstants.java file due to a recent integration in mainline. I've now resolved them and updated this PR.

@dfuch
Copy link
Member

dfuch commented Nov 16, 2024

LGTM

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 16, 2024
@jaikiran
Copy link
Member Author

Thank you Daniel for the review.

@jaikiran
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 16, 2024

Going to push as commit a91d4c0.

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

openjdk bot commented Nov 16, 2024

@jaikiran Pushed as commit a91d4c0.

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

@jaikiran jaikiran deleted the 8344233 branch November 16, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated net net-dev@openjdk.org security security-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants