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
8264139: Suppress removal warnings for Security Manager methods #528
Conversation
|
@kevinrushforth |
@kevinrushforth |
@kevinrushforth |
Webrevs
|
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.
@@ -9966,7 +9966,7 @@ Accessible getAccessible() { | |||
if (accessible == null) { | |||
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.
@@ -412,11 +411,13 @@ private HTTP2Loader(WebPage webPage, | |||
}; | |||
|
|||
// 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.
public class ModuleHelper { | ||
private static final Method getModuleMethod; | ||
private static final Method getResourceAsStreamMethod; | ||
|
||
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.
@@ -41,7 +40,9 @@ | |||
private static final int dpiOverride; | |||
|
|||
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.
public class LinuxArch { | ||
|
||
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.
@@ -240,12 +242,14 @@ private static int fwkGetMaximumHTTPConnectionCountPerHost() { | |||
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 +
|
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. 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
|
/integrate |
Going to push as commit c81a722.
Your commit was automatically rebased without conflicts. |
@kevinrushforth Pushed as commit c81a722. |
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_HOME
set to a local JDK 17 ea build that includes the fix for JEP 411. I ran the build withgradle -PLINT=removal
and 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/android
andmodules/javafx.web/src/ios
were 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
<weijun@openjdk.org>
<kcr@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/528/head:pull/528
$ git checkout pull/528
Update a local copy of the PR:
$ git checkout pull/528
$ git pull https://git.openjdk.java.net/jfx pull/528/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 528
View PR using the GUI difftool:
$ git pr show -t 528
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/528.diff