RFR: 8242564: javadoc crashes:: class cast exeception com.sun.tools.javac.code.Symtab$6
Vladimir Petko
vpetko at openjdk.org
Tue Jan 16 22:15:01 UTC 2024
'--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.
-------------
Commit messages:
- Move test comments
- Use toolbox to write the test file
- add text block indentation
- Return Kind.OTHER for undefined symbols
- Add ClassTree test with undefined symbols
Changes: https://git.openjdk.org/jdk/pull/17435/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17435&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8242564
Stats: 58 lines in 2 files changed: 53 ins; 0 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/17435.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17435/head:pull/17435
PR: https://git.openjdk.org/jdk/pull/17435
More information about the javadoc-dev
mailing list