Javadoc of package-private interface's methods is not inherited since Java 9

Viewed 79

I have a public class that implements a package-private interface. I noticed that the javadoc of the interface's methods is no longer inherited since OpenJDK 9. I tested this with OpenJDK 9, 11, and 16.

It does not matter if the implementation method in the class has no javadoc at all or javadoc with the {@inheritDoc} tag. In both cases no javadoc from the interface is inherited.

This is an example:

public class PublicClass implements PackagePrivateInterface {
  @Override public void sampleMethod() {}
}

interface PackagePrivateInterface {
    /** This javadoc is not inherited */ void sampleMethod();
}

Inheritance still works for public interfaces and for package-private classes/abstract classes. Is there a reason that this kind of inheritance of javadoc from package-private interfaces is no longer supported?

0 Answers
Related