RFR: 8304146: Refactor VisibleMemberTable (LocalMemberTable) [v2]

Chen Liang liach at openjdk.org
Wed Mar 15 18:23:25 UTC 2023


On Wed, 15 Mar 2023 18:12:57 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> Please review a change to clean up and simplify LocalMemberTable; a container to cache, classify, and provide efficient lookup for the return value of `TypeElement.getEnclosedElements()`.
>> 
>> While the change primarily targets internals of LocalMemberTable, it also affects its clients: in particular, code that handles JavaFX documentation. That code does not seem to be tested well (I filed a bug for that: JDK-8304170). To make sure I haven't broken anything, aside from usual testing, I also cloned [OpenJFX](https://github.com/openjdk/jfx) and built its documentation with javadoc before and after the change. Documentation bundles were identical.
>
> Pavel Rappo has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Trivially rephrase TODO
>  - Address feedback
>    
>     - renames simplename to simpleName
>     - links to the relevant JBS issue from TODOs

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberTable.java line 888:

> 886:             for (Kind kind : Kind.values()) {
> 887:                 orderedMembers.compute(kind, (k, v) -> v == null ? List.of() : Collections.unmodifiableList(v));
> 888:                 namedMembers.compute(kind, (k, v) -> v == null ? Map.of() : Collections.unmodifiableMap(v));

Can just use `replaceAll` than using a for loop

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

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


More information about the javadoc-dev mailing list