On Tue, 16 Jan 2024 02:17:10 GMT, Vladimir Petko <[email protected]> wrote:
> '--ignore-source-errors' allows generating Javadoc for the packages that
> contain compilation errors.
>
> jdk.javadoc.internal.doclets.toolkit.util.ClassTree generates a type
> hierarchy for javadoc that may include error types such as
>
> class Foo extends Bar {
> }
> ```
> where Bar is undefined.
>
> The user still wants to generate documentation for Foo and have Bar as a text
> label.
>
> For the unknown class Bar it is impossible to detect the enclosing class/file
> and javadoc crashes with exception.
>
> This PR returns Kind.OTHER for the error types, avoiding the javadoc crash.
test ran at commit 53d29853fd703406247480b6a23976bb0693e5e1 fail due to the
ClassCastException:
==============================
Test summary
==============================
TEST TOTAL PASS FAIL ERROR
jtreg:test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java
>> 1 0 1 0 <<
==============================
TEST FAILURE
Test ran at the commit 9ebb1ac75dc3fe70133e434901ba858b391cf5d3 (tip of the
branch(with fix included) pass:
==============================
Test summary
==============================
TEST TOTAL PASS FAIL ERROR
jtreg:test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java
1 1 0 0
==============================
TEST SUCCESS
Stopping javac server
Finished building target 'test' in configuration 'linux-x86_64-server-release'
$make TEST=:langtools_javadoc test
==============================
Test summary
==============================
TEST TOTAL PASS FAIL ERROR
jtreg:test/langtools:langtools_javadoc 500 500 0 0
==============================
TEST SUCCESS
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17435#issuecomment-1892981882