RFR: 8299504: Resolve `uses` and `provides` at run time if the service is optional and missing [v2]

Alan Bateman alanb at openjdk.org
Mon Jan 20 12:12:20 UTC 2025


> Extend the support for optional dependences to allow for a service to be optional. The post-resolution consistency check specified by `Configuration.resolve` is relaxed to allow for the possibility that the service from a module in the module graph at compile-time but the module is not in the module graph at run-time.
> 
> ConfigurationTest is ported from TestNG to JUnit and updated to add new tests testUsesOptionalService$N and testProvidesOptionalService$N. The port to JUnit is mostly trivial/mechanical changes but it does create a bit of noise - I can move this port to another issue if it makes the harder to see the additions to the test.

Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Add Optional Services section from Alex
 - Merge branch 'master' into JDK-8299504
 - Initial commit

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/23147/files
  - new: https://git.openjdk.org/jdk/pull/23147/files/76e93724..d2f7b090

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23147&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23147&range=00-01

  Stats: 6099 lines in 360 files changed: 4008 ins; 378 del; 1713 mod
  Patch: https://git.openjdk.org/jdk/pull/23147.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23147/head:pull/23147

PR: https://git.openjdk.org/jdk/pull/23147


More information about the core-libs-dev mailing list