RFR: 8300517: Refactor VisibleMemberTable (method members)
Pavel Rappo
prappo at openjdk.org
Mon Mar 6 20:11:09 UTC 2023
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.
-------------
Commit messages:
- Remove trailing whitespace (to please jcheck)
- Comment method accessibility for inheritance
- Rename VisibleMemberTable.isInherited for clarity
- Add FIXMEs to VisibleMemberTable.computeVisibleMethods
- Comment VisibleMemberTable.computeVisibleMethods
- Improve VisibleMemberTable.computeVisibleMethods
- Replace isEnclosureInterface with a better method
- Document Utils.isPackagePrivate
- Re-document VisibleMemberTable.getOverriddenMethod
- Removed unused Utils.isSubclassOf
- ... and 39 more: https://git.openjdk.org/jdk/compare/a97271e3...2050dab1
Changes: https://git.openjdk.org/jdk/pull/12887/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12887&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8300517
Stats: 685 lines in 13 files changed: 375 ins; 178 del; 132 mod
Patch: https://git.openjdk.org/jdk/pull/12887.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/12887/head:pull/12887
PR: https://git.openjdk.org/jdk/pull/12887
More information about the javadoc-dev
mailing list