-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8345565: Remove remaining SecurityManager motivated APIs from sun.reflect.util #22572
Conversation
👋 Welcome back alanb! A progress list of the required criteria for merging this PR into |
@AlanBateman 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 14 new commits pushed to the
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 |
@AlanBateman The following labels will be automatically applied to this pull request:
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. |
Webrevs
|
The java.management change/removal looks good 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.
Couple of copyright updates missing, but otherwise looks fine to me.
src/java.base/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java
Show resolved
Hide resolved
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 for those extra cleanups.
throw new AssertionError("Unexpected kind of GenericDeclaration"); | ||
assert genericDeclaration instanceof Class<?> || | ||
genericDeclaration instanceof Method || | ||
genericDeclaration instanceof Constructor : "Unexpected kind of GenericDeclaration"; |
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 remove this; check is already done in make
factory.
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 had hoped to keep the change focused on the removal of the left over ReflectUtil.checkPackageAccess, the else throw AssertionError was a surprise to see. So yes, I agree it can be removed but I'd prefer not touch it now, future work in this area can remove it.
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.
Indeed, we should clean this up with things like MethodUtil.
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.
MethodUtil is for APIs that do reflective stuff on behave of callers so not tied to the SM execution mode. That is for another time.
/integrate |
Going to push as commit 691e692.
Your commit was automatically rebased without conflicts. |
@AlanBateman Pushed as commit 691e692. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
We hollowed out ReflectUtil as one of the early steps when removing the code for running in the SecurityManager execution mode. Most of the usages have now been removed so the empty (and unused) methods can be removed. FieldUtils and ConstructorUtils can be removed too.
ObjectInputStream/ObjectOutputStream has a left over package access check for the subclassing case that can be removed.
sun.reflect.generics.reflectiveObjects.TypeVariableImpl.getGenericDeclaration has a left over package access check that can be removed. I've changed the "should not happen" case to be an assert for now but it's in the wrong place. If we have a JDK bug in this area then it should be caught at construction time, not by the accessor method. This PR is focused on removing the use of ReflectUtil so don't want to do any more here.
The changes for java.management missed a usage ConstructorUtil.getConstructor in MBeanInstantiator.findConstructor. This is replaced, to allow ConstructorUtils be removed.
Testing: tier1-5
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22572/head:pull/22572
$ git checkout pull/22572
Update a local copy of the PR:
$ git checkout pull/22572
$ git pull https://git.openjdk.org/jdk.git pull/22572/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22572
View PR using the GUI difftool:
$ git pr show -t 22572
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22572.diff
Using Webrev
Link to Webrev Comment