On Fri, 13 Dec 2024 14:00:46 GMT, Severin Gehwolf <sgehw...@openjdk.org> wrote:
>> test/jdk/tools/jlink/basic/AllModulePath.java line 220: >> >>> 218: */ >>> 219: @Test >>> 220: public void modulePathWithLimitMods() throws Exception { >> >> Is this test case different than `testLimitModules` which does >> >> jlink --output image1 --add-modules ALL-MODULE-PATH --module-path mods >> --limit-modules m1 >> >> >> `testAddModules` also tests: >> >> >> jlink --output image2 --add-modules m1,test --add-modules ALL-MODULE-PATH >> --module-path mods --limit-modules java.base > > We have: > - `testLimitModules()` limits on a module from the module path, `m1`. It > expects `m1` and it's dependencies in the image. > - `testAddModules()` limits on a module dependency, but has modules from the > module path added explicitly: `m1` and `test`. Therefore, expects `m1` and > `test` as well as there deps in the image. > - `modulePathWithLimitMods()` limits on a module dependency, but doesn't > include any other module with the `--add-modules` option. Therefore, only > expects `jdk.jfr` and its dependency, `java.base` to be included in the image. > > They are all slightly different and it's useful to test all 3 combinations. I've tried to clarify the cases with comments. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22494#discussion_r1883994796