I realised there’s a simpler solution to the problem. Instead of using a Set to track packages with non-modular documentation we can just return the module name that matches our internal model in #checkLinkCompatibility.
I also changed the JBS summary to „javadoc fails to link to docs with non-matching modularity“ so it covers both cases. New Webrev: http://cr.openjdk.java.net/~hannesw/8240169/webrev.01/ <http://cr.openjdk.java.net/~hannesw/8240169/webrev.01/> Hannes > Am 02.04.2020 um 16:06 schrieb Hannes Wallnoefer > <hannes.wallnoe...@oracle.com>: > > Please review: > > JBS: https://bugs.openjdk.java.net/browse/JDK-8240169 > Webrev: http://cr.openjdk.java.net/~hannesw/8240169/webrev.00/ > > This patch allows using external documentation even if it doesn’t match the > external library in terms of modularity, i.e. non-modular documentation can > be used for an modular library and vice versa. Instead of showing an error a > warning is issued. There is still a warning if code and documentation do not > match, but we use the check to tweak reference lookup so that we are still > able to link to the appropriate documentation. > > I think that all relevant cases for combinations of modular and non-modular > code are covered by existing tests (some of which change with this patch > obviouly). > > TestLinkOptionWithAutomaticModule.java covers using a jar file as automatic > or unnamed module, both of which cases were already supported as of > JDK-8212233, so no changes there. > > TestLinkOptionWithModule.java covers all combinations of modular and > non-modular code and documentation. For the two tests that cover non-matching > combinations, I changed the expected return code to OK and added expected > output with the link HTML. The message about the mismatching documentation is > still there, but it is a warning instead of an error. > > I also added the JBS id to the @bug tag in TestLinkOptionWithModule.java as > well as in TestClassCrossReferences.java which is another test that contains > significant changes. > > Thanks, > Hannes