-
Notifications
You must be signed in to change notification settings - Fork 542
8264139: Suppress removal warnings for Security Manager methods #528
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
Conversation
|
👋 Welcome back kcr! A progress list of the required criteria for merging this PR into |
|
@kevinrushforth |
|
@kevinrushforth |
|
@kevinrushforth |
Webrevs
|
wangweij
left a comment
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.
All change looks good. Some personal style preferences comments.
| accessible = Application.GetApplication().createAccessible(); | ||
| accessible.setEventHandler(new Accessible.EventHandler() { | ||
| @SuppressWarnings({"removal","deprecation"}) | ||
| @SuppressWarnings("removal") |
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.
Was this "deprecation" already useless before this change?
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.
Yes. The code to which it applied was removed back in JDK 9, but we forgot to remove the annotation.
| // Run the HttpClient in the page's access control context | ||
| this.response = AccessController.doPrivileged((PrivilegedAction<CompletableFuture<Void>>) () -> { | ||
| @SuppressWarnings("removal") | ||
| CompletableFuture<Void> tmpResponse = AccessController.doPrivileged((PrivilegedAction<CompletableFuture<Void>>) () -> { |
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.
Is "var" enough?
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.
Yes, I'll change it.
| private static final boolean verbose; | ||
|
|
||
| static { | ||
| verbose = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> |
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.
You can merge this assignment with the declaration on line 38. Or you can keep this so the check of verbose is in the same block with its assignment.
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 I'll keep this one as is to minimize changes.
|
|
||
| static { | ||
| dpiOverride = AccessController.doPrivileged((PrivilegedAction<Integer>) () -> Integer.getInteger("com.sun.javafx.screenDPI", 0)).intValue(); | ||
| @SuppressWarnings("removal") |
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.
Combine assignment and declaration?
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.
Good idea. This allows the static block to be removed.
| private static final int bits; | ||
|
|
||
| static { | ||
| bits = AccessController.doPrivileged((PrivilegedAction<Integer>) () -> { |
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.
Combine?
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.
Good idea. This allows the static block to be removed.
| private static final Permission modifyThreadGroupPerm = new RuntimePermission("modifyThreadGroup"); | ||
| private static final Permission modifyThreadPerm = new RuntimePermission("modifyThread"); | ||
|
|
||
| @SuppressWarnings("removal") |
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.
Maybe move this onto the 1st line inside the method?
|
When built with JDK 17ea26 +
|
arapte
left a comment
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 good to me.
|
@kevinrushforth 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: 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 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
/integrate |
|
Going to push as commit c81a722.
Your commit was automatically rebased without conflicts. |
|
@kevinrushforth Pushed as commit c81a722. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This PR adds the necessary
@SuppressWarnings("removal")annotations for the recently-integrated security manager deprecation, JEP 411. See openjdk/jdk#4073.There are four commits:
modules/*/src/main/java) using the same automated tooling that he used as part of the implementation of JEP 411.The first two commits represent the bulk of the changes. Other than scanning to ensure that there are no obvious errors, and testing, they probably don't need the same level of scrutiny as the manual changes do.
I tested this on all three platforms by doing a build / test with
JDK_HOMEset to a local JDK 17 ea build that includes the fix for JEP 411. I ran the build withgradle -PLINT=removaland verified that there were removal warnings for the security manager APIs without this fix and none with this fix.NOTE: The following files under
modules/javafx.web/src/androidandmodules/javafx.web/src/ioswere not processed by the automated tool. As I have no way to compile them, I chose not to manually fix them either, but doing so would be trivial as a follow-up fix if desired./reviewers 2
/contributor add weijun
/contributor add kcr
Progress
Issue
Reviewers
Contributors
<[email protected]><[email protected]>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/528/head:pull/528$ git checkout pull/528Update a local copy of the PR:
$ git checkout pull/528$ git pull https://git.openjdk.java.net/jfx pull/528/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 528View PR using the GUI difftool:
$ git pr show -t 528Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/528.diff