JDK-8254622 : Hide superclasses from conditionally exported packages
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-10-12
  • Updated: 2025-04-24
  • Resolved: 2025-04-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b19Fixed
Related Reports
CSR :  
Causes :  
Relates :  
Relates :  
Relates :  
Description
In JDK 5.0, javadoc was updated to elide information about non-public superclasses of a class (JDK-4874845). An analogous situation seems to arise in the Vector API (JDK-8223348) where the various superclasses from less-than-fully-exported packages are printed.
Comments
Thanks Matthias, JDK-8354766 has been filed to fix this.
17-04-2025

We had 2 test failures today one on linux aarch64, one on AIX in jtreg test jdk/javadoc/doclet/testUnexported/TestUnexported.java failure looks like this, could it be related ? ----------direct:(11/928)---------- /testdir/jtreg/test/langtools/tools/lib/toolbox/JavacTask.java:46: error: package com.sun.tools.javac.api is not visible import com.sun.tools.javac.api.JavacTaskImpl; ^ (package com.sun.tools.javac.api is declared in module jdk.compiler, which does not export it to the unnamed module) /testdir/jtreg/test/langtools/tools/lib/toolbox/JavacTask.java:47: error: package com.sun.tools.javac.api is not visible import com.sun.tools.javac.api.JavacTool; ^ (package com.sun.tools.javac.api is declared in module jdk.compiler, which does not export it to the unnamed module) Note: /testdir/jtreg/test/langtools/tools/lib/toolbox/AbstractTask.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors result: Failed. Compilation failed: Compilation failed
17-04-2025

Changeset: 5d976089 Branch: master Author: Hannes Wallnöfer <hannesw@openjdk.org> Date: 2025-04-13 10:08:39 +0000 URL: https://git.openjdk.org/jdk/commit/5d9760897014c9a2cf0813af3ffbfb358ef55e31
13-04-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/24446 Date: 2025-04-04 13:36:19 +0000
04-04-2025

We recently ran into this in JavaFX, where we have an intermediate "AbstractNode" class in a conditionally-exported package of one module being extended by a class in another JavaFX module. This package and intermediate class are not visible to applications nor do they show up in the documentation, but the subclass in question shows AbstractNode in its hierarchy. See CSR JDK-8341659. In case it is helpful, I created a simple example to illustrate this. In this simple example, there are not even any qualified exports, since there is only a single module. In my example, I have a module "mymod" that exports only package "pgk1", and the following class hierarchy: pkg1/ NonPublic.java : class NonPublic {} A.java : public class A extends NonPublic {} B.java : public class B extends pkg2.Hidden {} pkg2/ Hidden.java. : public class Hidden {} Neither pkg1.NonPublic nor pkg2.Hidden are accessible to applications that use "mymod" and neither class shows up in the docs. The javadoc tool elides pkg1.NonPublic from the class hierarchy of pkg1.A, but shows pkg2.Hidden in the hierarchy of pkg1.B. To reproduce, unzip the example.zip file and run javadoc as follows, or you can use the "do-javadoc.sh" script: $ javadoc --module-source-path src -d javadoc mymod/pkg1 -exclude mymod/pkg2
18-12-2024

Until the Vector API is integrated this can be reproduced with the following instructions: git clone git@github.com:openjdk/panama-vector.git cd panama-vector git switch vector-unstable bash configure make docs then view the documentation for jdk.incubator.vector.Vector.
12-10-2020