Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8205593

Javadoc -link makes broken links if module name matches package name

    XMLWordPrintable

Details

    • b13
    • generic
    • Verified

    Backports

      Description

        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 :
        EXPECTED -
        The javadoc for MyClassClient will link references to MyClass to its javadoc at /javadoc/abc/a.b.c/a/b/c/MyClass.html

        ACTUAL -
        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


        Attachments

          Issue Links

            Activity

              People

                pmuthuswamy Priya Lakshmi Muthuswamy (Inactive)
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: