ADDITIONAL SYSTEM INFORMATION :
Found on Java 10.0.1 on linux x86_64. Reproduced on Java 11 build 19.
A DESCRIPTION OF THE PROBLEM :
Where a class references a class in another module, and that module's javadoc is referenced with -link on the javadoc command line, the javadoc link for the other class has an incorrect href attribute, which points to the correct module but does not contain the path elements corresponding to the class's package. This bug only occurs if the target class is in a package which has the same name as the module it is part of.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a module a.b.c with a package a.b.c and a class a.b.c.MyClass. Compile the module to lib/abc.jar and create javadoc for it in /javadocs/abc
Create a second module d.e.f which depends on module a.b.c and uses a.b.c.MyClass. Run javadoc -link /javadocs/a.b.c --module-path lib --source-path src/def src/def/d/e/f/MyClassClient.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
The javadoc for MyClassClient will link references to MyClass to its javadoc at /javadoc/abc/a.b.c/a/b/c/MyClass.html
The javadoc for MyClassClient links references to MyClass to /javadoc/abc/MyClass.html . The package elements are missing from the URL path.
---------- BEGIN SOURCE ----------
git clone https://github.com/andrewmcguinness/javadoc_issue.git && cd javadoc_issue && ./build.sh
The master branch displays the bug. the "working" branch renames the target module to be different from the package name, and works correctly.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
If the module name a.b.c is changed to be different from the package name a.b.c, in the module-info.java files, everything works correctly
FREQUENCY : always