javadoc generate "extends Object" instead of the real class when the parent class is package private and comes from another module

136 views Asked by At

My file structure. I have 2 directories next to each other. module1 and module2.

module1:

src\hu\package1\TestPackagePrivateClass.java:

package hu.package1;

abstract class TestPackagePrivateClass { }

src\hu\package1\PackagePrivateClass2.java:

package hu.package1;

abstract class PackagePrivateClass2 { }

src\hu\package1\TestPublicClass.java:

package hu.package1;

public abstract class TestPublicClass { }

So 2 abstract package-private classes and 1 pubic abstract class.

module2:

src\hu\package1\TestChildClass.java:

package hu.package1;

public abstract class TestChildClass extends TestPackagePrivateClass {

    public PackagePrivateClass2 getPackagePrivateClass2() { return null; }

    public TestPublicClass getTestPublicClass() { return null; }

}

src\hu\package1\TestChildClass2.java:

package hu.package1;

public abstract class TestChildClass2 extends TestPublicClass {
}

src\hu\package2\ThirdChildClass.java:

package hu.package2;

import hu.package1.TestChildClass;

public class ThirdChildClass extends TestChildClass { }

So I run the following 2 commands... The first 2 from module1 and the second 2 from module2:

javac.exe -d .\build -target 1.8 src\hu\package1\*.java

javadoc.exe hu.package1 -sourcepath .\src -d .\doc -private

javac.exe -d .\build -target 1.8 -cp ..\module1\build src\hu\package1\*.java src\hu\package2\*.java

javadoc.exe hu.package1 hu.package2 -sourcepath .\src -cp ..\module1\build -d .\doc -private -link ..\..\module1\doc

Everything works perfectly fine, no warnings, no errors.

However my problem is that in the generated javadoc for module2 specifically for TestChildClass it shows that it extends from Object, and not from TestPackagePrivateClass. However the return type of getPackagePrivateClass2 is perfectly shown. Note that for TestChildClass2 which extends TestPublicClass from module1, the parent class is sown correct.

So it seems that javadoc is not displaying the parent class when it comes from another module and its not public. Is there a solution for this?

0

There are 0 answers