-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8353642: Deprecate URL::getPermission method and networking permission classes for removal #24592
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back dfuchs! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
The CSR is also ready to be reviewed at https://bugs.openjdk.org/browse/JDK-8354406 |
*/ | ||
@Deprecated(since = "25") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this (and all other getPermission methods) be "forRemoval=true"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly. @AlanBateman may have some thoughts on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should at least consider deprecating URLConnection.getPermission and HttpURLConnection.getPermission for removal, only because I don't immediately see the advantage of doing it in two steps for these two APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - I will do that then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
return this.sp.implies(that.sp); | ||
@SuppressWarnings("removal") | ||
var result = this.sp.implies(that.sp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we need to rewrite this code without SocketPermissions? Can we remove it, maybe? It is only used by CodeSource.implies, which is not used by the JDK (but may be used elsewhere).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the JavaDoc of the implies method references the SocketPermission. That will also need to be cleaned up at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will be left over for someone in security-libs to cleanup this code at their convenience before we remove SocketException.
Hmmm... If the public API references SocketException we might have to deprecate in this PR too. Not sure what the implications are. Maybe @seanjmullan can advise.
@@ -1305,6 +1307,8 @@ public static void main(String args[]) throws Exception { | |||
* @serial include | |||
*/ | |||
|
|||
@SuppressWarnings("removal") | |||
@Deprecated(since = "25", forRemoval = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class is internal, no need to deprecate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It helps getting warnings at the place where the class is used.
The GHA failure (Windows) appears to be related. |
Yes - I missed one windows specific file in my original patch. I have a test running in the CI and I am waiting for it to pass before updating the PR. |
@@ -456,12 +457,16 @@ private boolean matchLocation(CodeSource that) { | |||
return false; | |||
} | |||
if (this.sp == null) { | |||
this.sp = new SocketPermission(thisHost, "resolve"); | |||
@SuppressWarnings("removal") | |||
var _ = this.sp = new SocketPermission(thisHost, "resolve"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for the var _ =
bit ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuppressWarnings
can not be applied to a an expression - it needs a (variable/method/class) declaration
Should be fixed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Please find her a patch that deprecate networking permission classes for removal. The method
URL::getPermission
now serves little purpose and is also deprecated. That method was overridden in subclasses and specified to return some of the deprecated permissions.Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24592/head:pull/24592
$ git checkout pull/24592
Update a local copy of the PR:
$ git checkout pull/24592
$ git pull https://git.openjdk.org/jdk.git pull/24592/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24592
View PR using the GUI difftool:
$ git pr show -t 24592
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24592.diff
Using Webrev
Link to Webrev Comment