Integrated: 8320716: ResolvedModule::reads includes self when configuration contains two or more automatic modules
Alan Bateman
alanb at openjdk.org
Fri Dec 1 07:34:14 UTC 2023
On Sun, 26 Nov 2023 18:18:10 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> This is update to the specification of the j.l.module.ResolvedModule.reads method to clarify that the set of resolved modules returned does not include itself. There is a small implementation change to align with the specification and fix an anomaly that arises with configurations that contain two or more automatic modules.
>
> Every module reads itself but the intent with ResolvedModule.reads is that it returns a set that doesn't include self. As things stand right now, the returned set does not include self when all modules in the configuration are explicit modules. However, if the configuration contains two or more automatic modules then the set includes self, a side effect of augmenting the readability graph due to implied readability.
>
> The specification of the "reads" method is updated. The implementation is also changed to skip automatic modules when augmenting the graph due to implied readability. It is skipped as each automatic module already reads all other modules. Note that it is not goal here to change the algorithm for handling implied readability, this may be a topic for a follow on PR.
>
> The existing ConfigurationTest already includes several tests for configurations consisting solely of explicit modules, no updates are needed. For configurations that include automatic modules, the existing AutomaticModulesTest is updated to add new asserts to each of the testConfigurationXXX methods. I decided to migrate this test to JUnit while visiting, most of it is just migrating the TestNG data providers to be parameterized tests. If needed then we could separate this but it's a simple migration so I left it in.
This pull request has now been integrated.
Changeset: 2476be45
Author: Alan Bateman <alanb at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/2476be4590f9ece654d16bf7b94f108f18a86061
Stats: 234 lines in 3 files changed: 46 ins; 51 del; 137 mod
8320716: ResolvedModule::reads includes self when configuration contains two or more automatic modules
Reviewed-by: mchung
-------------
PR: https://git.openjdk.org/jdk/pull/16818
More information about the core-libs-dev
mailing list