RFR: 8304135: Introduce unified overridden methods query [v2]
Pavel Rappo
prappo at openjdk.org
Fri Jun 9 10:00:42 UTC 2023
On Sat, 3 Jun 2023 00:37:36 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>> Pavel Rappo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>>
>> - Merge branch 'master' into 8304135
>> - Extract getActualMethod
>> - Impose (almost) legacy order on implemented methods
>>
>> The legacy order is generated by an application of
>> Utils.overriddenMethod followed by application of
>> Utils.addSuperInterfaces.
>> - Fix errors reported by jcheck
>> - Initial commit
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberTable.java line 1015:
>
>> 1013: // will be computed once the complete sequence is available
>> 1014: var simpleOverride = false;
>> 1015: result = result.append(new OverrideData(toDeclaringType(s,
>
> `append` is *horrible* on `javac.util.List`
>
> Unless there is a string reason to be using it, you should probably be using plain old collection Lists, like `ArrayList` or `List.of`.
>
> If you're using `javac.util.List` because you're calling javac internal functionality that requires that kind of List, then your usage should be in methods in `WorkArounds`, which is intended to the the only doclet class that accesses javac internal methods and types.
>
> FYI, `javac.util.List` are immutable linked lists. New lists are created by prepending new entries. They predate use of Collections lists, and `java.util.List` was only retrofitted as a supertype later on in JDK 6 or 7. `append` works by copying the entire list. Internally in `javac` `ListBuffer` is used to create (temporary) mutable lists which are then made immutable by calling `.toList()`
Replied here https://github.com/openjdk/jdk/pull/14221#discussion_r1224059741
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14221#discussion_r1224109990
More information about the javadoc-dev
mailing list