RFR: 8300517: Refactor VisibleMemberTable (method members) [v2]

Jonathan Gibbons jjg at openjdk.org
Thu Mar 9 22:37:20 UTC 2023


On Wed, 8 Mar 2023 14:58:14 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> Please review this explorative refactoring for VisibleMemberTable (VMT).
>> 
>> This is the first round of refactoring for VMT. This round is about *method members*: declared (overriding and not) and inherited.
>> 
>> During this work I gained some insight into internal workings of VMT, fixed what was feasible and left TODOs and FIXMEs for everything else. Leaving those comments might look untidy, but leaving them out is wasteful: they clearly mark issues that should be revisited in upcoming rounds of refactoring.
>> 
>> As I see it today, the main issue with VMT is that implements complex and error-prone computations from Java Language Specification (JLS) by hand. For example, VMT interprets JLS rules for relations such as _inherits_, _overrides_ and _hides_. As one would imagine, sometimes VMT does it incorrectly. It would be better to eventually re-implement VMT using `javax.lang.model` as much as possible. Unlike that of `jdk.javadoc`, the day job of `javax.lang.model` is to provide JLS services.
>
> Pavel Rappo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Respond to feedback

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

> 1027:      */
> 1028:     public TypeMirror getFirstVisibleSuperClass(TypeMirror type) {
> 1029:         // TODO: this computation should be eventually delegated to VisibleMemberTable

Agreed, both the computation and this method and its `TypeElement` sibling.

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

PR: https://git.openjdk.org/jdk/pull/12887


More information about the javadoc-dev mailing list