-
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
8322809: SystemModulesMap::classNames and moduleNames arrays do not match the order #17316
Conversation
👋 Welcome back mchung! A progress list of the required criteria for merging this PR into |
Webrevs
|
*/ | ||
|
||
module com.foo { | ||
requires jdk.httpserver; |
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 requires
means the run-time image created by the test will have 3 modules with main classes. It needs a minimum of 2 so this dependency is okay.
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 and net.foo
requires jdk.jfr
which also has a main class. The run-time image created by this test has 4 modules.
|
||
private static final Path SRC_DIR = Paths.get(TEST_SRC, "src"); | ||
private static final Path MODS_DIR = Paths.get("mods"); | ||
private static final Path JMODS_DIR = Paths.get("jmods"); |
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.
In passing, these can use Path.of if you want.
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, surprising we didn't notice this before now but perhaps not too common to have several modules in the run-time image with a main class. I assume you'll bump the copyright header of SystemModulesPlugin before integrating.
@mlchung 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 16 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 |
/integrate |
Going to push as commit f3be138.
Your commit was automatically rebased without conflicts. |
One optimization of Jlink SystemModulesPlugin pre-resolves the module graph for modules with a main class. It stores the name of the initial module and the generated
SystemModules
class name in two arrays that can be obtained fromSystemModulesMap::moduleNames
andSystemModulesMap::classNames
. The elements in the array returned byclassNames()
are supposed to correspond to the elements in the array returned bymoduleNames()
. However, the implementation sorts both arrays by the value of the elements.This fix is simple and write the correct class names and not to sort the values separately.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17316/head:pull/17316
$ git checkout pull/17316
Update a local copy of the PR:
$ git checkout pull/17316
$ git pull https://git.openjdk.org/jdk.git pull/17316/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17316
View PR using the GUI difftool:
$ git pr show -t 17316
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17316.diff
Webrev
Link to Webrev Comment