RFR: 8282756: Make ElementKind checks more specific

Jonathan Gibbons jjg at openjdk.java.net
Tue Mar 8 18:04:02 UTC 2022


On Tue, 8 Mar 2022 17:41:56 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

> Out of all executable elements, inherit documentation only for methods.

`Utils.isClass` and `Utils.isInterface` seem inconsistent.   We should try and come up with consistent patterns for "is any class", "is exactly class", "is interface", "is exactly interface"

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java line 311:

> 309:     // Note that e.getKind().isInterface() is not the same as e.getKind() == INTERFACE
> 310:     public boolean isInterface(Element e) {
> 311:         return e.getKind() == INTERFACE;

This seems asymmetrically different from `isClass`. We should come up with more consistent terminology/usage.

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

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


More information about the javadoc-dev mailing list