RFR: JDK-8286153: Remove redundant casts and other cleanup

Jonathan Gibbons jjg at openjdk.java.net
Thu May 5 16:58:37 UTC 2022


On Thu, 5 May 2022 14:43:37 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java line 1063:
>> 
>>> 1061:                 if (enclosing != null) {
>>> 1062:                     return switch (enclosing.getKind()) {
>>> 1063:                         case CLASS, ENUM, RECORD, INTERFACE, ANNOTATION_TYPE -> visit(enclosing);
>> 
>> Whoa! `RECORD` was missing. Does it make sense to accompany this PR with a small test that crashes javadoc with a type nested in a non-included record?
>
> That's one possibility. 
> 
> Other possibilities:
> * a separate issue to audit use of ENUM to make sure there is matching RECORD entries, or 
> * avoid using `default` to implicitly enable completeness checking, or
> * rewrite code to use `isDeclaredType`.

I've reviewed all uses of `ENUM`. All other places in javadoc look OK for having a sibling case for `RECORD`.

Filed [JDK-8286205](https://bugs.openjdk.java.net/browse/JDK-8286205) for more tests.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8543


More information about the javadoc-dev mailing list