On Mon, 6 Mar 2023 19:48:48 GMT, Pavel Rappo <[email protected]> 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.

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java
 line 197:

> 195:     }
> 196: 
> 197:     // TODO: jx.l.m ?

Not edited, but I note that Language Model and Compiler API have a very distant 
relationship :-(

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

> 285:      * appeared in JDK 8.
> 286:      */
> 287:     public boolean isPackagePrivate(Element e) {

Maybe change the method name, in line with the comment?

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

> 617:      * The record is used to pass the method along with the type where 
> that method is visible.
> 618:      * Passing the type explicitly allows to preserve a complete type 
> information, including
> 619:      * parametrization, which is otherwise unavailable without 
> computation similar to what

typo: parameterization

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

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

Reply via email to